b_asic.state_space

B-ASIC State Space Module.

Contains a class for the state-space representation of a linear system.

class b_asic.state_space.StateSpace(A: NDArray | list[list[complex]], B: NDArray | list[list[complex]], C: NDArray | list[list[complex]], D: NDArray | list[list[complex]])

Bases: object

State-space representation of a linear system.

Parameters:
Anumpy array or list of lists

State matrix.

Bnumpy array or list of lists

Input matrix.

Cnumpy array or list of lists

Output matrix.

Dnumpy array or list of lists

Feedthrough matrix.

A
B
C
D
property equations: tuple

Get the state-space equations in symbolic form using SymPy.

Returns:
state_equationsympy.Equality or None

Symbolic state-update equation, or None if the system has no states.

output_equationsympy.Equality or None

Symbolic output equation, or None if the system has no outputs.

Notes

Requires SymPy to be installed.

classmethod from_sfg(sfg: SFG) → StateSpace

Create a StateSpace representation from an SFG.

Parameters:
sfgSFG

Signal flow graph of a linear system.

Returns:
StateSpace

State-space representation of the linear SFG, with one state per delay.

to_tf()

Convert the state-space representation to a transfer function.

Returns:
TransferFunction

The transfer function representation.

to_zpk()

Return the zeros, poles, and gain of the state-space representation.

Returns:
dict

See zpk() for the return format.