From df71ed69eb7931a96cbba7e46c4a8c01c421a563 Mon Sep 17 00:00:00 2001 From: Johannes Kaisinger Date: Thu, 17 Oct 2024 15:02:04 +0200 Subject: [PATCH 1/2] Add space after commas --- control/modelsimp.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/control/modelsimp.py b/control/modelsimp.py index d2eadc4c3..be9949374 100644 --- a/control/modelsimp.py +++ b/control/modelsimp.py @@ -667,21 +667,21 @@ def markov(*args, m=None, transpose=False, dt=None, truncate=False): # Set up the full problem # Create matrix of (shifted) inputs - UUT = np.zeros((p*m,(l))) + UUT = np.zeros((p*m, l)) for i in range(m): # Shift previous column down and keep zeros at the top - UUT[i*p:(i+1)*p,i:] = Umat[:,:l-i] + UUT[i*p:(i+1)*p, i:] = Umat[:, :l-i] # Truncate first t=0 or t=m time steps, transpose the problem for lsq - YY = Ymat[:,t:].T - UU = UUT[:,t:].T + YY = Ymat[:, t:].T + UU = UUT[:, t:].T # Solve for the Markov parameters from YY = UU @ H.T HT, _, _, _ = np.linalg.lstsq(UU, YY, rcond=None) H = HT.T/dt # scaling - H = H.reshape(q,m,p) # output, time*input -> output, time, input - H = H.transpose(0,2,1) # output, input, time + H = H.reshape(q, m, p) # output, time*input -> output, time, input + H = H.transpose(0, 2, 1) # output, input, time # for siso return a 1D array instead of a 3D array if q == 1 and p == 1: From b70c0edae4f3b6942a6dc694921e304fe3c888a3 Mon Sep 17 00:00:00 2001 From: Johannes Kaisinger Date: Sat, 19 Oct 2024 18:35:41 +0200 Subject: [PATCH 2/2] Update docstring hash for markov --- control/tests/docstrings_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control/tests/docstrings_test.py b/control/tests/docstrings_test.py index 28bd0f38c..70a0cc3c1 100644 --- a/control/tests/docstrings_test.py +++ b/control/tests/docstrings_test.py @@ -39,7 +39,7 @@ control.ss2tf: '48ff25d22d28e7b396e686dd5eb58831', control.tf: '53a13f4a7f75a31c81800e10c88730ef', control.tf2ss: '086a3692659b7321c2af126f79f4bc11', - control.markov: '753309de348132ef238e78ac756412c1', + control.markov: 'eda7c4635bbb863ae6659e574285d356', control.gangof4: '0e52eb6cf7ce024f9a41f3ae3ebf04f7', }