403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/scipy/integrate/_ivp/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/scipy/integrate/_ivp/__pycache__/radau.cpython-311.pyc
�

d�c�K���ddlZddlmZmZddlmZmZmZddl	m
Z
ddlmZddl
mZmZmZmZmZmZmZmZddlmZmZd	Zejd
ez
dzd
ezdzdg��Zejdd
ezz
dd
ezzdg��dzZdZdZejgd�gd�gd�g��Zejgd�gd�gd�g��Z e dZ!e dde dzzZ"ejdd
ezdzzddezdzz
ddezzgdd
ezdzz
ddezdzzddezz
ggd�g��Z#d Z$d!Z%dZ&d"�Z'd#�Z(Gd$�d%e��Z)Gd&�d'e��Z*dS)(�N)�	lu_factor�lu_solve)�
csc_matrix�issparse�eye)�splu)�
group_columns�)�validate_max_step�validate_tol�select_initial_step�norm�num_jac�EPS�warn_extraneous�validate_first_step)�	OdeSolver�DenseOutputg.!	��@��
i������gs>�H
@yr���r@����Gg�)g{g]�#-�?g�;@L�¿g�hm���?)g�
�}�?gQ� � �?g�m���ؿ)r
r
r)gF���@g�N�]���?g�V����?)gF����g�N�]��Կg!R���?)g�$Z��?g���oN��g��{��?��?�gUUUUUU@g��������竪����
@�)gUUUUUU�?gUUUUUU�r�g�������?c
��|jd}
t|z}t|z}t�|��}
|}tjd|
f��}|tz}d}tj|
��}d}d}tt��D�]k}td��D]#}||||z|||z��||<�$tjtj|����s�n|j
�t��||
dzz
}|j
�t��||
dd|
dzzzz
}|	||��}|	||��}||d<|j|d<|j|d<t%||z��}|�||z}|�"|dks|t|z
zd|z
z|z|krn>|
|z
}
t�|
��}|dks|�|d|z
z|z|krd}n|}��m||dz||fS)	a^Solve the collocation system.

    Parameters
    ----------
    fun : callable
        Right-hand side of the system.
    t : float
        Current time.
    y : ndarray, shape (n,)
        Current state.
    h : float
        Step to try.
    Z0 : ndarray, shape (3, n)
        Initial guess for the solution. It determines new values of `y` at
        ``t + h * C`` as ``y + Z0``, where ``C`` is the Radau method constants.
    scale : ndarray, shape (n)
        Problem tolerance scale, i.e. ``rtol * abs(y) + atol``.
    tol : float
        Tolerance to which solve the system. This value is compared with
        the normalized by `scale` error.
    LU_real, LU_complex
        LU decompositions of the system Jacobians.
    solve_lu : callable
        Callable which solves a linear system given a LU decomposition. The
        signature is ``solve_lu(LU, b)``.

    Returns
    -------
    converged : bool
        Whether iterations converged.
    n_iter : int
        Number of completed iterations.
    Z : ndarray, shape (3, n)
        Found solution.
    rate : float
        The rate of convergence.
    rrNFr
