:py:mod:`byma.numy`
===================

.. py:module:: byma.numy

.. autoapi-nested-parse::

   ``byma.numy``
   ================

   The ByMa basic numerical methods sub-package.

   Functions present in byma.numy are listed below.


   Continuation
   --------------------------

      euler
      

   Exceptions
   ----------

      NuMyError



Submodules
----------
.. toctree::
   :titlesonly:
   :maxdepth: 1

   Numy/index.rst
   integration/index.rst


Package Contents
----------------

Classes
~~~~~~~

.. autoapisummary::

   byma.numy.Numy



Functions
~~~~~~~~~

.. autoapisummary::

   byma.numy.euler



.. py:class:: Numy


   Defines default options for the numerical methods sub-package


.. py:function:: euler(start=0, T=1, dt=0.01, x0=None, f=None, df=None, **kwargs)

   Euler integration method.

   Parameters
   ----------
   start : float, optional
       Start time of integration (default: 0).
   T : float, optional
       End time of integration (default: 1).
   dt : float, optional
       Time step for integration (default: 0.01).
   x0 : numpy.ndarray, optional
       Initial condition (default: None).
   f : callable, optional
       Function representing the derivative of the system (default: None).
   df : callable, optional
       Function representing the derivative of the derivative of the system (default: None).
   **kwargs : dict, optional
       Additional keyword arguments.

   Returns
   -------
   sol : list
       List containing the solution at each time step.
   iter_list : list
       List containing the norm of the change in solution at each iteration.
   time : numpy.ndarray
       Array containing the time steps.

   Raises
   ------
   ValueError
       If x0, f, or df is None.
       If an invalid continuation method is provided.

   Notes
   -----
   This function implements the Euler integration method for solving ordinary differential equations.

   Examples
   --------
   >>> import numpy as np
   >>> from byma.numy import euler
   >>> def f(x, t):
   ...     return -x * t
   >>> sol, iter_list, time = euler(f=f, x0=1, T=1, dt=0.1)


