§
    fŠtjY  ã                   ó  — d dl ZddlmZmZ ddlmZmZmZm	Z	m
Z
mZ ddlmZ dZdZdZd	„ Z G d
„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        ZdS )é    Né   )Ú	OdeSolverÚDenseOutput)Úvalidate_max_stepÚvalidate_tolÚselect_initial_stepÚnormÚwarn_extraneousÚvalidate_first_step)Údop853_coefficientsgÍÌÌÌÌÌì?çš™™™™™É?é
   c	                 ó†  — ||d<   t          t          |dd…         |dd…         ¦  «        d¬¦  «        D ]M\  }	\  }
}t          j        |d|	…         j        |
d|	…         ¦  «        |z  } | |||z  z   ||z   ¦  «        ||	<   ŒN||t          j        |dd…         j        |¦  «        z  z   } | ||z   |¦  «        }||d<   ||fS )a8  Perform a single Runge-Kutta step.

    This function computes a prediction of an explicit Runge-Kutta method and
    also estimates the error of a less accurate method.

    Notation for Butcher tableau is as in [1]_.

    Parameters
    ----------
    fun : callable
        Right-hand side of the system.
    t : float
        Current time.
    y : ndarray, shape (n,)
        Current state.
    f : ndarray, shape (n,)
        Current value of the derivative, i.e., ``fun(x, y)``.
    h : float
        Step to use.
    A : ndarray, shape (n_stages, n_stages)
        Coefficients for combining previous RK stages to compute the next
        stage. For explicit methods the coefficients at and above the main
        diagonal are zeros.
    B : ndarray, shape (n_stages,)
        Coefficients for combining RK stages for computing the final
        prediction.
    C : ndarray, shape (n_stages,)
        Coefficients for incrementing time for consecutive RK stages.
        The value for the first stage is always zero.
    K : ndarray, shape (n_stages + 1, n)
        Storage array for putting RK stages here. Stages are stored in rows.
        The last row is a linear combination of the previous rows with
        coefficients

    Returns
    -------
    y_new : ndarray, shape (n,)
        Solution at t + h computed with a higher accuracy.
    f_new : ndarray, shape (n,)
        Derivative ``fun(t + h, y_new)``.

    References
    ----------
    .. [1] E. Hairer, S. P. Norsett G. Wanner, "Solving Ordinary Differential
           Equations I: Nonstiff Problems", Sec. II.4.
    r   r   N©Ústartéÿÿÿÿ)Ú	enumerateÚzipÚnpÚdotÚT)ÚfunÚtÚyÚfÚhÚAÚBÚCÚKÚsÚaÚcÚdyÚy_newÚf_news                  úU/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/scipy/integrate/_ivp/rk.pyÚrk_stepr(      sä   € ð^ €A€a�DÝ�s 1 Q R R¤5¨!¨A¨B¨B¬%Ñ0Ô0¸Ð:Ñ:Ô:ð &ð &‰	ˆ‰6ˆAˆqÝŒV�A�b�q�b”E”G˜Q˜r ˜rœUÑ#Ô# aÑ'ˆØˆs�1�q˜1‘u‘9˜a "™fÑ%Ô%ˆˆ!‰ˆà�•B”F˜1˜S˜b˜Sœ6œ8 QÑ'Ô'Ñ'Ñ'€EØˆC��A‘�uÑÔ€Eà€A€b�Eà�%ˆ<Ðó    c                   óô   ‡ — e Zd ZU dZeZej        ed<   eZ	ej        ed<   eZ
ej        ed<   eZej        ed<   eZej        ed<   eZeed<   eZeed<   eZeed	<   ej        d
dddfˆ fd„	Zd„ Zd„ Zd„ Zd„ Zˆ xZS )Ú
RungeKuttaz,Base class for explicit Runge-Kutta methods.r   r   r   ÚEÚPÚorderÚerror_estimator_orderÚn_stagesçü©ñÒMbP?ç�íµ ÷Æ°>FNc
                 ó�  •— t          |
¦  «         t          ¦   «                              |||||d¬¦  «         d | _        t	          |¦  «        | _        t          ||| j        ¦  «        \  | _        | _	        |  
                    | j        | j        ¦  «        | _        |	€Ft          | j
        | j        | j        ||| j        | j        | j        | j        | j	        ¦
  «
        | _        nt%          |	||¦  «        | _        t'          j        | j        dz   | j        f| j        j        ¬¦  «        | _        d| j        dz   z  | _        d | _        d S )NT)Úsupport_complexr   ©Údtyper   )r
   ÚsuperÚ__init__Úy_oldr   Úmax_stepr   ÚnÚrtolÚatolr   r   r   r   r   Ú	directionr/   Úh_absr   r   Úemptyr0   r6   r    Úerror_exponentÚ
