要区分 Chebyshev 系列,请使用Python Numpy 中的方法。该方法返回导数的切比雪夫级数。返回沿轴微分 m 次的切比雪夫级数系数 c。在每次迭代中,结果乘以 scl。参数 c 是沿每个轴从低到高的系数数组,例如,[1,2,3] 表示序列 1*T_0 + 2*T_1 + 3*T_2 而 [[1,2],[1 ,2]] 表示 1*T_0(x)*T_0(y) + 1*T_1(x)*T_0(y) + 2*T_0(x)*T_1(y) + 2*T_1(x)*T_1( y) 如果axis=0 是x 并且axis=1 是y。polynomial.chebder()
第一个参数是 c,一个切比雪夫级数系数的数组。如果 c 是多维的,则不同的轴对应于不同的变量,每个轴的度数由相应的索引给出。第二个参数是 m,取导数,必须为非负数。(默认值:1)。第三个参数是scl,即每个微分乘以scl。最终结果是乘以 scl**m。这用于变量的线性变化。(默认值:1)。第 4 个参数是轴,即求导数的轴。(默认值:0)。
脚步
首先,导入所需的库 -
import numpy as np fromnumpy.polynomialimport chebyshev as C
创建一个切比雪夫级数系数数组 -
c = np.array([1,2,3,4])
显示系数数组 -
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)
要区分 Chebyshev 系列,请使用Python Numpy 中的方法。该方法返回导数的切比雪夫级数 -polynomial.chebder()
print("\nResult...\n",C.chebder(c, scl = -1))
示例
import numpy as np fromnumpy.polynomialimport chebyshev as C #创建切比雪夫级数系数数组 c = np.array([1,2,3,4]) #显示系数数组 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) #要区分 Chebyshev 系列,请使用 Python Numpy 中的 polynomial.chebder() 方法。 print("\nResult...\n",C.chebder(c, scl = -1))输出结果
Our coefficient Array... [1 2 3 4] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (4,) Result... [-14. -12. -24.]