API Reference

state_space_design.observerGainMatrixTool.cli

Command line interface for observerGainMatrixTool.

state_space_design.observerGainMatrixTool.cli.build_parser()[source]
Return type:

ArgumentParser

state_space_design.observerGainMatrixTool.cli.main(argv=None)[source]
Parameters:

argv (list[str] | None)

Return type:

int

state_space_design.observerGainMatrixTool.apis

class state_space_design.observerGainMatrixTool.apis.ObserverRequest(A: 'str', C: 'str', poles: 'List[complex]', method: 'str' = 'auto', place_fallback: 'str' = 'none', jitter_eps: 'float' = 1e-06, B: 'Optional[str]' = None, K: 'Optional[str]' = None, K_poles_csv: 'Optional[str]' = None, K_poles_list: 'Optional[List[str]]' = None, compute_closed_loop: 'bool' = False, x0: 'Optional[str]' = None, e0: 'Optional[str]' = None, t_final: 'float' = 0.0, dt: 'float' = 0.01, pretty: 'bool' = False, equations: 'bool' = False, eq_style: 'str' = 'auto', latex_out: 'Optional[str]' = None)[source]

Bases: object

Parameters:
  • A (str)

  • C (str)

  • poles (List[complex])

  • method (str)

  • place_fallback (str)

  • jitter_eps (float)

  • B (str | None)

  • K (str | None)

  • K_poles_csv (str | None)

  • K_poles_list (List[str] | None)

  • compute_closed_loop (bool)

  • x0 (str | None)

  • e0 (str | None)

  • t_final (float)

  • dt (float)

  • pretty (bool)

  • equations (bool)

  • eq_style (str)

  • latex_out (str | None)

A: str
B: str | None = None
C: str
K: str | None = None
K_poles_csv: str | None = None
K_poles_list: List[str] | None = None
compute_closed_loop: bool = False
dt: float = 0.01
e0: str | None = None
eq_style: str = 'auto'
equations: bool = False
jitter_eps: float = 1e-06
latex_out: str | None = None
method: str = 'auto'
place_fallback: str = 'none'
poles: List[complex]
pretty: bool = False
t_final: float = 0.0
x0: str | None = None
class state_space_design.observerGainMatrixTool.apis.ObserverResponse(data: 'Dict[str, Any]' = <factory>, pretty_blocks: 'List[str]' = <factory>)[source]

Bases: object

Parameters:
  • data (Dict[str, Any])

  • pretty_blocks (List[str])

data: Dict[str, Any]
pretty_blocks: List[str]

state_space_design.observerGainMatrixTool.app

class state_space_design.observerGainMatrixTool.app.ObserverGainMatrixApp(out=<factory>)[source]

Bases: object

Orchestrate observer gain design and optional reporting outputs.

Parameters:

out (OutputManager)

out: OutputManager
run(req)[source]

Run the full observer-gain workflow and return structured results.

Parameters:

req (ObserverRequest)

Return type:

ObserverResponse

state_space_design.observerGainMatrixTool.app.build_augmented(A, B, C, K, Ke)[source]

Build the augmented separation-structure state matrix.

Parameters:
  • A (ndarray)

  • B (ndarray)

  • C (ndarray)

  • K (ndarray)

  • Ke (ndarray)

Return type:

ndarray

state_space_design.observerGainMatrixTool.app.latex_bmatrix(M)[source]

Render a minimal LaTeX bmatrix string without a SymPy dependency.

Parameters:

M (ndarray)

Return type:

str

state_space_design.observerGainMatrixTool.app.latex_equation(A, B, C, Ke)[source]

Build a display-math LaTeX snippet for the observer equation.

Parameters:
  • A (ndarray)

  • B (ndarray | None)

  • C (ndarray)

  • Ke (ndarray)

Return type:

str

state_space_design.observerGainMatrixTool.app.observer_controller_tf(A, B, C, K, Ke)[source]

Compute the observer-controller transfer-function numerator and denominator.

Parameters:
  • A (ndarray)

  • B (ndarray)

  • C (ndarray)

  • K (ndarray)

  • Ke (ndarray)

Return type:

Tuple[list, list]

state_space_design.observerGainMatrixTool.app.simulate_initial(A_aug, C, K, x0, e0, t_final, dt)[source]

Simulate the zero-input augmented system by exact discretization.

Parameters:
  • A_aug (ndarray)

  • C (ndarray)

  • K (ndarray)

  • x0 (ndarray)

  • e0 (ndarray)

  • t_final (float)

  • dt (float)

Return type:

Tuple[list, list, list, list, list]

state_space_design.observerGainMatrixTool.utils

state_space_design.observerGainMatrixTool.utils.jitter_repeated_poles(poles, eps)[source]

Spread repeated real poles by a small amount for pole placement.