h_previous©Úselfr   Út0Úy0Út_boundr:   r<   r=   Ú
vectorizedÚ
first_stepÚ
extraneousÚ	__class__s              €r'   r8   zRungeKutta.__init__U   s+  ø€ õ 	˜
Ñ#Ô#Ð#Ý‰Œ×Ò˜˜b " g¨zØ)-ð 	ñ 	/ô 	/ð 	/àˆŒ
Ý)¨(Ñ3Ô3ˆŒÝ+¨D°$¸¼Ñ?Ô?ÑˆŒ	�4”9Ø—’˜$œ& $¤&Ñ)Ô)ˆŒØÐÝ,Ø”˜$œ& $¤&¨'°8¸T¼VÀTÄ^ØÔ*¨D¬I°t´yñBô BˆDŒJˆJõ -¨Z¸¸WÑEÔEˆDŒJÝ”˜4œ=¨1Ñ,¨d¬fÐ5¸T¼V¼\ÐJÑJÔJˆŒØ  DÔ$>ÀÑ$BÑCˆÔØˆŒˆˆr)   c                 óF   — t          j        |j        | j        ¦  «        |z  S ©N)r   r   r   r,   )rD   r    r   s      r'   Ú_estimate_errorzRungeKutta._estimate_errori   s   € ÝŒv�a”c˜4œ6Ñ"Ô" QÑ&Ð&r)   c                 óN   — t          |                      ||¦  «        |z  ¦  «        S rM   )r	   rN   )rD   r    r   Úscales       r'   Ú_estimate_error_normzRungeKutta._estimate_error_norml   s%   € Ý�D×(Ò(¨¨AÑ.Ô.°Ñ6Ñ7Ô7Ð7r)   c                 ó@  — | j         }| j        }| j        }| j        }| j        }dt          j        t          j        || j        t
          j	        z  ¦  «        |z
  ¦  «        z  }| j
        |k    r|}n| j
        |k     r|}n| j
        }d}d}	|�sg||k     r	d| j        fS || j        z  }
||
z   }| j        || j        z
  z  dk    r| j        }||z
  }
