| Server IP : 93.86.61.54 / Your IP : 216.73.216.206 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/sympy/integrals/__pycache__/ |
Upload File : |
o
�8VatB � @ s� d dl mZmZmZ d dlmZ d dlmZmZ d dl m
Z
d dlmZ d dl
mZmZmZmZ d dlmZ dd � Zd
d� Zdd
� Zdd� Zdd� Zdd� Zdd� Zdd� ZdS )� )�S�Dummy�pi)� factorial)�sin�cos)�sqrt)�gamma)�
legendre_poly�
laguerre_poly�hermite_poly�jacobi_poly)�RootOfc C s� t d�}t| |dd�}|�|�}g }g }|�� D ]1}t|t�r+|�tjd|d �}|� |�
|�� |� dd|d |�||�d �
|�� q||fS )a�
Computes the Gauss-Legendre quadrature [1]_ points and weights.
Explanation
===========
The Gauss-Legendre quadrature approximates the integral:
.. math::
\int_{-1}^1 f(x)\,dx \approx \sum_{i=1}^n w_i f(x_i)
The nodes `x_i` of an order `n` quadrature rule are the roots of `P_n`
and the weights `w_i` are given by:
.. math::
w_i = \frac{2}{\left(1-x_i^2\right) \left(P'_n(x_i)\right)^2}
Parameters
==========
n :
The order of quadrature.
n_digits :
Number of significant digits of the points and weights to return.
Returns
=======
(x, w) : the ``x`` and ``w`` are lists of points and weights as Floats.
The points `x_i` and weights `w_i` are returned as ``(x, w)``
tuple of lists.
Examples
========
>>> from sympy.integrals.quadrature import gauss_legendre
>>> x, w = gauss_legendre(3, 5)
>>> x
[-0.7746, 0, 0.7746]
>>> w
[0.55556, 0.88889, 0.55556]
>>> x, w = gauss_legendre(4, 5)
>>> x
[-0.86114, -0.33998, 0.33998, 0.86114]
>>> w
[0.34785, 0.65215, 0.65215, 0.34785]
See Also
========
gauss_laguerre, gauss_gen_laguerre, gauss_hermite, gauss_chebyshev_t, gauss_chebyshev_u, gauss_jacobi, gauss_lobatto
References
==========
.. [1] https://en.wikipedia.org/wiki/Gaussian_quadrature
.. [2] http://people.sc.fsu.edu/~jburkardt/cpp_src/legendre_rule/legendre_rule.html
�xT��polys�
� � )r r
�diff�
real_roots�
isinstancer �
eval_rationalr �One�append�n�subs�r �n_digitsr �p�pd�xi�w�r� r$ �</usr/lib/python3/dist-packages/sympy/integrals/quadrature.py�gauss_legendre s ;
.r&