在 Python 中提升 Chebyshev 系列的能力

阅读 77 收藏 0 点赞 0 评论 0

要将切比雪夫级数提升到强大的水平,请使用Python Numpy 中的方法。将 Chebyshev 系列 c 返回到 power pow。参数 c 是从低到高排序的系数序列。即,[1,2,3] 是系列 T_0 + 2*T_1 + 3*T_2。该方法返回切比雪夫级数。chebyshev.chebpow()

参数 c 是从低到高排序的 Chebyshev 级数系数的一维数组。参数 power 是系列将被提升到的幂。参数 maxpower 是允许的最大功率。这主要是为了将系列的增长限制在无法控制的范围内。默认值为 16。

脚步

首先,导入所需的库 -

import numpy as np
fromnumpy.polynomialimport chebyshev as C

创建 Chebyshev 级数系数的一维数组 -

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 中的方法。将 Chebyshev 系列 c 返回到 power pow。参数 c 是从低到高排序的系数序列。即,[1,2,3] 是系列 T_0 + 2*T_1 + 3*T_2 -chebyshev.chebpow()

print("\nResult...\n",C.chebdiv(c,3))

示例

import numpy as np
fromnumpy.polynomialimport chebyshev as C

#创建 Chebyshev 级数系数的一维数组
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 中的 chebyshev.chebpow() 方法
print("\nResult...\n",C.chebdiv(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...
(array([0.33333333, 0.66666667, 1. ]), array([0.]))

评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号