You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/index.rst
+22-22Lines changed: 22 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ In addition to continuous dynamics, discrete events can be used to model instant
24
24
25
25
ODE-toolbox is intended to be run "off-line", before commencing the actual simulation. It processes a JSON encoded input of a dynamical system, and produces its output encoded as JSON.
:alt:Flow diagram: input JSON to ODE-toolbox to output JSON
29
29
:width:1223px
30
30
:height:294px
@@ -33,7 +33,7 @@ ODE-toolbox is intended to be run "off-line", before commencing the actual simul
33
33
34
34
The internal processing carried out by ODE-toolbox can be visually summarised as follows, starting from a system of ODEs and functions of time on the left, and generating propagator matrices, Jacobian (first-order) update expressions, and finally performing solver benchmarking to recommend a particular numerical solver. Each of these steps will be described in depth in the following sections.
ODE-toolbox is written in Python and leverages SymPy for the symbolic manipulation of equations. It was initially developed in the context of the `NESTML <https://github.com/nest/nestml>`__ project, in which the main focus was on the class of spiking neurons presently available in the `NEST <https://github.com/nest/nest-simulator>`__ simulator. It can, however, be used in a standalone fashion, and is broadly applicable to continuous-time dynamical systems as well as systems that undergo instantaneous events (such as neuronal spikes or impulsive forces).
@@ -67,7 +67,7 @@ To install, clone the repository, go to the root directory and then run the foll
67
67
68
68
If you wish to install into your home directory, add the option :bash:`--user` to the above call.
69
69
70
-
For further installation hints, please see the `GitHub Actions CI workflow file <https://github.com/nest/ode-toolbox/blob/master/.github/workflows/ode-toolbox-build.yml>`__.
70
+
For further installation hints, please see the `GitHub Actions CI workflow file <https://github.com/nest/ode-toolbox/blob/main/.github/workflows/ode-toolbox-build.yml>`__.
71
71
72
72
Testing
73
73
~~~~~~~
@@ -101,7 +101,7 @@ ODE-toolbox can be used in two ways:
See the tests (e.g. `test\_lorenz\_attractor.py <https://github.com/nest/ode-toolbox/blob/master/tests/test_lorenz_attractor.py>`__) for more examples.
104
+
See the tests (e.g. `test\_lorenz\_attractor.py <https://github.com/nest/ode-toolbox/blob/main/tests/test_lorenz_attractor.py>`__) for more examples.
105
105
106
106
The JSON file and Python dictionary are completely equivalent in content and form, described in the :ref:`Input` section below.
107
107
@@ -147,7 +147,7 @@ Input
147
147
148
148
The JSON input dictionary that is passed to ODE-toolbox contains :ref:`dynamics <Dynamics>`, :ref:`numerical parameters <Parameters>`, and :ref:`global options <Global options>`. Documentation may optionally be provided as a string.
149
149
150
-
All expressions are parsed as SymPy expressions, and subsequently simplified through :python:`sympy.simplify()`. There are several predefined symbols, such as :python:`e` and :python:`E` for Euler's number, trigonometric functions, etc. :python:`t` is assumed to represent time. The list of predefined symbols is defined in `shapes.py <https://github.com/nest/ode-toolbox/blob/master/odetoolbox/shapes.py>`_, as the static member :python:`Shape._sympy_globals`. Variable names should be chosen such that they do not conflict with the predefined symbols.
150
+
All expressions are parsed as SymPy expressions, and subsequently simplified through :python:`sympy.simplify()`. There are several predefined symbols, such as :python:`e` and :python:`E` for Euler's number, trigonometric functions, etc. :python:`t` is assumed to represent time. The list of predefined symbols is defined in `shapes.py <https://github.com/nest/ode-toolbox/blob/main/odetoolbox/shapes.py>`_, as the static member :python:`Shape._sympy_globals`. Variable names should be chosen such that they do not conflict with the predefined symbols.
151
151
152
152
Dynamics
153
153
~~~~~~~~
@@ -397,21 +397,21 @@ During processing, a dependency graph is generated, where each node corresponds
Each variable is subsequently marked according to whether it can, by itself, be analytically solved. This is indicated by a green colour.
404
404
405
405
.. raw:: html
406
406
407
-
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/master/doc/fig/eq_analysis_1.png" alt="Dependency graph with membrane potential and excitatory and gap junction kernels marked green" width="720" height="383">
407
+
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/main/doc/fig/eq_analysis_1.png" alt="Dependency graph with membrane potential and excitatory and gap junction kernels marked green" width="720" height="383">
408
408
409
409
410
410
In the next step, variables are unmarked as analytically solvable if they depend on other variables that are themselves not analytically solvable. In this example, ``V_rel``is unmarked as it depends on the nonlinear excitatory kernel.
411
411
412
412
.. raw:: html
413
413
414
-
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/master/doc/fig/eq_analysis_2.png" alt="Dependency graph with membrane potential and excitatory and gap junction kernels marked green" width="720" height="383">
414
+
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/main/doc/fig/eq_analysis_2.png" alt="Dependency graph with membrane potential and excitatory and gap junction kernels marked green" width="720" height="383">
415
415
416
416
417
417
The analytic solution forall green nodes is computed in the form of a propagator matrix. See the section :ref:`Computing the propagator matrix`for more details.
@@ -549,43 +549,43 @@ Examples
549
549
550
550
Several example input files can be found under ``tests/*.json``. Some highlights:
-`Morris-Lecar neuron model <https://github.com/nest/ode-toolbox/blob/master/tests/morris_lecar.json>`__
554
-
-`Integrate-and-fire neuron with alpha-kernel postsynaptic currents <https://github.com/nest/ode-toolbox/blob/master/tests/mixed_analytic_numerical_with_stiffness.json>`__, including Poisson spike generator for stiffness test
555
-
-`Integrate-and-fire neuron with alpha-kernel postsynaptic conductances <https://github.com/nest/ode-toolbox/blob/master/tests/iaf_cond_alpha.json>`__
556
-
-`Canonical, two-dimensional stiff system <https://github.com/nest/ode-toolbox/blob/master/tests/stiff_system.json>`__ Example 11.57from Dahmen, W., and Reusken, A. (2005). Numerik fuer Naturwissenschaftler. Berlin: Springer
-`Morris-Lecar neuron model <https://github.com/nest/ode-toolbox/blob/main/tests/morris_lecar.json>`__
554
+
-`Integrate-and-fire neuron with alpha-kernel postsynaptic currents <https://github.com/nest/ode-toolbox/blob/main/tests/mixed_analytic_numerical_with_stiffness.json>`__, including Poisson spike generator for stiffness test
555
+
-`Integrate-and-fire neuron with alpha-kernel postsynaptic conductances <https://github.com/nest/ode-toolbox/blob/main/tests/iaf_cond_alpha.json>`__
556
+
-`Canonical, two-dimensional stiff system <https://github.com/nest/ode-toolbox/blob/main/tests/stiff_system.json>`__ Example 11.57from Dahmen, W., and Reusken, A. (2005). Numerik fuer Naturwissenschaftler. Berlin: Springer
557
557
558
558
559
559
Stiffness testing
560
560
~~~~~~~~~~~~~~~~~
561
561
562
-
This example correponds to the unit test in`test_stiffness.py <https://github.com/nest/ode-toolbox/blob/master/tests/test_stiffness.py>`_, which simulates the Morris-Lecar neuron model in`morris_lecar.json <https://github.com/nest/ode-toolbox/blob/master/tests/morris_lecar.json>`_. The plot shows the two state variables of the model, ``V``and``W``, whilein the lower panel the solver timestep recommendation is plotted at each step. This recommendation is returned by each GSL solver. Note that the ``avg_step_size_ratio`` selection criterion parameter refers to the *average* of this value across the entire simulation period.
562
+
This example correponds to the unit test in`test_stiffness.py <https://github.com/nest/ode-toolbox/blob/main/tests/test_stiffness.py>`_, which simulates the Morris-Lecar neuron model in`morris_lecar.json <https://github.com/nest/ode-toolbox/blob/main/tests/morris_lecar.json>`_. The plot shows the two state variables of the model, ``V``and``W``, whilein the lower panel the solver timestep recommendation is plotted at each step. This recommendation is returned by each GSL solver. Note that the ``avg_step_size_ratio`` selection criterion parameter refers to the *average* of this value across the entire simulation period.
563
563
564
564
.. raw:: html
565
565
566
-
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/master/doc/fig/stiffness_example.png"alt="timeseries plots of V, W, and recommended timestep"width="620"height="434">
566
+
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/main/doc/fig/stiffness_example.png"alt="timeseries plots of V, W, and recommended timestep"width="620"height="434">
567
567
568
568
569
-
`test_stiffness.py <https://github.com/nest/ode-toolbox/blob/master/tests/test_stiffness.py>`_ tests that for a tighter integration accuracy, the solver recommendation for this example changes from"explicit" (non-stiff) to "implicit" (stiff).
569
+
`test_stiffness.py <https://github.com/nest/ode-toolbox/blob/main/tests/test_stiffness.py>`_ tests that for a tighter integration accuracy, the solver recommendation for this example changes from"explicit" (non-stiff) to "implicit" (stiff).
570
570
571
571
572
572
From ODE-toolbox results dictionary to simulation
573
573
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
574
574
575
575
ODE-toolbox provides two classes that can perform numerical simulation on the basis of the results dictionary returned by ODE-toolbox: :py:class:`~odetoolbox.analytic_integrator.AnalyticIntegrator`, which simulates on the basis of propagators and returns precise values, and :py:class:`~odetoolbox.mixed_integrator.MixedIntegrator`, which in addition performs numerical integration using GSL (for example, using :python:`pygsl.odeiv.step_rk4`or :python:`pygsl.odeiv.step_bsimp`). These integrators both use :python:`sympy.parsing.sympy_parser` to parse the expression strings from the ODE-toolbox results dictionary, and then use the SymPy expression :python:`evalf()` method to evaluate to a floating-point value.
576
576
577
-
The file`test_analytic_solver_integration.py <https://github.com/nest/ode-toolbox/blob/master/tests/test_analytic_solver_integration.py>`_ contains an integration test that uses :py:class:`~odetoolbox.analytic_integrator.AnalyticIntegrator`and the propagators returned fromODE-toolbox to simulate a simple dynamical system; in this case, an integrate-and-fire neuron with alpha-shaped postsynaptic currents. It compares the obtained result to a handwritten solution, which is simulated analytically and numerically independent of ODE-toolbox. The following results figure shows perfect agreement between the three simulation methods:
577
+
The file`test_analytic_solver_integration.py <https://github.com/nest/ode-toolbox/blob/main/tests/test_analytic_solver_integration.py>`_ contains an integration test that uses :py:class:`~odetoolbox.analytic_integrator.AnalyticIntegrator`and the propagators returned fromODE-toolbox to simulate a simple dynamical system; in this case, an integrate-and-fire neuron with alpha-shaped postsynaptic currents. It compares the obtained result to a handwritten solution, which is simulated analytically and numerically independent of ODE-toolbox. The following results figure shows perfect agreement between the three simulation methods:
578
578
579
579
.. raw:: html
580
580
581
-
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/master/doc/fig/test_analytic_solver_integration.png"alt="V_rel, i_ex and i_ex' timeseries plots"width="620"height="465">
581
+
<img src="https://raw.githubusercontent.com/nest/ode-toolbox/main/doc/fig/test_analytic_solver_integration.png"alt="V_rel, i_ex and i_ex' timeseries plots"width="620"height="465">
582
582
583
583
584
-
The file`test_mixed_integrator_numeric.py <https://github.com/nest/ode-toolbox/blob/master/tests/test_mixed_integrator_numeric.py>`_ contains an integration test, that uses :py:class:`~odetoolbox.mixed_integrator.MixedIntegrator`and the results dictionary fromODE-toolbox to simulate the same integrate-and-fire neuron with alpha-shaped postsynaptic response, but purely numerically (without the use of propagators). In contrast to the :py:class:`~odetoolbox.analytic_integrator.AnalyticIntegrator`, enforcement of upper-and lower bounds is supported, as can be seen in the behaviour of :math:`V_m`in the plot that is generated:
584
+
The file`test_mixed_integrator_numeric.py <https://github.com/nest/ode-toolbox/blob/main/tests/test_mixed_integrator_numeric.py>`_ contains an integration test, that uses :py:class:`~odetoolbox.mixed_integrator.MixedIntegrator`and the results dictionary fromODE-toolbox to simulate the same integrate-and-fire neuron with alpha-shaped postsynaptic response, but purely numerically (without the use of propagators). In contrast to the :py:class:`~odetoolbox.analytic_integrator.AnalyticIntegrator`, enforcement of upper-and lower bounds is supported, as can be seen in the behaviour of :math:`V_m`in the plot that is generated:
@@ -667,9 +667,9 @@ This software was developed in part or in whole in the Human Brain Project, fund
667
667
668
668
This project has received funding from the European Union's Horizon Europe Programme under the Specific Grant Agreement No. 101147319 (EBRAINS 2.0 Project).
:param indict: Input dictionary for the analysis. For details, see https://ode-toolbox.readthedocs.io/en/master/#input
412
+
:param indict: Input dictionary for the analysis. For details, see https://ode-toolbox.readthedocs.io/en/main/#input
413
413
:param disable_stiffness_check: Whether to perform stiffness checking.
414
414
:param disable_analytic_solver: Set to True to return numerical solver recommendations, and no propagators, even for ODEs that are analytically tractable.
415
415
:param preserve_expressions: Set to True, or a list of strings corresponding to individual variable names, to disable internal rewriting of expressions, and return same output as input expression where possible. Only applies to variables specified as first-order differential equations.
0 commit comments