Example: Two rate-coupled leaky integrators

This example is a minimal example for a numerical simulation performed in PyRates, based on a pre-implemented model. It is taken from a jupyter notebook, which provides detailed insight into the model and how to implement it and use it in PyRates.

The following code performs a numerical integration of the evolution equations of the Jansen-Rit neural mass model over a time interval of 2 s.

from pyrates import integrate

# model definition
model_def = "model_templates.neural_mass_models.jansenrit.JRC"

# simulation
results = integrate(model_def, simulation_time=2.0, step_size=1e-4,
                    outputs={'psp_e': 'pc/rpo_e_in/V',
                             'psp_i': 'pc/rpo_i/V'},
                    clear=True)

The variable model_def is a pointer to the model definition and the call to integrate performs the numerical integration and returns a pandas.DataFrame with the resulting time series.

See the The Jansen-Rit Neural Mass Model use example for a more detailed explanation of the Jansen-Rit model, the jupyter notebook for details on how to implement this model by your self, and the Numerical Simulations use example for details on the numerical integration capacities of PyRates.