要将勒让德级数提高幂,请使用多项式。Python Numpy 中的方法。该方法返回提升到 power pow 的 Legendre 系列 c。参数 c 是从低到高排序的系数序列。即,[1,2,3] 是序列 P_0 + 2*P_1 + 3*P_2。将 Legendre 系列 c 返回到 power pow。参数 c 是从低到高排序的系数序列。即,[1,2,3] 是序列 P_0 + 2*P_1 + 3*P_2。legendre.legpow()
参数 c 是从低到高排序的勒让德级数系数的一维数组。参数 pow 是系列将被提升到的幂。参数 maxpower 是允许的最大功率。这主要是为了将系列的增长限制在无法控制的范围内。默认值为 16
脚步
首先,导入所需的库 -
import numpy as np fromnumpy.polynomialimport laguerre as L
创建拉盖尔级数系数的一维数组 -
c = np.array([1,2,3])
显示系数数组 -
print("Our coefficient Array...\n",c)
检查尺寸 -
print("\nDimensions of our Array...\n",c.ndim)
获取数据类型 -
print("\nDatatype of our Array object...\n",c.dtype)
获得形状 -
print("\nShape of our Array object...\n",c.shape)
要将勒让德级数提高幂,请使用多项式。Python Numpy 中的方法 -legendre.legpow()
print("\nResult....\n",L.legpow(c, 3))
示例
import numpy as np fromnumpy.polynomialimport legendre as L #创建拉盖尔级数系数的一维数组 c = np.array([1,2,3]) #显示系数数组 print("Our coefficient Array...\n",c) #检查尺寸 print("\nDimensions of our Array...\n",c.ndim) #获取数据类型 print("\nDatatype of our Array object...\n",c.dtype) #获取形状 print("\nShape of our Array object...\n",c.shape) #要提高勒让德级数,请使用 Python Numpy 中的 polynomial.legendre.legpow() 方法 #该方法返回提升到 power pow 的 Legendre 系列 c。参数 c 是从低到高排序的系数序列。即,[1,2,3] 是序列 P_0 + 2*P_1 + 3*P_2。 print("\nResult....\n",L.legpow(c, 3))输出结果
Our coefficient Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result.... [16.74285714 42.17142857 55.14285714 46.4 33.8025974 15.42857143 6.31168831]