API Reference

state_space.stateConverterTool.cli

Command-line interface for state_space.stateConverterTool.

The CLI supports two usage styles:

  1. Modern subcommand form:

    python -m state_space.stateConverterTool.cli run --example ogata_5_4
    
  2. Historical no-subcommand form:

    python -m state_space.stateConverterTool.cli --example ogata_5_4
    

It also includes a sphinx-skel helper for generating a conservative, GitHub Pages friendly Sphinx documentation skeleton.

state_space.stateConverterTool.cli.build_parser()[source]

Build the command-line parser.

Return type:

ArgumentParser

state_space.stateConverterTool.cli.main(argv=None)[source]

Run the stateConverterTool command-line interface.

Parameters:

argv (list[str] | None)

Return type:

int

state_space.stateConverterTool.apis

class state_space.stateConverterTool.apis.RunRequest(A: 'Optional[sp.Matrix]' = None, B: 'Optional[sp.Matrix]' = None, C: 'Optional[sp.Matrix]' = None, D: 'Optional[sp.Matrix]' = None, T: 'Optional[sp.Expr]' = None, example: 'Optional[str]' = None, digits: 'int' = 6, evalf: 'Optional[int]' = None, simplify: 'bool' = True, force_inverse: 'bool' = False, allow_singular_fallback: 'bool' = True, want_latex: 'bool' = False, latex_out: 'Optional[str]' = None)[source]

Bases: object

Parameters:
  • A (sympy.Matrix | None)

  • B (sympy.Matrix | None)

  • C (sympy.Matrix | None)

  • D (sympy.Matrix | None)

  • T (sympy.Expr | None)

  • example (str | None)

  • digits (int)

  • evalf (int | None)

  • simplify (bool)

  • force_inverse (bool)

  • allow_singular_fallback (bool)

  • want_latex (bool)

  • latex_out (str | None)

A: sympy.Matrix | None = None
B: sympy.Matrix | None = None
C: sympy.Matrix | None = None
D: sympy.Matrix | None = None
T: sympy.Expr | None = None
allow_singular_fallback: bool = True
digits: int = 6
evalf: int | None = None
example: str | None = None
force_inverse: bool = False
latex_out: str | None = None
simplify: bool = True
want_latex: bool = False
class state_space.stateConverterTool.apis.RunResult(G: 'sp.Matrix', H: 'sp.Matrix', F: 'sp.Matrix', Finv: 'Optional[sp.Matrix]', latex: 'Optional[str]' = None)[source]

Bases: object

Parameters:
  • G (sympy.Matrix)

  • H (sympy.Matrix)

  • F (sympy.Matrix)

  • Finv (sympy.Matrix | None)

  • latex (str | None)

F: sympy.Matrix
Finv: sympy.Matrix | None
G: sympy.Matrix
H: sympy.Matrix
latex: str | None = None

state_space.stateConverterTool.app

class state_space.stateConverterTool.app.StateConverterApp[source]

Bases: object

run(req)[source]
Parameters:

req (RunRequest)

Return type:

RunResult

state_space.stateConverterTool.core

class state_space.stateConverterTool.core.StateConverterCore(simplify: 'bool' = True, allow_singular_fallback: 'bool' = True)[source]

Bases: object

Parameters:
  • simplify (bool)

  • allow_singular_fallback (bool)

H_via_augmented_expm(A, B, T)[source]
Parameters:
  • A (sympy.Matrix)

  • B (sympy.Matrix)

Return type:

sympy.Matrix

H_via_linear_solve(A, G, B)[source]
Parameters:
  • A (sympy.Matrix)

  • G (sympy.Matrix)

  • B (sympy.Matrix)

Return type:

sympy.Matrix

allow_singular_fallback: bool = True
compute_F(G, H, C, D, force_inverse)[source]
Parameters:
  • G (sympy.Matrix)

  • H (sympy.Matrix)

  • C (sympy.Matrix)

  • D (sympy.Matrix)

  • force_inverse (bool)

Return type:

Tuple[sympy.Matrix | None, sympy.Matrix]

compute_G(A, T)[source]
Parameters:

A (sympy.Matrix)

Return type:

sympy.Matrix

compute_H(A, G, B, T)[source]
Parameters:
  • A (sympy.Matrix)

  • G (sympy.Matrix)

  • B (sympy.Matrix)

Return type:

sympy.Matrix

expm_AT(A, T)[source]
Parameters:

A (sympy.Matrix)

Return type:

sympy.Matrix

pulse_transfer(G, H, C, D, force_inverse)[source]
Parameters:
  • G (sympy.Matrix)

  • H (sympy.Matrix)

  • C (sympy.Matrix)

  • D (sympy.Matrix)

  • force_inverse (bool)

Return type:

Tuple[sympy.Matrix | None, sympy.Matrix]

simplify: bool = True

state_space.stateConverterTool.io

state_space.stateConverterTool.io.ensure_out_dir(p)[source]
Parameters:

p (str)

Return type:

str

state_space.stateConverterTool.io.parse_matrix(s)[source]
Parameters:

s (str)

Return type:

sympy.Matrix

state_space.stateConverterTool.io.parse_scalar(s)[source]
Parameters:

s (str)

state_space.stateConverterTool.utils

state_space.stateConverterTool.utils.step(label)[source]

Decorator to mark a pipeline step (for future progress hooks/logging). Currently a no-op that records elapsed time as an attribute.

Parameters:

label (str)

Return type:

Callable

state_space.stateConverterTool.design

state_space.stateConverterTool.design.build_latex(A, B, C, D, T, G, H, Finv, F)[source]
Return type:

str

state_space.stateConverterTool.design.fmt(obj)[source]
Return type:

str

state_space.stateConverterTool.design.fmt_matrix(M)[source]
Parameters:

M (sympy.MatrixBase)

Return type:

str

state_space.stateConverterTool.design.latex_scalar_or_matrix(X)[source]
Return type:

str

state_space.stateConverterTool.design.sone(expr)[source]

Sympy single-line string.

Return type:

str