t          j        |
¦  «        }t          | j        ||| j        |
| j        | j        | j        | j        ¦	  «	        \  }}|t          j        t          j        |¦  «        t          j        |¦  «        ¦  «        |z  z   }|                      | j        |
|¦  «        }|dk     rM|dk    rt,          }n%t/          t,          t0          || j        z  z  ¦  «        }|	rt/          d|¦  «        }||z  }d}n*|t5          t6          t0          || j        z  z  ¦  «        z  }d}	|�¯g|
| _        || _        || _         || _        || _
        || _        dS )Nr   Fr   r   T)TN)r   r   r:   r<   r=   r   ÚabsÚ	nextafterr>   Úinfr?   ÚTOO_SMALL_STEPrG   r(   r   r   r   r   r   r    ÚmaximumrQ   Ú
MAX_FACTORÚminÚSAFETYrA   ÚmaxÚ
MIN_FACTORrB   r9   )rD   r   r   r:   r<   r=   Úmin_stepr?   Ústep_acceptedÚstep_rejectedr   Út_newr%   r&   rP   Ú
error_normÚfactors                    r'   Ú
_step_implzRungeKutta._step_implo   s>  € ØŒFˆØŒFˆà”=ˆØŒyˆØŒyˆà�œ�rœ|¨A¨t¬~ÅÄÑ/FÑGÔGÈ!ÑKÑLÔLÑLˆàŒ:˜Ò Ð ØˆEˆEØŒZ˜(Ò"Ð"ØˆEˆEà”JˆEàˆØˆàñ "	%Ø�xÒÐØ˜dÔ1Ð1Ð1à˜œÑ&ˆAØ˜‘EˆEàŒ~ ¨¬Ñ!5Ñ6¸Ò:Ð:Øœ�à˜‘	ˆAÝ”F˜1‘I”IˆEå" 4¤8¨Q°°4´6¸1¸d¼fØ#'¤6¨4¬6°4´6ñ;ô ;‰LˆE�5à�2œ:¥b¤f¨Q¡i¤iµ´¸±´Ñ?Ô?À$ÑFÑFˆEØ×2Ò2°4´6¸1¸eÑDÔDˆJà˜AŠ~ˆ~Ø ’?�?Ý'�F�Få ¥Ý!'¨*¸Ô8KÑ*KÑ!KñMô M�Fð !ð ,Ý   F™^œ^�Fà˜‘�à $��à��ZÝ# j°DÔ4GÑ&GÑGñIô Iñ I�à $�ðE  ñ "	%ðH ˆŒØˆŒ
àˆŒØˆŒàˆŒ
ØˆŒàˆzr)   c                 óŒ   — | j         j                             | j        ¦  «        }t	          | j        | j        | j        |¦  «        S rM   )r    r   r   r-   ÚRkDenseOutputÚt_oldr   r9   )rD   ÚQs     r'   Ú_dense_output_implzRungeKutta._dense_output_impl²   s3   € ØŒFŒH�LŠL˜œÑ Ô ˆÝ˜TœZ¨¬°´¸QÑ?Ô?Ð?r)   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚNotImplementedr   r   ÚndarrayÚ__annotations__r   r   r,   r-   r.   Úintr/   r0   rU   r8   rN   rQ   rc   rh   Ú__classcell__©rK   s   @r'   r+   r+   J   s&  ø€ € € € € € Ø6Ð6Ø"€A€r„zÐ"Ð"Ñ"Ø"€A€r„zÐ"Ð"Ñ"Ø"€A€r„zÐ"Ð"Ñ"Ø"€A€r„zÐ"Ð"Ñ"Ø"€A€r„zÐ"Ð"Ñ"Ø€Eˆ3ÐÐÑØ!/Ð˜3Ð/Ð/Ñ/Ø"€HˆcÐ"Ð"Ñ"à68´fØ °%Ø ðð ð ð ð ð ð('ð 'ð 'ð8ð 8ð 8ðAð Að AðF@ð @ð @ð @ð @ð @ð @r)   r+   c                   óô   — e Zd ZdZdZdZdZ ej        g d¢¦  «        Z	 ej        g d¢g d¢g d¢g¦  «        Z
 ej        g d¢¦  «        Z ej        g d	¢¦  «        Z ej        g d
¢g d¢g d¢g d¢g¦  «        ZdS )ÚRK23a  Explicit Runge-Kutta method of order 3(2).

    This uses the Bogacki-Shampine pair of formulas [1]_. The error is controlled
    assuming accuracy of the second-order method, but steps are taken using the
    third-order accurate formula (local extrapolation is done). A cubic Hermite
    polynomial is used for the dense output.

    Can be applied in the complex domain.

    Parameters
    ----------
    fun : callable
        Right-hand side of the system: the time derivative of the state ``y``
        at time ``t``. The calling signature is ``fun(t, y)``, where ``t`` is a
        scalar and ``y`` is an ndarray with ``len(y) = len(y0)``. ``fun`` must
        return an array of the same shape as ``y``. See `vectorized` for more
        information.
    t0 : float
        Initial time.
    y0 : array_like, shape (n,)
        Initial state.
    t_bound : float
        Boundary time - the integration won't continue beyond it. It also
        determines the direction of the integration.
    first_step : float or None, optional
        Initial step size. Default is ``None`` which means that the algorithm
        should choose.
    max_step : float, optional
        Maximum allowed step size. Default is np.inf, i.e., the step size is not
        bounded and determined solely by the solver.
    rtol, atol : float and array_like, optional
        Relative and absolute tolerances. The solver keeps the local error
        estimates less than ``atol + rtol * abs(y)``. Here `rtol` controls a
        relative accuracy (number of correct digits), while `atol` controls
        absolute accuracy (number of correct decimal places). To achieve the
        desired `rtol`, set `atol` to be smaller than the smallest value that
        can be expected from ``rtol * abs(y)`` so that `rtol` dominates the
        allowable error. If `atol` is larger than ``rtol * abs(y)`` the
        number of correct digits is not guaranteed. Conversely, to achieve the
        desired `atol` set `rtol` such that ``rtol * abs(y)`` is always smaller
        than `atol`. If components of y have different scales, it might be
        beneficial to set different `atol` values for different components by
        passing array_like with shape (n,) for `atol`. Default values are
        1e-3 for `rtol` and 1e-6 for `atol`.
    vectorized : bool, optional
        Whether `fun` may be called in a vectorized fashion. False (default)
        is recommended for this solver.

        If ``vectorized`` is False, `fun` will always be called with ``y`` of
        shape ``(n,)``, where ``n = len(y0)``.

        If ``vectorized`` is True, `fun` may be called with ``y`` of shape
        ``(n, k)``, where ``k`` is an integer. In this case, `fun` must behave
        such that ``fun(t, y)[:, i] == fun(t, y[:, i])`` (i.e. each column of
        the returned array is the time derivative of the state corresponding
        with a column of ``y``).

        Setting ``vectorized=True`` allows for faster finite difference
        approximation of the Jacobian by methods 'Radau' and 'BDF', but
        will result in slower execution for this solver.

    Attributes
    ----------
    n : int
        Number of equations.
    status : string
        Current status of the solver: 'running', 'finished' or 'failed'.
    t_bound : float
        Boundary time.
    direction : float
        Integration direction: +1 or -1.
    t : float
        Current time.
    y : ndarray
        Current state.
    t_old : float
        Previous time. None if no steps were made yet.
    step_size : float
        Size of the last successful step. None if no steps were made yet.
    nfev : int
        Number evaluations of the system's right-hand side.
    njev : int
        Number of evaluations of the Jacobian.
        Is always 0 for this solver as it does not use the Jacobian.
    nlu : int
        Number of LU decompositions. Is always 0 for this solver.

    References
    ----------
    .. [1] P. Bogacki, L.F. Shampine, "A 3(2) Pair of Runge-Kutta Formulas",
           Appl. Math. Lett. Vol. 2, No. 4. pp. 321-325, 1989.
    é   é   )r   ç      à?ç      è?)r   r   r   )rw   r   r   )r   rx   r   )gÇqÇqÌ?gUUUUUUÕ?gÇqÇqÜ?)grÇqÇ±?gUUUUUUµ¿gÇqÇq¼¿g      À?)r   gUUUUUUõ¿grÇqÇá?)r   r   gUUUUUUå¿)r   gUUUUUUõ?gÇqÇqì¿)r   r   r   N©ri   rj   rk   rl   r.   r/   r0   r   Úarrayr   r   r   r,   r-   © r)   r'   rt   rt   ·   sÔ   € € € € € ð[ð [ðx €EØÐØ€HØˆŒ���ÑÔ€AØˆŒØˆ	ˆ	ØˆˆØˆˆðñ 	ô 	€Að
 	ˆŒ���Ñ!Ô!€AØˆŒÐ)Ð)Ð)Ñ*Ô*€AØˆŒÐ$Ð$Ð$Ø�,�,Ø �.�.Ø�*�*ðñ 	ô 	€A€A€Ar)   rt   c            
       ó  — e Zd ZdZdZdZdZ ej        g d¢¦  «        Z	 ej        g d¢g d¢g d¢g d	¢g d
