Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions direct_data_driven_mpc/lti_data_driven_mpc_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,15 +1097,15 @@ def set_input_output_setpoints(
Note:
This method sets the values of the `u_s` and `y_s` attributes with
the provided new setpoints and updates the values of `u_s_param`
and `y_r_param` to update the data-driven MPC controller setpoint.
and `y_s_param` to update the data-driven MPC controller setpoint.
"""
# Validate input types and dimensions
if u_s.shape != self.u_s.shape:
raise ValueError(
"Incorrect dimensions. `u_s` must have shape "
f"{self.u_s.shape}, but got {u_s.shape} instead."
)
if y_s.shape != self.y_s.shape: # Replace with actual expected shape
if y_s.shape != self.y_s.shape:
raise ValueError(
"Incorrect dimensions. `y_s` must have shape "
f"{self.y_s.shape}, but got {y_s.shape} instead."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ def set_output_setpoint(self, y_r: np.ndarray) -> None:
if y_r.shape != self.y_r.shape:
raise ValueError(
"Incorrect dimensions. `y_r` must have shape "
f"{self.y_s.shape}, but got {y_r.shape} instead."
f"{self.y_r.shape}, but got {y_r.shape} instead."
)

# Update output setpoint and its parameter value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def simulate_lti_data_driven_mpc_control_loop(
mpc_cost_val = data_driven_mpc_controller.get_optimal_cost_value()
print_mpc_step_info(
verbose=verbose,
step=t,
step=k,
mpc_cost_val=mpc_cost_val,
u_sys_k=u_sys[k, :].flatten(),
u_s=u_s.flatten(),
Expand Down Expand Up @@ -305,7 +305,7 @@ def simulate_nonlinear_data_driven_mpc_control_loop(
mpc_cost_val = data_driven_mpc_controller.get_optimal_cost_value()
print_mpc_step_info(
verbose=verbose,
step=t,
step=k,
mpc_cost_val=mpc_cost_val,
y_sys_k=y_sys[k, :].flatten(),
y_s=y_r.flatten(),
Expand Down