API Reference¶
state_space_design.minOrdTool.cli¶
CLI entry point for state_space_design.minOrdTool.
state_space_design.minOrdTool.apis¶
- class state_space_design.minOrdTool.apis.MinOrdRunRequest(A: 'str', C: 'str', poles: 'list[str]', B: 'str | None' = None, K: 'str | None' = None, K_poles: 'list[str] | None' = None, allow_pinv: 'bool' = False, pretty: 'bool' = False, precision: 'int' = 4, export_json: 'str | None' = None, verbose: 'bool' = False)[source]¶
Bases:
object- Parameters:
A (str)
C (str)
poles (list[str])
B (str | None)
K (str | None)
K_poles (list[str] | None)
allow_pinv (bool)
pretty (bool)
precision (int)
export_json (str | None)
verbose (bool)
- A: str¶
- B: str | None = None¶
- C: str¶
- K: str | None = None¶
- K_poles: list[str] | None = None¶
- allow_pinv: bool = False¶
- export_json: str | None = None¶
- poles: list[str]¶
- precision: int = 4¶
- pretty: bool = False¶
- verbose: bool = False¶
state_space_design.minOrdTool.app¶
app.py — Orchestration layer for state_space_design.minOrdTool
Parses request, invokes service, writes JSON output
Ensures JSON is safe for NumPy/complex types
- state_space_design.minOrdTool.app.run_app(req)[source]¶
Execute a run given a MinOrdRunRequest and return MinOrdRunResult.
- Parameters:
req (MinOrdRunRequest)
- Return type:
state_space_design.minOrdTool.core¶
- class state_space_design.minOrdTool.core.MinOrderObserverDesigner(sys)[source]¶
Bases:
object- Parameters:
sys (SystemSpec)
- class state_space_design.minOrdTool.core.SystemSpec(A: 'np.ndarray', C: 'np.ndarray', B: 'np.ndarray | None' = None)[source]¶
Bases:
object- Parameters:
A (ndarray)
C (ndarray)
B (ndarray | None)
- A: ndarray¶
- B: ndarray | None = None¶
- C: ndarray¶
- property n: int¶
- state_space_design.minOrdTool.core.build_S(Aab, Abb)[source]¶
- Parameters:
Aab (ndarray)
Abb (ndarray)
- Return type:
ndarray
- state_space_design.minOrdTool.core.partition_bar(Abar, Bbar)[source]¶
- Parameters:
Abar (ndarray)
Bbar (ndarray | None)
- state_space_design.minOrdTool.core.phi_of_A(A, coeff)[source]¶
- Parameters:
A (ndarray)
coeff (ndarray)
- Return type:
ndarray
state_space_design.minOrdTool.design¶
design.py — App/service layer for minimum-order observer design (Ogata §10-5)
Wraps the core math in a service class suitable for CLI and tests
Provides pretty console output (optional)
Produces JSON-safe payloads (NumPy & complex handled)
- class state_space_design.minOrdTool.design.MinOrdAppService(precision=4, verbose=False)[source]¶
Bases:
objectHigh-level façade used by the CLI and tests.
- Parameters:
precision (int) – Digits for pretty-printed numeric output.
verbose (bool) – If True, set root logger to DEBUG; otherwise INFO.
- design_observer(A, C, poles, B=None, allow_pinv=False, pretty=False, K=None, K_poles=None)[source]¶
Design a minimum-order observer for p=1 (scalar output).
- Returns:
JSON-safe payload with keys: T, Tinv, Abar, Bbar, Aaa, Aab, Aba, Abb, Ke, Ahat, Bhat, Fhat, Ctil, Dtil, eig_Ahat, charpoly_Ahat, charpoly_desired, charpoly_match, (optionally) K
- Return type:
dict
- Parameters:
allow_pinv (bool)
pretty (bool)
state_space_design.minOrdTool.io¶
- state_space_design.minOrdTool.io.parse_mat(s)[source]¶
- Parameters:
s (str | None)
- Return type:
ndarray | None
state_space_design.minOrdTool.utils¶
Utility helpers for state_space_design.minOrdTool.
- state_space_design.minOrdTool.utils.array2str(M, precision=4)[source]¶
Return a compact string for a matrix or array.
- Parameters:
M (Any)
precision (int)
- Return type:
str
- state_space_design.minOrdTool.utils.complex_list_to_pairs(zs)[source]¶
Convert complex values into real-imaginary pairs.
- Parameters:
zs (Any)
- Return type:
list[list[float]]
- state_space_design.minOrdTool.utils.mat_inline(M, precision=4)[source]¶
Return a one-line matrix representation for console output.
- Parameters:
M (Any)
precision (int)
- Return type:
str
- state_space_design.minOrdTool.utils.pretty_poly(coeffs, var='s')[source]¶
Return a readable polynomial string from descending coefficients.
- Parameters:
coeffs (Any)
var (str)
- Return type:
str