lynx.blocks.StateSpaceBlock¶
- class lynx.blocks.StateSpaceBlock[source]¶
Bases:
BlockState space block with A, B, C, D matrices.
- Parameters:
A – State matrix (n x n)
B – Input matrix (n x m)
C – Output matrix (p x n)
D – Feedthrough matrix (p x m)
For MVP (SISO systems): m=1 (single input), p=1 (single output)
Example
Second-order system: A = [[0, 1], [-2, -3]] B = [[0], [1]] C = [[1, 0]] D = [[0]]
- Ports:
Input: in (single input for SISO) Output: out (single output for SISO)
Methods
__init__(id, A, B, C, D[, position, label])Initialize state space block.
add_parameter(name, value[, expression])Add a parameter to the block.
add_port(port_id, port_type[, label])Add a port to the block.
get_parameter(name)Get parameter value by name.
get_ports()Get all ports as dictionaries.
is_input_marker()Check if this is an input marker block.
is_output_marker()Check if this is an output marker block.
set_parameter(param_name, value)Update block parameter and sync to parent diagram.
to_dict()Serialize block to dictionary for JSON export.
- __init__(id: str, A: List[List[float]], B: List[List[float]], C: List[List[float]], D: List[List[float]], position: Dict[str, float] | None = None, label: str | None = None) None[source]¶
Initialize state space block.
- Parameters:
id – Unique block identifier
A – State matrix
B – Input matrix
C – Output matrix
D – Feedthrough matrix
position – Optional {x, y} position on canvas
label – Optional user-facing label (defaults to id)