API Reference

state_space_analysis.stateRepTool.cli

state_space_analysis.stateRepTool.cli.build_parser()[source]
Return type:

ArgumentParser

state_space_analysis.stateRepTool.cli.main(argv=None)[source]
Parameters:

argv (list[str] | None)

Return type:

None

state_space_analysis.stateRepTool.apis

class state_space_analysis.stateRepTool.apis.StateRepAPIRequest(tf: 'str | None' = None, num: 'str | None' = None, den: 'str | None' = None, example: 'str | None' = None, which: 'str' = 'all', numeric: 'bool' = False, digits: 'int' = 6, pretty: 'bool' = False, verify: 'bool' = True)[source]

Bases: object

Parameters:
  • tf (str | None)

  • num (str | None)

  • den (str | None)

  • example (str | None)

  • which (str)

  • numeric (bool)

  • digits (int)

  • pretty (bool)

  • verify (bool)

den: str | None = None
digits: int = 6
example: str | None = None
num: str | None = None
numeric: bool = False
pretty: bool = False
tf: str | None = None
verify: bool = True
which: str = 'all'
class state_space_analysis.stateRepTool.apis.StateRepAPIResponse(results: 'Dict[str, dict]')[source]

Bases: object

Parameters:

results (Dict[str, dict])

results: Dict[str, dict]
class state_space_analysis.stateRepTool.apis.StateRepService[source]

Bases: object

static run(req)[source]
Parameters:

req (StateRepAPIRequest)

Return type:

StateRepAPIResponse

state_space_analysis.stateRepTool.app

class state_space_analysis.stateRepTool.app.StateRepApp(out_dir: 'Path' = PosixPath('/home/runner/work/control-systems/control-systems/state_space_analysis/stateRepTool/out'))[source]

Bases: object

Parameters:

out_dir (Path)

out_dir: Path = PosixPath('/home/runner/work/control-systems/control-systems/state_space_analysis/stateRepTool/out')
run(req, export_json=None)[source]
Parameters:
Return type:

Dict

state_space_analysis.stateRepTool.core

class state_space_analysis.stateRepTool.core.CanonicalFormCalculator(tf: 'TransferFunctionSpec', numeric: 'bool' = False, digits: 'int' = 6, pretty: 'bool' = False, verify: 'bool' = True)[source]

Bases: object

Parameters:
Dfeed: Expr
compute(which='all')[source]
Parameters:

which (str)

Return type:

Dict[str, Realization]

den_desc: List[Expr]
digits: int = 6
num_desc: List[Expr]
num_proper_desc: List[Expr]
numeric: bool = False
pretty: bool = False
tf: TransferFunctionSpec
static tf_from_ss(A, B, C, D)[source]
Parameters:
  • A (MutableDenseMatrix)

  • B (MutableDenseMatrix)

  • C (MutableDenseMatrix)

  • D (Expr)

Return type:

Expr

verify: bool = True
class state_space_analysis.stateRepTool.core.Realization(A: 'sp.Matrix', B: 'sp.Matrix', C: 'sp.Matrix', D: 'sp.Expr', P: 'Optional[sp.Matrix]' = None)[source]

Bases: object

Parameters:
  • A (MutableDenseMatrix)

  • B (MutableDenseMatrix)

  • C (MutableDenseMatrix)

  • D (Expr)

  • P (MutableDenseMatrix | None)

A: MutableDenseMatrix
B: MutableDenseMatrix
C: MutableDenseMatrix
D: Expr
P: MutableDenseMatrix | None = None
as_dict()[source]
Return type:

Dict

class state_space_analysis.stateRepTool.core.TransferFunctionSpec(num_desc: 'List[sp.Expr]', den_desc: 'List[sp.Expr]')[source]

Bases: object

Parameters:
  • num_desc (List[Expr])

  • den_desc (List[Expr])

den_desc: List[Expr]
classmethod from_num_den(num, den)[source]
Parameters:
  • num (str)

  • den (str)

Return type:

TransferFunctionSpec

classmethod from_tf_string(tf)[source]
Parameters:

tf (str)

Return type:

TransferFunctionSpec

num_desc: List[Expr]

state_space_analysis.stateRepTool.design

Place future design-oriented helpers here (e.g., real-modal 2x2 blocks, CSV/Markdown exporters).

state_space_analysis.stateRepTool.io

state_space_analysis.stateRepTool.io.save_json(data, path)[source]
Parameters:
  • data (Dict)

  • path (str | Path)

Return type:

Path

state_space_analysis.stateRepTool.utils

state_space_analysis.stateRepTool.utils.coeffs_asc(desc, n)[source]
Parameters:
  • desc (List[Expr])

  • n (int)

Return type:

List[Expr]

state_space_analysis.stateRepTool.utils.ensure_proper(num_desc, den_desc)[source]
Return type:

Tuple[List[Expr], List[Expr], Expr, List[Expr]]

state_space_analysis.stateRepTool.utils.normalize_monic(num_desc, den_desc)[source]
Parameters:
  • num_desc (List[Expr])

  • den_desc (List[Expr])

Return type:

Tuple[List[Expr], List[Expr]]

state_space_analysis.stateRepTool.utils.parse_poly(arg)[source]

Parse CSV or polynomial string to descending-power coefficients (SymPy exact).

Parameters:

arg (str | List[float])

Return type:

List[Expr]

state_space_analysis.stateRepTool.utils.parse_tf_string(tf_str)[source]
Parameters:

tf_str (str)

Return type:

Tuple[List[Expr], List[Expr]]

state_space_analysis.stateRepTool.utils.pprint_matrix(M)[source]
Return type:

str

state_space_analysis.stateRepTool.utils.square_free(poly)[source]
Parameters:

poly (Poly)

Return type:

bool

state_space_analysis.stateRepTool.utils.sym_s()[source]
Return type:

Symbol

state_space_analysis.stateRepTool.utils.tf_from_numden(num_desc, den_desc)[source]
Return type:

Expr

state_space_analysis.stateRepTool.utils.to_expr(s)[source]
Parameters:

s (str)

Return type:

Expr

state_space_analysis.stateRepTool.utils.to_numeric(M, digits=6)[source]
Parameters:

digits (int)