np.legvander3d()
方法用于返回度数为V的Vandermonde矩阵以及样本点x,y和z。
用法:np.legvander3d(x, y, z, deg)
参数:
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.
返回:返回范德蒙德矩阵。
范例1:
在这个例子中,我们可以通过使用np.legvander3d()
方法,我们能够使用此方法获得pseudo-vandermonde矩阵。
# import numpy
import numpy as np
import numpy.polynomial.legendre as geek
# using np.legvander3d() method
ans = geek.legvander3d((1, 3, 5), (2, 4, 6), (1, 2, 3), [2, 2, 2])
print(ans)
输出:
[[ 1.00000000e+00 1.00000000e+00 1.00000000e+00 2.00000000e+00
2.00000000e+00 2.00000000e+00 5.50000000e+00 5.50000000e+00
5.50000000e+00 1.00000000e+00 1.00000000e+00 1.00000000e+00
2.00000000e+00 2.00000000e+00 2.00000000e+00 5.50000000e+00
5.50000000e+00 5.50000000e+00 1.00000000e+00 1.00000000e+00
1.00000000e+00 2.00000000e+00 2.00000000e+00 2.00000000e+00
5.50000000e+00 5.50000000e+00 5.50000000e+00]
[ 1.00000000e+00 2.00000000e+00 5.50000000e+00 4.00000000e+00
8.00000000e+00 2.20000000e+01 2.35000000e+01 4.70000000e+01
1.29250000e+02 3.00000000e+00 6.00000000e+00 1.65000000e+01
1.20000000e+01 2.40000000e+01 6.60000000e+01 7.05000000e+01
1.41000000e+02 3.87750000e+02 1.30000000e+01 2.60000000e+01
7.15000000e+01 5.20000000e+01 1.04000000e+02 2.86000000e+02
3.05500000e+02 6.11000000e+02 1.68025000e+03]
[ 1.00000000e+00 3.00000000e+00 1.30000000e+01 6.00000000e+00
1.80000000e+01 7.80000000e+01 5.35000000e+01 1.60500000e+02
6.95500000e+02 5.00000000e+00 1.50000000e+01 6.50000000e+01
3.00000000e+01 9.00000000e+01 3.90000000e+02 2.67500000e+02
8.02500000e+02 3.47750000e+03 3.70000000e+01 1.11000000e+02
4.81000000e+02 2.22000000e+02 6.66000000e+02 2.88600000e+03
1.97950000e+03 5.93850000e+03 2.57335000e+04]]
范例2:
# import numpy
import numpy as np
import numpy.polynomial.legendre as geek
ans = geek.legvander3d((1, 2), (3, 4), (5, 6), [3, 3, 3])
print(ans)
输出:
[[ 1.00000000e+00 5.00000000e+00 3.70000000e+01 3.05000000e+02
3.00000000e+00 1.50000000e+01 1.11000000e+02 9.15000000e+02
1.30000000e+01 6.50000000e+01 4.81000000e+02 3.96500000e+03
6.30000000e+01 3.15000000e+02 2.33100000e+03 1.92150000e+04
1.00000000e+00 5.00000000e+00 3.70000000e+01 3.05000000e+02
3.00000000e+00 1.50000000e+01 1.11000000e+02 9.15000000e+02
1.30000000e+01 6.50000000e+01 4.81000000e+02 3.96500000e+03
6.30000000e+01 3.15000000e+02 2.33100000e+03 1.92150000e+04
1.00000000e+00 5.00000000e+00 3.70000000e+01 3.05000000e+02
3.00000000e+00 1.50000000e+01 1.11000000e+02 9.15000000e+02
1.30000000e+01 6.50000000e+01 4.81000000e+02 3.96500000e+03
6.30000000e+01 3.15000000e+02 2.33100000e+03 1.92150000e+04
1.00000000e+00 5.00000000e+00 3.70000000e+01 3.05000000e+02
3.00000000e+00 1.50000000e+01 1.11000000e+02 9.15000000e+02
1.30000000e+01 6.50000000e+01 4.81000000e+02 3.96500000e+03
6.30000000e+01 3.15000000e+02 2.33100000e+03 1.92150000e+04]
[ 1.00000000e+00 6.00000000e+00 5.35000000e+01 5.31000000e+02
4.00000000e+00 2.40000000e+01 2.14000000e+02 2.12400000e+03
2.35000000e+01 1.41000000e+02 1.25725000e+03 1.24785000e+04
1.54000000e+02 9.24000000e+02 8.23900000e+03 8.17740000e+04
2.00000000e+00 1.20000000e+01 1.07000000e+02 1.06200000e+03
8.00000000e+00 4.80000000e+01 4.28000000e+02 4.24800000e+03
4.70000000e+01 2.82000000e+02 2.51450000e+03 2.49570000e+04
3.08000000e+02 1.84800000e+03 1.64780000e+04 1.63548000e+05
5.50000000e+00 3.30000000e+01 2.94250000e+02 2.92050000e+03
2.20000000e+01 1.32000000e+02 1.17700000e+03 1.16820000e+04
1.29250000e+02 7.75500000e+02 6.91487500e+03 6.86317500e+04
8.47000000e+02 5.08200000e+03 4.53145000e+04 4.49757000e+05
1.70000000e+01 1.02000000e+02 9.09500000e+02 9.02700000e+03
6.80000000e+01 4.08000000e+02 3.63800000e+03 3.61080000e+04
3.99500000e+02 2.39700000e+03 2.13732500e+04 2.12134500e+05
2.61800000e+03 1.57080000e+04 1.40063000e+05 1.39015800e+06]]
相关用法
- Python Numpy np.fft()用法及代码示例
- Python numpy.ma.ids()用法及代码示例
- Python Numpy np.hermeroots()用法及代码示例
- Python Numpy np.lagvander()用法及代码示例
- Python Numpy np.lagadd()用法及代码示例
- Python Numpy np.lagdiv()用法及代码示例
- Python Numpy np.lagsub()用法及代码示例
- Python Numpy np.lagmul()用法及代码示例
- Python Numpy np.hermegrid2d()用法及代码示例
- Python Numpy np.lagone()用法及代码示例
- Python Numpy np.lagzero()用法及代码示例
- Python Numpy np.lagcompanion()用法及代码示例
- Python Numpy np.lag2poly()用法及代码示例
- Python Numpy np.hermegrid3d()用法及代码示例
- Python Numpy np.hermefromroots()用法及代码示例
注:本文由纯净天空筛选整理自jana_sayantan大神的英文原创作品 Python | Numpy np.legvander3d() method。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。