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

ดิฟเฟอร่นเชียล Hermite_e Series และคูณแต่ละครั้งด้วย Scalar ใน Python

ในการหาอนุพันธ์ของ Hermite_e Series ใช้เมธอด hermite_e.hermeder() ใน Python พารามิเตอร์:

  • c: อาร์เรย์ Hermite_e Series Coefficients
  • m: จำนวนอนุพันธ์ที่ต้องการ ต้องไม่ติดลบ (Default: 1)
  • scl: Scalar คูณกับแต่ละครั้งของการหาอนุพันธ์ ผลรวมคือ scl**m ใช้สำหรับการเปลี่ยนตัวแปรเชิงเส้น (Default: 1)
  • axis: Axis ที่หาอนุพันธ์

ขั้นตอน

1. Import ไลบรารี:

import numpy as np 
from numpy.polynomial import hermite_e as H

2. สร้างอาร์เรย์สัมประสิทธิ์ ตรวจสอบ Dimensions Datatype Shape

3. หาอนุพันธ์ Hermite_e Series:

print("Result...\n", H.hermeder(c, scl = -1))

ตัวอย่างโค้ดเต็ม

import numpy as np 
from numpy.polynomial import hermite_e as H 
c = np.array([1,2,3,4]) 
print("Our 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) 
print("\nResult...\n", H.hermeder(c, scl = -1))

ผลลัพธ์

Our Array...   [1 2 3 4] 
Dimensions of our Array... 1 
Datatype of our Array object... int64 
Shape of our Array object... (4,) 
Result...   [ -2. -6. -12.]