¢g d¢g¦  «        Z
 ej        g d¢¦  «        Z ej        g d¢¦  «        Z ej        g d¢g d¢g d¢g d¢g d¢g d¢g d¢g¦  «        ZdS )ÚRK45aà  Explicit Runge-Kutta method of order 5(4).

    This uses the Dormand-Prince pair of formulas [1]_. The error is controlled
    assuming accuracy of the fourth-order method accuracy, but steps are taken
    using the fifth-order accurate formula (local extrapolation is done).
    A quartic interpolation polynomial is used for the dense output [2]_.

    Can be applied in the complex domain.

    Parameters
    ----------
    fun : callable
        Right-hand side of the system. The calling signature is ``fun(t, y)``.
        Here ``t`` is a scalar, and there are two options for the ndarray ``y``:
        It can either have shape (n,); then ``fun`` must return array_like with
        shape (n,). Alternatively it can have shape (n, k); then ``fun``
        must return an array_like with shape (n, k), i.e., each column
        corresponds to a single column in ``y``. The choice between the two
        options is determined by `vectorized` argument (see below).
    t0 : float
        Initial time.
    y0 : array_like, shape (n,)
        Initial state.
    t_bound : float
        Boundary time - the integration won't continue beyond it. It also
        determines the direction of the integration.
    first_step : float or None, optional
        Initial step size. Default is ``None`` which means that the algorithm
        should choose.
    max_step : float, optional
        Maximum allowed step size. Default is np.inf, i.e., the step size is not
        bounded and determined solely by the solver.
    rtol, atol : float and array_like, optional
        Relative and absolute tolerances. The solver keeps the local error
        estimates less than ``atol + rtol * abs(y)``. Here `rtol` controls a
        relative accuracy (number of correct digits), while `atol` controls
        absolute accuracy (number of correct decimal places). To achieve the
        desired `rtol`, set `atol` to be smaller than the smallest value that
        can be expected from ``rtol * abs(y)`` so that `rtol` dominates the
        allowable error. If `atol` is larger than ``rtol * abs(y)`` the
        number of correct digits is not guaranteed. Conversely, to achieve the
        desired `atol` set `rtol` such that ``rtol * abs(y)`` is always smaller
        than `atol`. If components of y have different scales, it might be
        beneficial to set different `atol` values for different components by
        passing array_like with shape (n,) for `atol`. Default values are
        1e-3 for `rtol` and 1e-6 for `atol`.
    vectorized : bool, optional
        Whether `fun` is implemented in a vectorized fashion. Default is False.

    Attributes
    ----------
    n : int
        Number of equations.
    status : string
        Current status of the solver: 'running', 'finished' or 'failed'.
    t_bound : float
        Boundary time.
    direction : float
        Integration direction: +1 or -1.
    t : float
        Current time.
    y : ndarray
        Current state.
    t_old : float
        Previous time. None if no steps were made yet.
    step_size : float
        Size of the last successful step. None if no steps were made yet.
    nfev : int
        Number evaluations of the system's right-hand side.
    njev : int
        Number of evaluations of the Jacobian.
        Is always 0 for this solver as it does not use the Jacobian.
    nlu : int
        Number of LU decompositions. Is always 0 for this solver.

    References
    ----------
    .. [1] J. R. Dormand, P. J. Prince, "A family of embedded Runge-Kutta
           formulae", Journal of Computational and Applied Mathematics, Vol. 6,
           No. 1, pp. 19-26, 1980.
    .. [2] L. W. Shampine, "Some Practical Runge-Kutta Formulas", Mathematics
           of Computation,, Vol. 46, No. 173, pp. 135-150, 1986.
    é   é   é   )r   r   g333333Ó?gš™™™™™é?gÇqÇqì?r   )r   r   r   r   r   )r   r   r   r   r   )g333333³?gÍÌÌÌÌÌÌ?r   r   r   )gŸôIŸôIï?gÞÝÝÝÝÝÀgÇqÇq@r   r   )g�qÃìž@gä •Ò1'Àg�R<6R¥#@gE3ºžœÒ¿r   )g°¨õ+Å@g„>øàƒ%Àg‹r£Ð!@gÑE]tÑÑ?g/ÌÙp‰�Ñ¿)gUUUUUU·?r   gûVšIÀÜ?gUUUUUÕä?gŒ·²Ï¡Ô¿g1Ã0ÃÀ?)g‡©Ëí2T¿r   gÄ¿
