diff --git a/autotune/system_identification.py b/autotune/system_identification.py index 290be14..0b68e1a 100644 --- a/autotune/system_identification.py +++ b/autotune/system_identification.py @@ -63,8 +63,11 @@ def __init__(self, n=2, m=2, d=1, dt=0.0): self.lbda = 1.0 - self.dt / tau def fit(self, u, y): - n_steps = len(u) + u = np.asarray(u).flatten() + y = np.asarray(y).flatten() + n_steps = len(u) + # High-pass filter parameters if self.f_hp > 0.0: tau_hp = 1 / (2 * np.pi * self.f_hp) @@ -112,7 +115,7 @@ def fit(self, u, y): # Update model rls.update(u_lp[k], y_lp[k]) - theta_hat = rls._theta_hat + theta_hat = np.array(rls._theta_hat).flatten() # Save for plotting for i in range(self.n):