STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.control.robust_ddp.policy_lut.PolicyLUT Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

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.

Member Function Documentation

◆ grid_shape()

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.

◆ load()

"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().

◆ lookup()

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.

◆ save()

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.

Member Data Documentation

◆ _interp_u_F

engine.control.robust_ddp.policy_lut.PolicyLUT._interp_u_F
protected
Initial value:
= _make_interpolator(
axes, u_grid[..., 0], bounds_mode
)

Definition at line 57 of file policy_lut.py.

Referenced by lookup().

◆ _interp_u_O

engine.control.robust_ddp.policy_lut.PolicyLUT._interp_u_O
protected
Initial value:
= _make_interpolator(
axes, u_grid[..., 1], bounds_mode
)

Definition at line 60 of file policy_lut.py.

Referenced by lookup().

◆ axes

engine.control.robust_ddp.policy_lut.PolicyLUT.axes = axes

Definition at line 52 of file policy_lut.py.

Referenced by lookup(), and save().

◆ bounds_mode

str engine.control.robust_ddp.policy_lut.PolicyLUT.bounds_mode = bounds_mode

Definition at line 54 of file policy_lut.py.

Referenced by lookup(), and save().

◆ u_grid

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().


The documentation for this class was generated from the following file: