Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions autotune/system_identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

no need for this new line

# High-pass filter parameters
if self.f_hp > 0.0:
tau_hp = 1 / (2 * np.pi * self.f_hp)
Expand Down Expand Up @@ -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):
Expand Down
Loading