|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| __init__ (self, List[np.ndarray] axes, np.ndarray u_grid, str bounds_mode="clip") | |
| np.ndarray | lookup (self, float P_u_F, float P_u_O, float F_ref, float MR_ref) |
| None | save (self, str filepath) |
| "PolicyLUT" | load (cls, str filepath) |
| Tuple[int,...] | grid_shape (self) |
Public Attributes | |
| axes = axes | |
| u_grid = u_grid | |
| str | bounds_mode = bounds_mode |
Protected Attributes | |
| _interp_u_F | |
| _interp_u_O | |
Look-up table for controller policy u = f(P_u_F, P_u_O, F_ref, MR_ref).
Definition at line 33 of file policy_lut.py.
| engine.control.robust_ddp.policy_lut.PolicyLUT.__init__ | ( | self, | |
| List[np.ndarray] | axes, | ||
| np.ndarray | u_grid, | ||
| str | bounds_mode = "clip" ) |
Parameters:
-----------
axes : List[np.ndarray]
Grid axes [P_u_F, P_u_O, F_ref, MR_ref], each 1D sorted
u_grid : np.ndarray
Control values shape (n_P_u_F, n_P_u_O, n_F_ref, n_MR_ref, N_CONTROL)
bounds_mode : str
"clip" = clamp query to grid bounds; "nearest" = use nearest boundary value
Definition at line 36 of file policy_lut.py.
| Tuple[int, ...] engine.control.robust_ddp.policy_lut.PolicyLUT.grid_shape | ( | self | ) |
Return grid shape (n_P_u_F, n_P_u_O, n_F_ref, n_MR_ref).
Definition at line 138 of file policy_lut.py.
References u_grid.
| "PolicyLUT" engine.control.robust_ddp.policy_lut.PolicyLUT.load | ( | cls, | |
| str | filepath ) |
Load LUT from .npz file.
Definition at line 124 of file policy_lut.py.
Referenced by engine.layerx.measurements.MeasurementStore.get().
| np.ndarray engine.control.robust_ddp.policy_lut.PolicyLUT.lookup | ( | self, | |
| float | P_u_F, | ||
| float | P_u_O, | ||
| float | F_ref, | ||
| float | MR_ref ) |
Interpolate optimal control at query point.
Parameters:
-----------
P_u_F : float
Fuel ullage pressure [Pa]
P_u_O : float
Oxidizer ullage pressure [Pa]
F_ref : float
Reference thrust [N]
MR_ref : float
Reference mixture ratio
Returns:
--------
u : np.ndarray, shape (N_CONTROL,)
[u_F, u_O] in [0, 1]
Definition at line 64 of file policy_lut.py.
References _interp_u_F, _interp_u_O, controller_lut.config.ControllerLUTConfig.axes, axes, and bounds_mode.
| None engine.control.robust_ddp.policy_lut.PolicyLUT.save | ( | self, | |
| str | filepath ) |
Save LUT to .npz file.
Definition at line 108 of file policy_lut.py.
References controller_lut.config.ControllerLUTConfig.axes, axes, bounds_mode, and u_grid.
|
protected |
Definition at line 57 of file policy_lut.py.
Referenced by lookup().
|
protected |
Definition at line 60 of file policy_lut.py.
Referenced by lookup().
| engine.control.robust_ddp.policy_lut.PolicyLUT.axes = axes |
Definition at line 52 of file policy_lut.py.
| str engine.control.robust_ddp.policy_lut.PolicyLUT.bounds_mode = bounds_mode |
Definition at line 54 of file policy_lut.py.
| engine.control.robust_ddp.policy_lut.PolicyLUT.u_grid = u_grid |
Definition at line 53 of file policy_lut.py.
Referenced by grid_shape(), and save().