Parameters:
  • poles (ndarray)

  • eps (float)

Return type:

ndarray

state_space_design.observerGainMatrixTool.utils.parse_cplx_csv(s)[source]

Parse comma-separated complex-number tokens.

Parameters:

s (str)

Return type:

ndarray

state_space_design.observerGainMatrixTool.utils.parse_cplx_tokens(tokens)[source]

Parse complex-number tokens into a complex numpy array.

Parameters:

tokens (Sequence[str])

Return type:

ndarray

state_space_design.observerGainMatrixTool.utils.parse_matrix(s)[source]

Parse a numeric matrix string into a float numpy array.

Parameters:

s (str)

Return type:

ndarray

state_space_design.observerGainMatrixTool.utils.parse_vector(s)[source]

Parse a numeric vector string into a column vector.

Parameters:

s (str)

Return type:

ndarray

state_space_design.observerGainMatrixTool.utils.pole_multiplicities(poles, tol=0.0)[source]

Count repeated real pole values within a tolerance.

Parameters:
  • poles (ndarray)

  • tol (float)

Return type:

Dict[float, int]

state_space_design.observerGainMatrixTool.utils.pretty_poly(coeffs, var='s')[source]

Format polynomial coefficients as a compact plain text expression.

Parameters:
  • coeffs (ndarray)

  • var (str)

Return type:

str

state_space_design.observerGainMatrixTool.core

state_space_design.observerGainMatrixTool.core.ctrb_dual(A, C)[source]
Parameters:
  • A (ndarray)

  • C (ndarray)

Return type:

ndarray

state_space_design.observerGainMatrixTool.core.ctrb_matrix(A, B)[source]
Parameters:
  • A (ndarray)

  • B (ndarray)

Return type:

ndarray

state_space_design.observerGainMatrixTool.core.is_observable(A, C)[source]
Parameters:
  • A (ndarray)

  • C (ndarray)

Return type:

bool

state_space_design.observerGainMatrixTool.core.obsv_matrix(A, C)[source]
Parameters:
  • A (ndarray)

  • C (ndarray)

Return type:

ndarray

state_space_design.observerGainMatrixTool.core.phi_coeffs_from_poles(poles)[source]
Parameters:

poles (ndarray)

Return type:

ndarray

state_space_design.observerGainMatrixTool.core.phi_of_matrix(A, poles)[source]
Parameters:
  • A (ndarray)

  • poles (ndarray)

Return type:

ndarray

state_space_design.observerGainMatrixTool.io

class state_space_design.observerGainMatrixTool.io.OutputManager(out_dir: 'Path' = PosixPath('stateSpaceDesign/observerGainMatrixTool/out'))[source]

Bases: object

Parameters:

out_dir (Path)

ensure()[source]
Return type:

None

out_dir: Path = PosixPath('stateSpaceDesign/observerGainMatrixTool/out')
write_json(data, filename)[source]
Parameters:

filename (str)

Return type:

Path

write_text(text, filename)[source]
Parameters:
  • text (str)

  • filename (str)

Return type:

Path

state_space_design.observerGainMatrixTool.design

class state_space_design.observerGainMatrixTool.design.ControllerDesigner[source]

Bases: object

State-feedback K via place() if available, else SISO Ackermann fallback.

compute_place(A, B, poles)[source]
Parameters:
  • A (ndarray)

  • B (ndarray)

  • poles (ndarray)

Return type:

ndarray

class state_space_design.observerGainMatrixTool.design.ObserverDesignResult(Ke: 'np.ndarray', method_used: 'str', meta: 'Dict[str, Any]')[source]

Bases: object

Parameters:
  • Ke (ndarray)

  • method_used (str)

  • meta (Dict[str, Any])

Ke: ndarray
meta: Dict[str, Any]
method_used: str
class state_space_design.observerGainMatrixTool.design.ObserverDesigner[source]

Bases: object

Compute full-order observer gains K_e using ‘place’ (dual) or Ackermann.

compute(A, C, poles, method='auto', place_fallback='none', jitter_eps=1e-06)[source]
Parameters:
  • A (ndarray)

  • C (ndarray)

  • poles (ndarray)

  • method (str)

  • place_fallback (str)

  • jitter_eps (float)

Return type:

ObserverDesignResult

method_ackermann_dual(A, C, poles)[source]
Parameters:
  • A (ndarray)

  • C (ndarray)

  • poles (ndarray)

Return type:

ndarray

method_place_dual(A, C, poles, place_fallback='none', jitter_eps=1e-06)[source]
Parameters:
  • A (ndarray)

  • C (ndarray)

  • poles (ndarray)

  • place_fallback (str)

  • jitter_eps (float)

Return type:

Tuple[ndarray, Dict[str, Any]]