Python | Numpy np.lagvander3d() method (original) (raw)
Last Updated : 31 Dec, 2019
**np.lagvander3d()**
method is used to returns the Vandermonde matrix of degree deg and sample points x, y and z.
Syntax :
np.lagvander3d(x, y, z, deg)
Parameters:
**x, y, z :**[ array_like ] Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are complex. If x is scalar it is converted to a 1-D array.
**deg :**[int] Degree of the resulting matrix.Return : Return the Vandermonde matrix.
Example #1 :
In this example we can see that by using np.lagvander3d()
method, we are able to get the pseudo-vandermonde matrix using this method.
import
numpy as np
import
numpy.polynomial.laguerre as geek
ans
=
geek.lagvander3d((
1
,
3
,
5
), (
2
,
4
,
6
), (
1
,
2
,
3
), [
2
,
2
,
2
])
print
(ans)
Output :
[[ 1. 0. -0.5 -1. -0. 0.5 -1. -0. 0.5 0. 0.
-0. -0. -0. 0. -0. -0. 0. -0.5 -0. 0.25
0.5 0. -0.25 0.5 0. -0.25]
[ 1. -1. -1. -3. 3. 3. 1. -1. -1. -2. 2.
2. 6. -6. -6. -2. 2. 2. -0.5 0.5 0.5
1.5 -1.5 -1.5 -0.5 0.5 0.5 ]
[ 1. -2. -0.5 -5. 10. 2.5 7. -14. -3.5 -4. 8.
2. 20. -40. -10. -28. 56. 14. 3.5 -7. -1.75
-17.5 35. 8.75 24.5 -49. -12.25]]
Example #2 :
import
numpy as np
import
numpy.polynomial.laguerre as geek
ans
=
geek.lagvander3d((
1
,
2
), (
3
,
4
), (
5
,
6
), [
3
,
3
,
3
])
print
(ans)
Output :
[[ 1. -4. 3.5 2.66666667 -2. 8.
-7. -5.33333333 -0.5 2. -1.75 -1.33333333
1. -4. 3.5 2.66666667 0. -0.
0. 0. -0. 0. -0. -0.
-0. 0. -0. -0. 0. -0.
0. 0. -0.5 2. -1.75 -1.33333333
1. -4. 3.5 2.66666667 0.25 -1.
0.875 0.66666667 -0.5 2. -1.75 -1.33333333
-0.66666667 2.66666667 -2.33333333 -1.77777778 1.33333333
-5.33333333 4.66666667 3.55555556 0.33333333 -1.33333333
1.16666667 0.88888889 -0.66666667 2.66666667 -2.33333333
-1.77777778]
[ 1. -5. 7. 1. -3. 15.
-21. -3. 1. -5. 7. 1.
2.33333333 -11.66666667 16.33333333 2.33333333 -1. 5.
-7. -1. 3. -15. 21. 3.
-1. 5. -7. -1. -2.33333333
11.66666667 -16.33333333 -2.33333333 -1. 5. -7.
-1. 3. -15. 21. 3. -1.
5. -7. -1. -2.33333333 11.66666667
-16.33333333 -2.33333333 -0.33333333 1.66666667 -2.33333333
-0.33333333 1. -5. 7. 1. -0.33333333
1.66666667 -2.33333333 -0.33333333 -0.77777778 3.88888889
-5.44444444 -0.77777778]]
Similar Reads
- Python | Numpy np.legvander3d() method np.legvander3d() method is used to returns the Vandermonde matrix of degree deg and sample points x, y and z. Syntax : np.legvander3d(x, y, z, deg) Parameters: x, y, z :[ array_like ] Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are comple 2 min read
- Python | Numpy np.lagvander() method With the help of np.lagvander() method, we can get the Pseudo-Vandermonde matrix from given array having degree which is passed as parameter by using np.lagvander() method. Syntax : np.lagvander(arr, degree) Parameters: arr :[ array_like ] Array of points. The dtype is converted to float64 or comple 2 min read
- Python | Numpy np.lagvander2d() method With the help of np.lagvander2d() method, we can get the Pseudo-Vandermonde matrix from given array having degree which is passed as parameter by using np.lagvander2d() method. Syntax : np.lagvander2d(x, y, deg) Parameters: x, y :[ array_like ] Array of points. The dtype is converted to float64 or c 2 min read
- Python | Numpy np.legvander() method np.legvander() method is used to returns the Vandermonde matrix of degree deg and sample points x. Syntax : np.legvander(x, deg) Parameters: x :[ array_like ] Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are complex. If x is scalar it is c 1 min read
- Python | Numpy np.legvander2d() method With the help of np.legvander2d() method, we can get the Pseudo-Vandermonde matrix from given array having degree which is passed as parameter by using np.legvander2d() method. Syntax : np.legvander2d(x, y, deg) Parameters: x, y :[ array_like ] Array of points. The dtype is converted to float64 or c 2 min read
- Python | Numpy np.lagval3d() method With the help of np.lagval3d() method, we can get the 3-D laguerre series at point x by using np.lagval3d() method. Syntax : np.lagval3d(x, y, z, c) Return : Return the 3-D laguerre series at point x, y and z. Example #1 : In this example we can see that by using np.lagval3d() method, we are able to 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
- 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.hermvander3d() method With the help of np.hermvander3d() method, we can get the 3-D pseudo vandermonde matrix from hermite series of given degree by using np.hermvander3d() method. Syntax : np.hermvander3d(x, y, z, deg) Return : Return the 3-D pseudo vandermonde matrix of given degree. Example #1 : In this example we can 2 min read
- Python | Numpy np.hermevander3d() method With the help of np.hermevander3d() method, we can get the pseudo vandermonde matrix of a given 3-D data having degrees x, y and z by using np.hermevander3d() method. Syntax : np.hermevander3d(x, y, z, [x_deg, y_deg, z_deg]) Return : Return the pseudo vandermonde matrix of given 3-D data. Example #1 2 min read