.. Copyright 2021 IRT Saint-Exupéry, https://www.irt-saintexupery.com This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. .. _gen_ode_algos: Ordinary differential equations solvers ======================================= .. warning:: Some capabilities may require the :ref:`installation ` of |g| with :ref:`all its features ` and some others may depend on :ref:`plugins `. .. warning:: All the features of the wrapped libraries may not be exposed through |g|. .. note:: The algorithm settings can be passed to a function of the form .. code-block:: python function(..., settings_model: Base | None = None, **settings: Any) either one by one: .. code-block:: python function(..., setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...) or using the argument name ``"settings"`` and the Pydantic model associated with the algorithm: .. code-block:: python settings = AlgorithmSettings(setting_name_1=setting_name_1, setting_name_2=setting_name_2, ...) function(..., settings_model=settings) .. raw:: html .. _BDF_options: BDF --- Module: :class:`gemseo.algos.ode.scipy_ode.scipy_ode` :code:`from gemseo.settings.ode import BDF_Settings` Implicit multi-step variable-order (1 to 5) method based on a backward differentiation formula for the derivative approximation More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.BDF.html. .. raw:: html
Optional settings
  • **atol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The absolute tolerance. By default it is set to 1e-06. .. raw:: html
  • **first_step** : *typing.Optional[typing.Annotated[float, Gt(gt=0)]], optional* The initial step size. If ``None``, let the algorithm choose. By default it is set to None. .. raw:: html
  • **jac_sparsity** : *typing.Optional[gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[float]]], optional* Sparsity structure of the Jacobian matrix. By default it is set to None. .. raw:: html
  • **max_step** : *, optional* The maximum allowed step size. By default it is set to inf. .. raw:: html
  • **rtol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The relative tolerance. By default it is set to 0.001. .. raw:: html
.. _DOP853_options: DOP853 ------ Module: :class:`gemseo.algos.ode.scipy_ode.scipy_ode` :code:`from gemseo.settings.ode import DOP853_Settings` Explicit Runge-Kutta method of order 8 More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.DOP853.html. .. raw:: html
Optional settings
  • **atol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The absolute tolerance. By default it is set to 1e-06. .. raw:: html
  • **first_step** : *typing.Optional[typing.Annotated[float, Gt(gt=0)]], optional* The initial step size. If ``None``, let the algorithm choose. By default it is set to None. .. raw:: html
  • **max_step** : *, optional* The maximum allowed step size. By default it is set to inf. .. raw:: html
  • **rtol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The relative tolerance. By default it is set to 0.001. .. raw:: html
.. _LSODA_options: LSODA ----- Module: :class:`gemseo.algos.ode.scipy_ode.scipy_ode` :code:`from gemseo.settings.ode import LSODA_Settings` Adams/BDF method with automatic stiffness detection/switching More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.LSODA.html. .. raw:: html
Optional settings
  • **atol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The absolute tolerance. By default it is set to 1e-06. .. raw:: html
  • **first_step** : *typing.Optional[typing.Annotated[float, Gt(gt=0)]], optional* The initial step size. If ``None``, let the algorithm choose. By default it is set to None. .. raw:: html
  • **lband** : *typing.Optional[int], optional* The lower boundary of the bandwidth of the Jacobian. The SciPy documentation does not mention what happens if ``None``. By default it is set to None. .. raw:: html
  • **max_step** : *, optional* The maximum allowed step size. By default it is set to inf. .. raw:: html
  • **min_step** : *, optional* Minimum allowed step size. By default it is set to 0. .. raw:: html
  • **rtol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The relative tolerance. By default it is set to 0.001. .. raw:: html
  • **uband** : *typing.Optional[int], optional* The upper boundary of the bandwidth of the Jacobian. The SciPy documentation does not mention what happens if ``None``. By default it is set to None. .. raw:: html
.. _RK23_options: RK23 ---- Module: :class:`gemseo.algos.ode.scipy_ode.scipy_ode` :code:`from gemseo.settings.ode import RK23_Settings` Explicit Runge-Kutta method of order 3(2) More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.RK23.html. .. raw:: html
Optional settings
  • **atol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The absolute tolerance. By default it is set to 1e-06. .. raw:: html
  • **first_step** : *typing.Optional[typing.Annotated[float, Gt(gt=0)]], optional* The initial step size. If ``None``, let the algorithm choose. By default it is set to None. .. raw:: html
  • **max_step** : *, optional* The maximum allowed step size. By default it is set to inf. .. raw:: html
  • **rtol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The relative tolerance. By default it is set to 0.001. .. raw:: html
.. _RK45_options: RK45 ---- Module: :class:`gemseo.algos.ode.scipy_ode.scipy_ode` :code:`from gemseo.settings.ode import RK45_Settings` Explicit Runge-Kutta method of order 5(4) More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.RK45.html. .. raw:: html
Optional settings
  • **atol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The absolute tolerance. By default it is set to 1e-06. .. raw:: html
  • **first_step** : *typing.Optional[typing.Annotated[float, Gt(gt=0)]], optional* The initial step size. If ``None``, let the algorithm choose. By default it is set to None. .. raw:: html
  • **max_step** : *, optional* The maximum allowed step size. By default it is set to inf. .. raw:: html
  • **rtol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The relative tolerance. By default it is set to 0.001. .. raw:: html
.. _Radau_options: Radau ----- Module: :class:`gemseo.algos.ode.scipy_ode.scipy_ode` :code:`from gemseo.settings.ode import Radau_Settings` Implicit Runge-Kutta method of the Radau IIA type of order 5 More details about the algorithm and its settings on https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.Radau.html. .. raw:: html
Optional settings
  • **atol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The absolute tolerance. By default it is set to 1e-06. .. raw:: html
  • **first_step** : *typing.Optional[typing.Annotated[float, Gt(gt=0)]], optional* The initial step size. If ``None``, let the algorithm choose. By default it is set to None. .. raw:: html
  • **jac_sparsity** : *typing.Optional[gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[float]]], optional* Sparsity structure of the Jacobian matrix. By default it is set to None. .. raw:: html
  • **max_step** : *, optional* The maximum allowed step size. By default it is set to inf. .. raw:: html
  • **rtol** : *typing.Union[typing.Annotated[float, Gt(gt=0)], gemseo.utils.pydantic_ndarray._NDArrayPydantic[typing.Any, numpy.dtype[typing.Annotated[float, Gt(gt=0)]]]], optional* The relative tolerance. By default it is set to 0.001. .. raw:: html