DPCParameters#
- class do_dpc.dpc.dpc_structs.DPCParameters(Q, R, tau_p, tau_f, Q_final=None, R_final=None, R_delta=None, R_delta_first=None)[source]#
Bases:
objectStores parameters for a data-driven predictive controller.
- Q#
State weighting matrix for the cost function (shape (p, p)).
- Type:
np.ndarray
- R#
Control input weighting matrix for the cost function (shape (m, m)).
- Type:
np.ndarray
- tau_p#
Initial time horizon for past data.
- Type:
int
- tau_f#
Future time horizon for predictions.
- Type:
int
- Q_horizon#
Block-diagonal matrix of Q repeated for tau_f steps.
- Type:
np.ndarray
- R_horizon#
Block-diagonal matrix of R repeated for tau_f steps.
- Type:
np.ndarray
- Q_final#
Final state cost. If None, same as Q (shape (p, p)).
- Type:
Optional[np.ndarray]
- R_final#
Final input cost. If None, same as R (shape (m, m)).
- Type:
Optional[np.ndarray]
- R_delta#
Weight cost for the Delta u_f (Change in control input) (shape (m, m)).
- Type:
Optional[np.ndarray]
- R_delta_first#
Weight cost for u_p(0)-u_f(0) (Change in control input) (shape (m, m)).
- Type:
Optional[np.ndarray]
Note
If R_delta_first is None but R_delta is provided, R_delta will be used as the first value.
- Raises:
ValueError – If tau_p or tau_f are not positive integers.
ValueError – If Q or R are not square matrices of expected shape.
ValueError – If R_final, R_delta_first, R_delta do not have the same shape as R.
ValueError – If Q_final does not have the same shape as Q.
ValueError – If Q, Q_final is not positive semidefinite.
ValueError – If R, R_final, R_delta, R_delta_first` is not positive definite.
Methods#
Attributes#
Q_final#
-
DPCParameters.Q_final:
Optional[ndarray] = None#
R_delta#
-
DPCParameters.R_delta:
Optional[ndarray] = None#
R_delta_first#
-
DPCParameters.R_delta_first:
Optional[ndarray] = None#
R_final#
-
DPCParameters.R_final:
Optional[ndarray] = None#
Q#
-
DPCParameters.Q:
ndarray#
R#
-
DPCParameters.R:
ndarray#
tau_p#
-
DPCParameters.tau_p:
int#
tau_f#
-
DPCParameters.tau_f:
int#
Q_horizon#
-
DPCParameters.Q_horizon:
ndarray#
R_horizon#
-
DPCParameters.R_horizon:
ndarray#
R_delta_horizon#
-
DPCParameters.R_delta_horizon:
Optional[ndarray]#