rrT)�shape�MU_REAL�
MU_COMPLEX�TI�dot�np�empty�C�
empty_like�range�NEWTON_MAXITER�all�isfinite�T�TI_REAL�
TI_COMPLEX�real�imagr)�fun�t�y�h�Z0�scale�tol�LU_real�
LU_complex�solve_lu�n�M_real�	M_complex�W�Z�F�ch�dW_norm_old�dW�	converged�rate�k�i�f_real�	f_complex�dW_real�
dW_complex�dW_norms                            �</usr/lib/python3/dist-packages/scipy/integrate/_ivp/radau.py�solve_collocation_systemrP0s+��N	
���
�A�
�q�[�F��Q��I�
���r�
�
�A�
�A�
��!�Q����A�	
�Q��B��K�	��q�	�	�B��I��D�
�>�
"�
"�!�!���q���	,�	,�A��3�q�2�a�5�y�!�a��d�(�+�+�A�a�D�D��v�b�k�!�n�n�%�%�	��E������!�!�F�Q�q�T�M�1���C�G�G�J�'�'�)�q��t�b�1�Q�4�i�7G�*H�H�	��(�7�F�+�+���X�j�)�4�4�
���1�����1�����1���r�E�z�"�"���"��[�(�D���$�!�)�)���!�+�,��D��9�G�C�c�I�I��E�	�R���
�E�E�!�H�H���q�L�L�� �T�Q��X�%6��%@�3�%F�%F��I��E�����a�!�e�Q��$�$�c���|�|�|dkrd}n||z||zdzz}tjd���5td|��|dzz}ddd��n#1swxYwY|S)a9Predict by which factor to increase/decrease the step size.

    The algorithm is described in [1]_.

    Parameters
    ----------
    h_abs, h_abs_old : float
        Current and previous values of the step size, `h_abs_old` can be None
        (see Notes).
    error_norm, error_norm_old : float
        Current and previous values of the error norm, `error_norm_old` can
        be None (see Notes).

    Returns
    -------
    factor : float
        Predicted factor.

    Notes
    -----
    If `h_abs_old` and `error_norm_old` are both not None then a two-step
    algorithm is used, otherwise a one-step algorithm is used.

    References
    ----------
    .. [1] E. Hairer, S. P. Norsett G. Wanner, "Solving Ordinary Differential
           Equations II: Stiff and Differential-Algebraic Problems", Sec. IV.8.
    Nrr
g�?�ignore)�dividegп)r&�errstate�min)�h_abs�	h_abs_old�
error_norm�error_norm_old�
multiplier�factors      rO�predict_factorr]�s���:���!2�j�A�o�o��
�
��Y�&�.�:�*E�$�)N�N�
�	��H�	%�	%�	%�:�:��Q�
�#�#�j�E�&9�9��:�:�:�:�:�:�:�:�:�:�:����:�:�:�:��Ms�A�A�Ac�T��eZdZdZejddddddf�fd�	Zd�Zd�Zd	�Z	d
�Z
�xZS)�RadauaZImplicit Runge-Kutta method of Radau IIA family of order 5.

    The implementation follows [1]_. The error is controlled with a
    third-order accurate embedded formula. A cubic polynomial which satisfies
    the collocation conditions is used for the dense output.

    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). The
        vectorized implementation allows a faster approximation of the Jacobian
        by finite differences (required for this solver).
    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)``. HHere `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`.
    jac : {None, array_like, sparse_matrix, callable}, optional
        Jacobian matrix of the right-hand side of the system with respect to
        y, required by this method. The Jacobian matrix has shape (n, n) and
        its element (i, j) is equal to ``d f_i / d y_j``.
        There are three ways to define the Jacobian:

            * If array_like or sparse_matrix, the Jacobian is assumed to
              be constant.
            * If callable, the Jacobian is assumed to depend on both
              t and y; it will be called as ``jac(t, y)`` as necessary.
              For the 'Radau' and 'BDF' methods, the return value might be a
              sparse matrix.
            * If None (default), the Jacobian will be approximated by
              finite differences.

        It is generally recommended to provide the Jacobian rather than
        relying on a finite-difference approximation.
    jac_sparsity : {None, array_like, sparse matrix}, optional
        Defines a sparsity structure of the Jacobian matrix for a
        finite-difference approximation. Its shape must be (n, n). This argument
        is ignored if `jac` is not `None`. If the Jacobian has only few non-zero
        elements in *each* row, providing the sparsity structure will greatly
        speed up the computations [2]_. A zero entry means that a corresponding
        element in the Jacobian is always zero. If None (default), the Jacobian
        is assumed to be dense.
    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 of evaluations of the right-hand side.
    njev : int
        Number of evaluations of the Jacobian.
    nlu : int
        Number of LU decompositions.

    References
    ----------
    .. [1] E. Hairer, G. Wanner, "Solving Ordinary Differential Equations II:
           Stiff and Differential-Algebraic Problems", Sec. IV.8.
    .. [2] A. Curtis, M. J. D. Powell, and J. Reid, "On the estimation of
           sparse Jacobian matrices", Journal of the Institute of Mathematics
           and its Applications, 13, pp. 117-120, 1974.
    ���MbP?g���ư>NFc
