ในการผสานชุด Chebyshev ให้ใช้เมธอด chebyshev.chebint() ใน Python ส่งกลับค่าสัมประสิทธิ์อนุกรม Chebyshev c รวม m ครั้งจาก lbnd ตามแกน ในการวนซ้ำแต่ละครั้ง อนุกรมผลลัพธ์จะถูกคูณด้วย scl และค่าคงที่การรวม k ถูกเพิ่มเข้าไป พารามิเตอร์ที่ 1 c isan array ของสัมประสิทธิ์อนุกรม Chebyshev หาก c มีหลายมิติ แกนที่ต่างกันจะสัมพันธ์กับตัวแปรต่างๆ โดยมีระดับในแต่ละแกนที่กำหนดโดยดัชนีที่เกี่ยวข้อง
พารามิเตอร์ตัวที่ 2 m คือลำดับการรวม ต้องเป็นค่าบวก (ค่าเริ่มต้น:1). พารามิเตอร์ที่ 3 kis ค่าคงที่การรวม ค่าของอินทิกรัลแรกที่เป็นศูนย์คือค่าแรกในรายการ ค่าของอินทิกรัลที่สองที่ศูนย์คือค่าที่สอง เป็นต้น หาก k ==[] (ค่าเริ่มต้น) ค่าคงที่ทั้งหมดจะถูกตั้งค่าเป็นศูนย์ ถ้า m ==1 สามารถให้สเกลาร์เดี่ยวแทนรายการได้ พารามิเตอร์ตัวที่ 4 lbnd คือขอบล่างของอินทิกรัล (ค่าเริ่มต้น:0) พารามิเตอร์ที่ 5, scl. หลังจากการรวมกันแต่ละครั้ง ผลที่ได้จะถูกคูณด้วย scl ก่อนที่จะเพิ่มค่าคงที่การรวม (ค่าเริ่มต้น:1). พารามิเตอร์ที่ 6,แกนคือแกนที่ใช้อินทิกรัล (ค่าเริ่มต้น:0).
ขั้นตอน
ขั้นแรก นำเข้าไลบรารีที่จำเป็น -
import numpy as np from numpy.polynomial import chebyshev as C
สร้างอาร์เรย์หลายมิติของสัมประสิทธิ์อนุกรม Chebyshev -
c = np.arange(4).reshape(2,2)
แสดงอาร์เรย์สัมประสิทธิ์ -
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 ให้ใช้วิธี chebyshev.chebint() ใน Python -
print("\nResult...\n",C.chebint(c, axis = 1)) ตัวอย่าง
import numpy as np
from numpy.polynomial import chebyshev as C
# Create an multidimensional array of Chebyshev series coefficients
c = np.arange(4).reshape(2,2)
# Display the coefficient array
print("Our coefficient Array...\n",c)
# Check the Dimensions
print("\nDimensions of our Array...\n",c.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n",c.dtype)
# Get the Shape
print("\nShape of our Array object...\n",c.shape)
# To Integrate a Chebyshev series, use the chebyshev.chebint() method in Python
print("\nResult...\n",C.chebint(c, axis = 1)) ผลลัพธ์
Our coefficient Array... [[0 1] [2 3]] Dimensions of our Array... 2 Datatype of our Array object... int64 Shape of our Array object... (2, 2) Result... [[0.25 0. 0.25] [0.75 2. 0.75]]