API Reference¶
Complete reference documentation for Lynx’s Python API. All public methods, parameters, and examples are documented here.
Create, save, and load diagrams. The central class for all Lynx operations.
Basic control systems blocks: gain, transfer function, state space, sum
Diagram correctness: algebraic loops, connectivity, label uniqueness.
Export diagrams to python-control for analysis and simulation.
Quick Reference¶
Common tasks and their corresponding API methods:
Task |
API Method |
Example |
|---|---|---|
Create diagram |
|
|
Add block |
|
|
Add connection |
|
|
Update parameter |
|
|
Save diagram |
|
|
Load diagram |
|
|
Export transfer function |
|
|
Export state-space |
|
|
Interactive widget |
|
|
Detailed Documentation¶
API Conventions¶
Parameter Types¶
Lynx uses type hints throughout. Common parameter types:
block_type:
str- One of:'gain','transfer_function','state_space','sum','io_marker'block_id:
str- Unique identifier for a blockport_id:
str- Port identifier (e.g.,'in','out','in1','in2')position:
dict[str, float]-{'x': float, 'y': float}coordinates
Return Values¶
Methods that modify diagrams typically return
None(modify in-place)Export methods return python-control objects:
TransferFunctionorStateSpaceLoad methods return new
Diagraminstances
Error Handling¶
Lynx raises descriptive exceptions with context:
ValidationError: Pre-export validation failures (includes
block_idandport_id)SignalNotFoundError: Signal reference not found during export
ValueError: Invalid parameters or arguments
See Validation for details on error handling and recovery.