UZkq?gïîîîîî¢¿gXÊÒÑ
ª?gâðÚ{Št¥¿gš™™™™™™?)r   g#Ð
É!ÔÀgñJÀ<î’@gF ’Cò¿)r   r   r   r   )r   gãõÌF°@gFj'NÿÀg‡©¹óDg@)r   gdD�õÛÀga‡÷P#$@g2¢Çú½À)r   g¸’ý<p@g›@ê°˜Àg’Œ—àê,@)r   gRqÖ#¤ýõ¿g_40g.
@gå•¶ÈFü¿)r   g'’¾—ö?g'’¾—ÀgÉßK@Nry   r{   r)   r'   r}   r}   %  s?  € € € € € ðRð Rðf €EØÐØ€HØˆŒÐ,Ð,Ð,Ñ-Ô-€AØˆŒØˆˆØÐÐØÐÐØ#Ð#Ð#Ø:Ð:Ð:Ø=Ð=Ð=ðñ 	ô 	€Að 	ˆŒÐBÐBÐBÑCÔC€AØˆŒð ð ð ñ 	ô 	€Að 	ˆŒð	#ð 	#ð 	#àˆˆð	"ð 	"ð 	"ð	"ð 	"ð 	"ð	&ð 	&ð 	&àNÐNÐNØFÐFÐFðHñ 	Iô 	I€A€A€Ar)   r}   c                   ó$  ‡ — e Zd ZdZej        ZdZdZej	        de…de…f         Z	ej
        Z
