要集成 Chebyshev 系列,请使用Python 中的方法。返回沿轴从 lbnd 积分 m 次的 Chebyshev 级数系数 c。在每次迭代中,结果系列乘以 scl 并添加积分常数 k。第一个参数 c 是切比雪夫级数系数的数组。如果 c 是多维的,则不同的轴对应于不同的变量,每个轴的度数由相应的索引给出。chebyshev.chebint()
第二个参数 m 是积分阶,必须为正。(默认值:1)。第三个参数, k 是一个 Integration constant(s)。零处的第一个整数的值是列表中的第一个值,零处的第二个整数的值是第二个值,依此类推。如果 k == [](默认值),则所有常量都设置为零。如果 m == 1,则可以给出单个标量而不是列表。第 4 个参数 lbnd 是积分的下界。(默认值:0)。第 5 个参数,scl。在每次积分之后,在添加积分常数之前,结果会乘以 scl。(默认值:1)。第 6 个参数,axis 是进行积分的轴。(默认值:0)。
脚步
首先,导入所需的库 -
import numpy as np fromnumpy.polynomialimport chebyshev as C
创建一个切比雪夫级数系数数组 -
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)
要集成 Chebyshev 系列,请使用Python 中的方法 -chebyshev.chebint()
print("\nResult...\n",C.chebint(c, k = 3))
示例
import numpy as np fromnumpy.polynomialimport chebyshev as C #创建切比雪夫级数系数数组 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) #要集成 Chebyshev 系列,请在 Python 中使用 chebyshev.chebint() 方法 print("\nResult...\n",C.chebint(c, k = 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... [ 3.5 -0.5 0.5 0.5]