DynamicalSystem#
- class brainpy.DynamicalSystem(name=None, mode=None)[source]#
Base Dynamical System class.
Note
In general, every instance of
DynamicalSystem
implemented in BrainPy only defines the evolving function at each time step \(t\).If users want to define the logic of running models across multiple steps, we recommend users to use
for_loop()
,LoopOverTime
,DSRunner
, orDSTrainer
.To be compatible with previous APIs,
DynamicalSystem
inherits from theDelayRegister
. It’s worthy to note that the methods ofDelayRegister
will be removed in the future, including:.register_delay()
.get_delay_data()
.update_local_delays()
.reset_local_delays()
- Parameters:
- get_local_delay(var_name, delay_name)[source]#
Get the delay at the given identifier (name).
- Parameters:
var_name – The name of the target delay variable.
delay_name – The identifier of the delay.
- Returns:
The delayed data at the given delay position.
- jit_step_run(i, *args, **kwargs)[source]#
The jitted step function for running.
- Parameters:
i – The current running index.
*args – The arguments of
update()
function.**kwargs – The arguments of
update()
function.
- Returns:
The update function returns.
- Return type:
out
- property mode: Mode#
Mode of the model, which is useful to control the multiple behaviors of the model.
- register_local_delay(var_name, delay_name, delay=None)[source]#
Register local relay at the given delay time.
- reset(*args, **kwargs)[source]#
Reset function which reset the whole variables in the model (including its children models).
reset()
function is a collective behavior which resets all states in this model.See https://brainpy.readthedocs.io/en/latest/tutorial_toolbox/state_resetting.html for details.
- reset_state(*args, **kwargs)[source]#
Reset function which resets local states in this model.
Simply speaking, this function should implement the logic of resetting of local variables in this node.
See https://brainpy.readthedocs.io/en/latest/tutorial_toolbox/state_resetting.html for details.
- step_run(i, *args, **kwargs)[source]#
The step run function.
This function can be directly applied to run the dynamical system. Particularly,
i
denotes the running index.- Parameters:
i – The current running index.
*args – The arguments of
update()
function.**kwargs – The arguments of
update()
function.
- Returns:
The update function returns.
- Return type:
out