ej        de…         Zej        Zej        Zej        Zej	        edz   d…         Zej        edz   d…         Zej        ddddfˆ fd	„	Zd
„ Zd„ Zd„ Zˆ xZS )ÚDOP853a"  Explicit Runge-Kutta method of order 8.

    This is a Python implementation of "DOP853" algorithm originally written
    in Fortran [1]_, [2]_. Note that this is not a literal translation, but
    the algorithmic core and coefficients are the same.

    Can be applied in the complex domain.

    Parameters
    ----------
    fun : callable
        Right-hand side of the system. The calling signature is ``fun(t, y)``.
        Here, ``t`` is a scalar, and there are two options for the ndarray ``y``:
        It can either have shape (n,); then ``fun`` must return array_like with
        shape (n,). Alternatively it can have shape (n, k); then ``fun``
        must return an array_like with shape (n, k), i.e. each column
        corresponds to a single column in ``y``. The choice between the two
        options is determined by `vectorized` argument (see below).
    t0 : float
        Initial time.
    y0 : array_like, shape (n,)
        Initial state.
    t_bound : float
        Boundary time - the integration won't continue beyond it. It also
        determines the direction of the integration.
    first_step : float or None, optional
        Initial step size. Default is ``None`` which means that the algorithm
        should choose.
    max_step : float, optional
        Maximum allowed step size. Default is np.inf, i.e. the step size is not
        bounded and determined solely by the solver.
    rtol, atol : float and array_like, optional
        Relative and absolute tolerances. The solver keeps the local error
        estimates less than ``atol + rtol * abs(y)``. Here `rtol` controls a
        relative accuracy (number of correct digits), while `atol` controls
        absolute accuracy (number of correct decimal places). To achieve the
        desired `rtol`, set `atol` to be smaller than the smallest value that
        can be expected from ``rtol * abs(y)`` so that `rtol` dominates the
        allowable error. If `atol` is larger than ``rtol * abs(y)`` the
        number of correct digits is not guaranteed. Conversely, to achieve the
        desired `atol` set `rtol` such that ``rtol * abs(y)`` is always smaller
        than `atol`. If components of y have different scales, it might be
        beneficial to set different `atol` values for different components by
        passing array_like with shape (n,) for `atol`. Default values are
        1e-3 for `rtol` and 1e-6 for `atol`.
    vectorized : bool, optional
        Whether `fun` is implemented in a vectorized fashion. Default is False.

    Attributes
    ----------
    n : int
        Number of equations.
    status : string
        Current status of the solver: 'running', 'finished' or 'failed'.
    t_bound : float
        Boundary time.
    direction : float
        Integration direction: +1 or -1.
    t : float
        Current time.
    y : ndarray
        Current state.
    t_old : float
        Previous time. None if no steps were made yet.
    step_size : float
        Size of the last successful step. None if no steps were made yet.
    nfev : int
        Number evaluations of the system's right-hand side.
    njev : int
        Number of evaluations of the Jacobian. Is always 0 for this solver
        as it does not use the Jacobian.
    nlu : int
        Number of LU decompositions. Is always 0 for this solver.

    References
    ----------
    .. [1] E. Hairer, S. P. Norsett G. Wanner, "Solving Ordinary Differential
           Equations I: Nonstiff Problems", Sec. II.
    .. [2] `Page with original Fortran code of DOP853
            <http://www.unige.ch/~hairer/software.html>`_.
    é   é   Nr   r1   r2   Fc
                 óð   •—  t          ¦   «         j        |||||||||	f	i |
¤Ž t          j        t          j        | j        f| j        j        ¬¦  «        | _	        | j	        d | j
        dz   …         | _        d S )Nr5   r   )r7   r8   r   r@   r   ÚN_STAGES_EXTENDEDr;   r   r6   Ú
