Glossary¶
- Algebraic loop¶
A cycle in the direct-feedthrough dependency graph. If block A needs B’s output to compute its own, and B needs A’s output, neither can go first. pySimBlocks raises a
RuntimeErrorat compile time when such a cycle is detected. See Execution Order and Algebraic Loops.- Block¶
The fundamental unit of a pySimBlocks model. A block encapsulates a discrete-time computation and exposes a uniform interface —
initialize(),output_update(),state_update()— called by the simulator at each step.- Direct feedthrough¶
A block has direct feedthrough if its output at step
kdepends on its input at the same stepk— i.e.u[k]appears inoutput_update(). This property determines which edges appear in the dependency graph and therefore the execution order. See Execution Order and Algebraic Loops.- Execution order¶
The ordered list of blocks in which
output_update()is called at each simulation step. Computed once during the compilation phase by a topological sort of the direct-feedthrough dependency graph. See Execution Order and Algebraic Loops.- Model¶
A container that holds blocks and signal connections. The model builds the topological execution order and provides fast access to downstream connections. It is passed to the
Simulatorat construction time. SeeModel.- Port¶
A named connection point on a block. Input ports receive signals from upstream blocks; output ports emit signals to downstream blocks. Ports are declared in
__init__as entries inself.inputsandself.outputs.- Sample time¶
The period in seconds at which a block is activated. Blocks with
sample_time=Noneinherit the globaldtfromSimulationConfig. All sample times must be integer multiples ofdt.- Signal¶
A NumPy array of shape
(n, m)flowing between two ports through a connection. All signals are discrete-time: a signal has a defined value at each simulation stepk.- Simulator¶
The central object that drives a pySimBlocks simulation. It takes a
Modeland aSimulationConfig, compiles the execution order, and runs the step loop until the end time is reached. See Simulator & Simulation Life Cycle.- State¶
The internal memory of a block, split into two dicts:
stateholds the committed valuex[k]used duringoutput_update(), andnext_stateholds the valuex[k+1]computed bystate_update()before it is committed at the end of the step.- Task¶
A group of blocks sharing the same sample time. The simulator groups blocks into tasks at compile time and activates each task only when its period has elapsed. See Simulator & Simulation Life Cycle.