Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

หาอนุพันธ์อนุกรม Chebyshev กำหนดจำนวนอนุพันธ์ใน Python

บทนำ

พารามิเตอร์ m ใน chebyshev.chebder() กำหนดจำนวนครั้งของการหาอนุพันธ์ (order of derivative)

ตัวอย่าง: m = 3 (อนุพันธ์ 3 ครั้ง)

import numpy as np
from numpy.polynomial import 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)

# อนุพันธ์ 3 ครั้ง
print("\nResult...\n", C.chebder(c, 3))

ผลลัพธ์

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... [96.]

อนุพันธ์ 3 ครั้งของพหุนามดีกรี 3 ให้ค่าคงที่เดียว [96.] เพราะอนุพันธ์ครั้งที่ 4 จะเป็นศูนย์