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

ประเมินอนุกรม Hermite_e 3 มิติ ที่ Cartesian product x,y,z สัมประสิทธิ์ 2D ใน Python

บทนำ

เมธอด hermite_e.hermegrid3d() ประเมินอนุกรม Hermite_e 3 มิติ ที่ผลคูณการ์ทีเซียนของ x, y, z ด้วยสัมประสิทธิ์ 2 มิติ

ตัวอย่าง: สัมประสิทธิ์ 2 มิติ (2,2)

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

c = np.arange(4).reshape(2, 2)
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.hermegrid3d([1, 2], [1, 2], [1, 2], c))

ผลลัพธ์

Our Array... [[0 1]
 [2 3]]
Dimensions of our Array... 2
Datatype of our Array object... int64
Shape of our Array object... (2, 2)
Result... [[17. 28.]
 [28. 46.]]

ผลลัพธ์เหมือนกับ Chebyshev และ Legendre 3D grid ด้วยสัมประสิทธิ์เดียวกัน เพราะจุดประเมิน [1,2] ให้ค่าเชิงตัวเลขเท่ากันสำหรับพหุนามออร์โธโกนอลต่างๆ ที่จุดเหล่านี้