API Reference¶
state_space_design.lqrTool.cli¶
Command line interface for the LQR tool.
state_space_design.lqrTool.apis¶
- class state_space_design.lqrTool.apis.LQRRunRequest(A: 'Optional[str]' = None, B: 'Optional[str]' = None, C: 'Optional[str]' = None, D: 'Optional[str]' = '0', num: 'Optional[str]' = None, den: 'Optional[str]' = None, Q: 'str' = 'eye', R: 'str' = '1', x0: 'Optional[str]' = None, step: 'bool' = False, step_amp: 'float' = 1.0, prefilter: 'PrefilterMode' = 'dcgain', tfinal: 'float' = 8.0, dt: 'float' = 0.01, plots: 'PlotsMode' = 'mpl')[source]¶
Bases:
object- Parameters:
A (str | None)
B (str | None)
C (str | None)
D (str | None)
num (str | None)
den (str | None)
Q (str)
R (str)
x0 (str | None)
step (bool)
step_amp (float)
prefilter (Literal['ogata', 'dcgain', 'none'])
tfinal (float)
dt (float)
plots (Literal['mpl', 'plotly', 'both', 'none'])
- A: str | None = None¶
- B: str | None = None¶
- C: str | None = None¶
- D: str | None = '0'¶
- Q: str = 'eye'¶
- R: str = '1'¶
- den: str | None = None¶
- dt: float = 0.01¶
- num: str | None = None¶
- plots: Literal['mpl', 'plotly', 'both', 'none'] = 'mpl'¶
- prefilter: Literal['ogata', 'dcgain', 'none'] = 'dcgain'¶
- step: bool = False¶
- step_amp: float = 1.0¶
- tfinal: float = 8.0¶
- x0: str | None = None¶
- class state_space_design.lqrTool.apis.LQRRunResult(K: 'list', P: 'list', eig_cl: 'list', prefilter_gain: 'float | None', rank_ctrb: 'int', note: 'str' = '')[source]¶
Bases:
object- Parameters:
K (list)
P (list)
eig_cl (list)
prefilter_gain (float | None)
rank_ctrb (int)
note (str)
- K: list¶
- P: list¶
- eig_cl: list¶
- note: str = ''¶
- prefilter_gain: float | None¶
- rank_ctrb: int¶
state_space_design.lqrTool.app¶
- class state_space_design.lqrTool.app.LQRApp(req: 'LQRRunRequest')[source]¶
Bases:
object- Parameters:
req (LQRRunRequest)
- req: LQRRunRequest¶
state_space_design.lqrTool.core¶
- class state_space_design.lqrTool.core.LQRDesignResult(K: 'np.ndarray', P: 'np.ndarray', eig_cl: 'np.ndarray')[source]¶
Bases:
object- Parameters:
K (ndarray)
P (ndarray)
eig_cl (ndarray)
- K: ndarray¶
- P: ndarray¶
- eig_cl: ndarray¶
- class state_space_design.lqrTool.core.Simulator[source]¶
Bases:
objectSimulation utilities for initial and forced responses with robust result unpacking.
- static forced_step(model, K, N, T, amp=1.0)[source]¶
- Parameters:
model (StateSpaceModel)
K (ndarray)
N (float)
T (ndarray)
amp (float)
- Return type:
- static initial(model, K, x0, T)[source]¶
- Parameters:
model (StateSpaceModel)
K (ndarray)
x0 (ndarray)
T (ndarray)
- Return type:
- class state_space_design.lqrTool.core.StateSpaceModel(A: 'np.ndarray', B: 'np.ndarray', C: 'np.ndarray', D: 'np.ndarray')[source]¶
Bases:
object- Parameters:
A (ndarray)
B (ndarray)
C (ndarray)
D (ndarray)
- A: ndarray¶
- B: ndarray¶
- C: ndarray¶
- D: ndarray¶
- property m: int¶
- property n: int¶
- property p: int¶
state_space_design.lqrTool.io¶
- state_space_design.lqrTool.io.build_model_from_ABCD(A, B, C, D)[source]¶
- Parameters:
A (str)
B (str)
C (str | None)
D (str | None)
- Return type:
- state_space_design.lqrTool.io.build_model_from_tf(num, den, C=None, D=None)[source]¶
- Parameters:
num (str)
den (str)
C (str | None)
D (str | None)
- Return type:
state_space_design.lqrTool.plotting¶
- state_space_design.lqrTool.plotting.plot_mpl_initial(T, x, y, u, title='LQR initial-condition response')[source]¶
- Parameters:
title (str)
- state_space_design.lqrTool.plotting.plot_mpl_step(T, x, y, u, title='LQR unit-step response (servo)')[source]¶
- Parameters:
title (str)