K_extendedr0   r    rC   s              €r'   r8   zDOP853.__init__ö  s‘   ø€ ð 	�‰ŒÔ˜˜b " g¨x¸¸tØ# Zð	?ð 	?Ø3=ð	?ð 	?ð 	?åœ(Õ$7Ô$IØ$(¤Fð$,Ø37´6´<ðAñ Aô AˆŒà”Ð!3 $¤-°!Ñ"3Ð!3Ô4ˆŒˆˆr)   c                 ó†  — t          j        |j        | j        ¦  «        }t          j        |j        | j        ¦  «        }t          j        t          j        |¦  «        dt          j        |¦  «        z  ¦  «        }t          j        |¦  «        }|dk    }t          j        ||         ¦  «        ||         z  ||<   ||z  |z  S )Ngš™™™™™¹?r   )r   r   r   ÚE5ÚE3ÚhypotrS   Ú	ones_like)rD   r    r   Úerr5Úerr3ÚdenomÚcorrection_factorÚmasks           r'   rN   zDOP853._estimate_errorÿ  s�   € ÝŒv�a”c˜4œ7Ñ#Ô#ˆÝŒv�a”c˜4œ7Ñ#Ô#ˆÝ”�œ ™œ s­R¬V°D©\¬\Ñ'9Ñ:Ô:ˆÝœL¨Ñ.Ô.ÐØ�qŠyˆÝ"$¤&¨¨d¬Ñ"4Ô"4°u¸T´{Ñ"BÐ˜$ÑØ�4‰xÐ+Ñ+Ð+r)   c                 ó¶  — t          j        |j        | j        ¦  «        |z  }t          j        |j        | j        ¦  «        |z  }t           j                             |¦  «        dz  }t           j                             |¦  «        dz  }|dk    r|dk    rdS |d|z  z   }t          j        |¦  «        |z  t          j        |t          |¦  «        z  ¦  «        z  S )Nrv   r   g        g{®Gáz„?)
r   r   r   r‰   rŠ   Úlinalgr	   rS   ÚsqrtÚlen)	rD   r    r   rP   r�   rŽ   Úerr5_norm_2Úerr3_norm_2r�   s	            r'   rQ   zDOP853._estimate_error_norm  s¼   € ÝŒv�a”c˜4œ7Ñ#Ô# eÑ+ˆÝŒv�a”c˜4œ7Ñ#Ô# eÑ+ˆÝ”i—n’n TÑ*Ô*¨AÑ-ˆÝ”i—n’n TÑ*Ô*¨AÑ-ˆØ˜!ÒÐ ¨qÒ 0Ð 0Ø�3Ø˜d [Ñ0Ñ0ˆÝŒv�a‰yŒy˜;Ñ&­¬°½¸U¹¼Ñ1CÑ)DÔ)DÑDÐDr)   c                 ó¦  — | j         }| j        }t          t          | j        | j        ¦  «        | j        dz   ¬¦  «        D ]a\  }\  }}t          j        |d |…         j	        |d |…         ¦  «        |z  }|  
                    | j        ||z  z   | j        |z   ¦  «        ||<   Œbt          j        t          j        | j        f| j        j        ¬¦  «        }|d         }| j        | j        z
  }	|	|d<   ||z  |	z
  |d<   d|	z  || j        |z   z  z
  |d<   |t          j        | j        |¦  «        z  |dd …<   t+          | j        | j        | j        |¦  «        S )Nr   r   r5   r   rv   ru   )r‡   rB   r   r   ÚA_EXTRAÚC_EXTRAr0   r   r   r   r   rf   r9   r@   r   ÚINTERPOLATOR_POWERr;   r6   r   r   ÚDÚDop853DenseOutputr   )
rD   r    r   r!   r"   r#   r$   ÚFÚf_oldÚdelta_ys
             r'   rh   zDOP853._dense_output_impl  sZ  € ØŒOˆØŒOˆÝ"¥3 t¤|°T´\Ñ#BÔ#BØ)-¬¸Ñ):ð<ñ <ô <ð 	Að 	A‰IˆA‰v��1å”˜˜"˜1˜"œœ  2 A 2¤Ñ'Ô'¨!Ñ+ˆBØ—8’8˜DœJ¨¨Q©Ñ.°´
¸R±Ñ@Ô@ˆAˆa‰DˆDåŒHÕ)Ô<¸d¼fÐEØœ:Ô+ð-ñ -ô -ˆð �!”ˆØ”&˜4œ:Ñ%ˆàˆˆ!‰Ø�5‰y˜7Ñ"ˆˆ!‰Ø�7‰{˜Q $¤&¨5¡.Ñ1Ñ1ˆˆ!‰Ø•B”F˜4œ6 1Ñ%Ô%Ñ%ˆˆ!ˆ"ˆ"‰å  ¤¨T¬V°T´ZÀÑCÔCÐCr)   )ri   rj   rk   rl   r   ÚN_STAGESr0   r.   r/   r   r   r   rŠ   r‰   rœ   r™   rš   r   rU   r8   rN   rQ   rh   rq   rr   s   @r'   r‚   r‚   —  s  ø€ € € € € ðPð Pðb #Ô+€HØ€EØÐØÔ˜i˜x˜i¨¨(¨Ð2Ô3€AØÔ€AØÔ˜i˜x˜iÔ(€AØ	Ô	€BØ	Ô	€BØÔ€Aà!Ô# H¨q¡L M MÔ2€GØ!Ô# H¨q¡L M MÔ2€Gà68´fØ °%Ø ð5ð 5ð 5ð 5ð 5ð 5ð,ð ,ð ,ðEð Eð EðDð Dð Dð Dð Dð Dð Dr)   r‚   c                   ó$   ‡ — e Zd Zˆ fd„Zd„ Zˆ xZS )re   c                 ó¦   •— t          ¦   «                              ||¦  «         ||z
  | _        || _        |j        d         dz
  | _        || _        d S )Nr   )r7   r8   r   rg   Úshaper.   r9   )rD   rf   r   r9   rg   rK   s        €r'   r8   zRkDenseOutput.__init__)  sK   ø€ Ý‰Œ×Ò˜ Ñ"Ô"Ð"Ø�U‘ˆŒØˆŒØ”W˜Q”Z !‘^ˆŒ