�����t|��t���|||||
��d�_t	|���_t
||�j��\�_�_	��
�j�j���_
|�?t�j
�j�j�j
�jd�j�j	���_nt#|||���_d�_d�_t)dt*z|zt-d|dz�����_d�_d�_��||	��\�_�_t;�j��r�fd�}
d�}t=�jd���}n!�fd	�}
d
�}t?j �j��}|
�_!|�_"|�_#d�_$d�_%d�_&d�_'dS)Nrrg���Q��?��?c�B���xjdz
c_t|��S�Nr
)�nlur��A�selfs �rO�luzRadau.__init__.<locals>.lu8s������A�
����A�w�w�rQc�,�|�|��S�N)�solve��LU�bs  rOr<z Radau.__init__.<locals>.solve_lu<s���x�x��{�{�"rQ�csc)�formatc�F���xjdz
c_t|d���S)Nr
T)�overwrite_a)rerrfs �rOrizRadau.__init__.<locals>.luAs%������A�
��� ���5�5�5�5rQc�&�t||d���S)NT)�overwrite_b)rrms  rOr<z Radau.__init__.<locals>.solve_luEs����A�4�8�8�8�8rQT)(r�super�__init__�y_oldr�max_steprr=�rtol�atolr3r4r5�fr
�	directionrWrrXrZ�maxrrV�
newton_tol�sol�
jac_factor�
_validate_jac�jac�Jrrr&�identityrir<�I�current_jacr:r;rA)rhr3�t0�y0�t_boundryrzr{r��jac_sparsity�
vectorized�
first_step�
extraneousrir<r��	__class__s`               �rOrwzRadau.__init__s�����	�
�#�#�#�
������b�"�g�z�:�:�:���
�)�(�3�3��
�+�D�$���?�?���	�4�9����$�&�$�&�)�)�����,���$�&�$�&�$�&�$�.��4�9�d�i�)�)�D�J�J�-�Z��W�E�E�D�J����"����b�3�h��o�s�4����/E�/E�F�F����������-�-�c�<�@�@����$�&��D�F���	$�
�
�
�
�
�
#�
#�
#��D�F�5�)�)�)�A�A�
6�
6�
6�
6�
6�
9�
9�
9���D�F�#�#�A���� ��
�����������������rQc�D�����j}�j}��M��1t���rt����t	���}�|f���fd�}|||�j��}�n=t
���r��||��}d�_t|��rt|��}d��fd�	}n"tj	|t���}d��fd�	}|j�j�jfkr4td��j�jf|j�����n�t���rt���}ntj	�t���}|j�j�jfkr4td��j�jf|j�����d}||fS)Nc	����xjdz
c_t�j|||�j�j���\}�_|Srd)�njevr�fun_vectorizedr{r�)r4r5r|r�rh�sparsitys    ��rO�jac_wrappedz(Radau._validate_jac.<locals>.jac_wrapped^sF����	�	�Q��	�	�%,�T�-@�!�Q��-1�Y���-5�&7�&7�"��4�?��rQr
c�d���xjdz
c_t�||��t���S�Nr
��dtype)r�r�float�r4r5�_r�rhs   ��rOr�z(Radau._validate_jac.<locals>.jac_wrappedks/����I�I��N�I�I�%�c�c�!�Q�i�i�u�=�=�=�=rQr�c�n���xjdz
c_tj�||��t���Sr�)r�r&�asarrayr�r�s   ��rOr�z(Radau._validate_jac.<locals>.jac_wrappedrs1����I�I��N�I�I��:�c�c�!�Q�i�i�u�=�=�=�=rQz8`jac` is expected to have shape {}, but actually has {}.rk)r4r5rrr	r|�callabler�r&r�r�r!r=�
ValueErrorrq)rhr�r�r�r��groupsr�r�s```     rOr�zRadau._validate_jacSs�����
�V��
�V���;��#��H�%�%�4�)�(�3�3�H�&�x�0�0��$�f�-��
�
�
�
�
�
���B��D�F�+�+�A�A�
�c�]�]�	���B����A��D�I���{�{�
>��q�M�M��>�>�>�>�>�>�>�>�
�J�q��.�.�.��>�>�>�>�>�>�>��w�4�6�4�6�*�*�*� �"4�"(�&�$�&�$�&�)9�1�7�"C�"C�E�E�E�+�
��}�}�
1��s�O�O����J�s�%�0�0�0���w�4�6�4�6�*�*�*� �"4�"(�&�$�&�$�&�)9�1�7�"C�"C�E�E�E��K��A�~�rQc���|j}|j}|j}|j}|j}|j}dt
jt
j||j	tj
z��|z
��z}|j|kr|}d}	d}
n'|j|kr|}d}	d}
n|j}|j}	|j
}
|j}|j}|j}
|j}|j}d}d}d}|�s�||kr	d|jfS||j	z}||z}|j	||jz
zdkr|j}||z
}t
j|��}|j�"t
jd|jdf��}n(|�||t0zz��j|z
}|t
j|��|zz}d}|s�|�|
�P|�t6|z|jz|z
��}|�t:|z|jz|z
��}
t=|j||||||j ||
|j!�
�
\}}}}|s |rn|�|||��}d}d}d}
|��|s|dz}d}d}
��w||dz}|j�"tF��|z}|�!|||z��}|t
j$t
j|��t
j|����|zz}tK||z��}dd	tLzd
zzd	tLz|zz}|rH|d
krB|�!||�|||z��|z��}tK||z��}|d
kr4tO||	||
��} |tQtR|| z��z}d}d}
d}nd}|���|duo|d	ko|dk}!tO||	||
��} tUtV|| z��} |!s	| dkrd
} nd}d}
|�||��}"|!r||||"��}d}n|�d}|j|_||_
|| z|_||_,||_||_|"|_||_-||_|
|_||_||_||_.|�/��|_||fS)
NrFrrTrbrg�������?rr
r`g333333�?)0r4r5r|ryr{rzr&�abs�	nextafterr}�infrWrXrZr�r:r;r�r��TOO_SMALL_STEPr�r��zerosr!r(r.rir"r�r#rPr3rr<r%�E�maximumrr+r]r~�
MIN_FACTORrV�
MAX_FACTORrxrA�t_old�_compute_dense_output)#rhr4r5r|ryr{rz�min_steprWrXrZr�r:r;r�r��rejected�
step_accepted�messager6�t_newr7r8rF�n_iterrArG�y_new�ZE�errorrY�safetyr\�
recompute_jac�f_news#                                   rO�
_step_implzRadau._step_impl�s���F���F���F���=���y���y�����r�|�A�t�~���/F�G�G�!�K�L�L�L���:�� � ��E��I�!�N�N�
�Z�(�
"�
"��E��I�!�N�N��J�E���I�!�0�N��F���,���_�
��&���h�����
����B	%��x����d�1�1�1����&�A���E�E��~����!5�6��:�:������	�A��F�1�I�I�E��x���X�q�!�'�!�*�o�.�.����X�X�a�!�a�%�i�(�(�*�Q�.���2�6�!�9�9�t�+�+�E��I��
&��?�j�&8�"�g�g�g��k�D�F�&:�Q�&>�?�?�G�!%����a��$�&�)@�1�)D�!E�!E�J�-E��H�a��A�r�5�$�/��Z���.8�.8�*�	�6�1�d�!�&�"�������A�q�)�)�A�"&�K�"�G�!%�J�! �
&�$�
�������!�
����"��I�E��������a��B��M�M�'�1�r�6�2�2�E��2�:�b�f�Q�i�i������?�?�$�F�F�E��e�e�m�,�,�J��A��.��2�3�q�>�7I�9?�8@�A�F��
1�J��N�N��
�
�g�t�x�x��1�u�9�/E�/E��/J�K�K��!�%�%�-�0�0�
��A�~�~�'��y�(2�N�D�D����Z��&��9�9�9����!�
���� $�
�E �B	%�H�4��F�F�Q�J�F�4�$�;�
���y�*�n�M�M���Z��&��1�1���	��#����F�F��G��J������&�&���	 ���E�5�%�(�(�A��K�K�
�_��K�����(����V�^��
���
����������������$���&��������
��-�-�/�/����g�%�%rQc��tj|jjt��}t|j|j|j|��Srk)	r&r%rAr.�P�RadauDenseOutputr�r4rx)rh�Qs  rOr�zRadau._compute_dense_outputs1���F�4�6�8�Q������
�D�F�D�J��B�B�BrQc��|jSrk)r�)rhs rO�_dense_output_implzRadau._dense_output_impls	���x�rQ)�__name__�
__module__�__qualname__�__doc__r&r�rwr�r�r�r��
__classcell__�r�s@rOr_r_�s��������i�i�T79�f���4�d�!�d�3�3�3�3�3�3�j3�3�3�jL&�L&�L&�\C�C�C�������rQr_c�$��eZdZ�fd�Zd�Z�xZS)r�c���t���||��||z
|_||_|jddz
|_||_dSrd)rvrwr6r�r!�orderrx)rhr�r4rxr�r�s     �rOrwzRadauDenseOutput.__init__sK���
�������"�"�"��U��������W�Q�Z�!�^��
���
�
�
rQc��||jz
|jz}|jdkr2tj||jdz��}tj|��}n5tj||jdzdf��}tj|d���}tj|j|��}|jdkr||j	dd�dfz
}n
||j	z
}|S)Nrr
)�axisr)
r�r6�ndimr&�tiler��cumprodr%r�rx)rhr4�x�pr5s     rO�
_call_implzRadauDenseOutput._call_impl&s���
���^�t�v�%���6�Q�;�;����4�:��>�*�*�A��
�1�
�
�A�A����D�J��N�A�.�/�/�A��
�1�1�%�%�%�A��F�4�6�1�����6�Q�;�;�
���A�A�A�t�G�$�$�A�A�
���O�A��rQ)r�r�r�rwr�r�r�s@rOr�r�sG������������������rQr�)+�numpyr&�scipy.linalgrr�scipy.sparserrr�scipy.sparse.linalgr�scipy.optimize._numdiffr	�commonrrr
rrrrr�baserr�S6�arrayr(r�r"r#r.r$r/r0r�r+r�r�rPr]r_r��rQrO�<module>r�s�������,�,�,�,�,�,�,�,�2�2�2�2�2�2�2�2�2�2�$�$�$�$�$�$�1�1�1�1�1�1�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�)�(�(�(�(�(�(�(�
��
�B�H�q�2�v��m�a�"�f��]�A�
.�/�/���B�H�c�A��F�l�C�!�b�&�L�"�
-�.�.��2��*��5�
�
�B�H�D�D�D�D�D�D�
�I�I������R�X�C�C�C�E�E�E�D�D�D�F�G�G��

�Q�%��
��U�R�"�Q�%�Z�
�
�
�B�H�	�A�b�D��F�]�E�B�r�E�!�G�O�T�A��F�]�3�	�A�b�D��F�]�E�B�r�E�!�G�O�T�A��F�]�3����������
�
�
�
�X%�X%�X%�v%�%�%�Ph�h�h�h�h�I�h�h�h�V�����{�����rQ

Youez - 2016 - github.com/yon3zu
LinuXploit