Python | Numpy np.laggauss() method (original) (raw)
Last Updated : 29 Dec, 2019
**np.laggauss()**
Computes the sample points and weights for Gauss-Laguerre quadrature. These sample points and weights will correctly integrate polynomials of degree 2*deg - 1
or less over the interval [0, inf]
with the weight function f(x) = exp(-x)
Syntax :
np.laggauss(deg)
Parameters:
**deg :**[int] Number of sample points and weights. It must be >= 1.Return : 1.[ndarray] 1-D ndarray containing the sample points.
2.[ndarray] 1-D ndarray containing the weights.
Code #1 :
import
numpy as np
import
numpy.polynomial.laguerre as geek
degree
=
2
res
=
geek.laggauss(degree)
print
(res)
Output:
(array([ 0.58578644, 3.41421356]), array([ 0.85355339, 0.14644661]))
Code #2 :
import
numpy as np
import
numpy.polynomial.laguerre as geek
degree
=
3
res
=
geek.laggauss(degree)
print
(res)
Output:
(array([ 0.41577456, 2.29428036, 6.28994508]), array([ 0.71109301, 0.27851773, 0.01038926]))
Similar Reads
- Python | Numpy np.leggauss() method np.leggauss() Computes the sample points and weights for Gauss-legendre quadrature. These sample points and weights will correctly integrate polynomials of degree 2*deg - 1 or less over the interval [-1, 1] with the weight function f(x) = 1 Syntax : np.leggauss(deg) Parameters: deg :[int] Number of 1 min read
- Python | Numpy np.lagmul() method np.lagmul() method is used to multiply one Laguerre series to another.It returns the product of two Laguerre series c1 * c2. Syntax : np.lagmul(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Laguerre series coefficie 1 min read
- Python | Numpy np.lagsub() method np.lagub() method is used to subtract one Laguerre series to another.It returns the difference of two Laguerre series c1 - c2. Syntax : np.lagub(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Laguerre series coeffici 1 min read
- Python | Numpy np.lagadd() method np.lagadd() method is used to add one Laguerre series to another.It returns the sum of two Laguerre series c1 + c2. Syntax : np.lagadd(c1, c2) Parameters: c1, c2 :[ array_like ] 1-D arrays of Laguerre series coefficients ordered from low to high. Return : [ndarray] Array representing the Laguerre se 1 min read
- Python | Numpy np.lagval() method With the help of np.lagval() method, we can get the laguerre series at point x by using np.lagval() method. Syntax : np.lagval(x, c) Return : Return the laguerre series at point x. Example #1 : In this example we can see that by using np.lagval() method, we are able to get the laguerre series at poi 1 min read
- Python | Numpy np.hermgauss() method With the help of np.hermgauss() method, we can get the quadrature value of gaussian hermite by using np.hermgauss() method. Syntax : np.hermgauss(degree) Return : Return the quadrature of gaussian hermite. Example #1 : In this example we can see that by using np.hermgauss() method, we are able to ge 1 min read
- Python | Numpy np.lagmulx() method With the help of np.lagmulx() method, we can get the multiplication of Laguerre series with x by using np.lagmulx() method, where x is an independent variable. Syntax : np.lagmulx(series) Return : Return the coefficient of series after multiplication. Example #1 : In this example we can see that by 1 min read
- Python | Numpy np.hermegauss() method With the help of np.hermegauss() method, we can get the quadrature of gaussian hermiteE series by using np.hermegauss() method. Syntax : np.hermegauss(deg) Return : Return the quadrature of gaussian hermiteE series. Example #1 : In this example we can see that by using np.hermegauss() method, we are 1 min read
- Python | Numpy np.lagfit() method With the help of np.lagfit() method, we can get the least squares fit of laguerre series of a given data by using np.lagfit() method. Syntax : np.lagfit(x, y, deg) Return : Return the least squares fit of laguerre series to data. Example #1 : In this example we can see that by using np.lagfit() meth 1 min read
- Python | Numpy np.lagder() method np.lagroots() method is used to differentiate a Laguerre series. Syntax : np.lagder(c, m=1, scl=1, axis=0) Parameters: c :[array_like] 1-D arrays of Laguerre series coefficients ordered from low to high. m :[int, optional] Number of derivatives taken, must be non-negative.Default is 1. scl :[scalar, 1 min read