ØˆŒ
ˆ
ˆ
r)   c                 ó¦  — || j         z
  | j        z  }|j        dk    r2t          j        || j        dz   ¦  «        }t          j        |¦  «        }n5t          j        || j        dz   df¦  «        }t          j        |d¬¦  «        }| j        t          j        | j        |¦  «        z  }|j        dk    r|| j	        d d …d f         z  }n
|| j	        z  }|S )Nr   r   )Úaxisrv   )
rf   r   Úndimr   Útiler.   Úcumprodr   rg   r9   )rD   r   ÚxÚpr   s        r'   Ú
_call_implzRkDenseOutput._call_impl0  sÅ   € Ø�”‰^˜tœvÑ%ˆØŒ6�QŠ;ˆ;Ý”˜˜4œ:¨™>Ñ*Ô*ˆAÝ”
˜1‘”ˆAˆAå”˜˜DœJ¨™N¨AÐ.Ñ/Ô/ˆAÝ”
˜1 1Ð%Ñ%Ô%ˆAØŒF•R”V˜DœF AÑ&Ô&Ñ&ˆØŒ6�QŠ;ˆ;Ø�”˜A˜A˜A˜t˜GÔ$Ñ$ˆAˆAà�”‰OˆAàˆr)   ©ri   rj   rk   r8   r¬   rq   rr   s   @r'   re   re   (  sG   ø€ € € € € ðð ð ð ð ðð ð ð ð ð ð r)   re   c                   ó$   ‡ — e Zd Zˆ fd„Zd„ Zˆ xZS )r�   c                 ó|   •— t          ¦   «                              ||¦  «         ||z
  | _        || _        || _        d S rM   )r7   r8   r   rž   r9   )rD   rf   r   r9   rž   rK   s        €r'   r8   zDop853DenseOutput.__init__B  s:   ø€ Ý‰Œ×Ò˜ Ñ"Ô"Ð"Ø�U‘ˆŒØˆŒØˆŒ
ˆ
ˆ
r)   c                 ó²  — || j         z
  | j        z  }|j        dk    rt          j        | j        ¦  «        }nM|d d …d f         }t          j        t          |¦  «        t          | j        ¦  «        f| j        j        ¬¦  «        }t          t          | j        ¦  «        ¦  «        D ]!\  }}||z  }|dz  dk    r||z  }Œ|d|z
  z  }Œ"|| j        z  }|j        S )Nr   r5   rv   r   )rf   r   r§   r   Ú
zeros_liker9   Úzerosr•   r6   r   Úreversedrž   r   )rD   r   rª   r   Úir   s         r'   r¬   zDop853DenseOutput._call_implH  sÖ   € Ø�”‰^˜tœvÑ%ˆàŒ6�QŠ;ˆ;Ý”˜dœjÑ)Ô)ˆAˆAà�!�!�!�T�'”
ˆAÝ”�#˜a™&œ&¥# d¤j¡/¤/Ð2¸$¼*Ô:JÐKÑKÔKˆAå�h t¤vÑ.Ô.Ñ/Ô/ð 	ð 	‰DˆAˆqØ�‰FˆAØ�1‰u˜ŠzˆzØ�Q‘��à�Q˜‘U‘
��Ø	ˆTŒZ‰ˆàŒsˆ
r)   r­   rr   s   @r'   r�   r�   A  sG   ø€ € € € € ðð ð ð ð ðð ð ð ð ð ð r)   r�   )Únumpyr   Úbaser   r   Úcommonr   r   r   r	   r
   r   Ú r   rZ   r\   rX   r(   r+   rt   r}   r‚   re   r�   r{   r)   r'   ú<module>r¹      sþ  ðØ Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (ðAð Að Að Að Að Að Að Að Að Að Að Að Að Að Að Aà !Ð !Ð !Ð !Ð !Ð !ð 
€à€
Ø€
ð9ð 9ð 9ðxj@ð j@ð j@ð j@ð j@�ñ j@ô j@ð j@ðZkð kð kð kð kˆ:ñ kô kð kð\oIð oIð oIð oIð oIˆ:ñ oIô oIð oIðdNDð NDð NDð NDð NDˆZñ NDô NDð NDðbð ð ð ð �Kñ ô ð ð2ð ð ð ð ˜ñ ô ð ð ð r)   