Hermite_e 다항식과 x, y, z 샘플 포인트의 의사 Vandermonde 행렬을 생성하려면 Python Numpy에서 hermite_e.hermevander3d()를 사용합니다. 이 메서드는 pseudoVandermondematrix를 반환합니다. 매개변수 x, y, z는 모두 같은 모양의 점 좌표 배열입니다. dtypes는 요소가 복잡한지 여부에 따라 float64 또는 complex128로 변환됩니다. 스칼라는 1차원 배열로 변환됩니다. 매개변수 deg는 [x_deg, y_deg, z_deg] 형식의 최대 각도 목록입니다.
단계
먼저 필요한 라이브러리를 가져옵니다 -
import numpy as np from numpy.polynomial import hermite_e as H
numpy.array() 메서드를 사용하여 동일한 모양의 점 좌표 배열을 만듭니다. -
x = np.array([1.5, 2.3]) y = np.array([3.7, 4.4]) z = np.array([5.3, 6.6])
배열 표시 -
print("Array1...\n",x) print("\nArray2...\n",y) print("\nArray3...\n",z)
데이터 유형 표시 -
print("\nArray1 datatype...\n",x.dtype) print("\nArray2 datatype...\n",y.dtype) print("\nArray3 datatype...\n",z.dtype)
두 어레이의 차원을 확인하십시오 -
print("\nDimensions of Array1...\n",x.ndim) print("\nDimensions of Array2...\n",y.ndim) print("\nDimensions of Array3...\n",z.ndim)
두 배열의 모양을 확인하십시오 -
print("\nShape of Array1...\n",x.shape) print("\nShape of Array2...\n",y.shape) print("\nShape of Array3...\n",z.shape)
Hermite_e 다항식과 x, y, z 샘플 포인트의 의사 Vandermonde 행렬을 생성하려면 Python에서 hermite_e.hermevander3d()를 사용하십시오 -
x_deg, y_deg, z_deg = 2, 3, 4 print("\nResult...\n",H.hermevander3d(x,y,z, [x_deg, y_deg, z_deg]))
예시
import numpy as np from numpy.polynomial import hermite_e as H # Create arrays of point coordinates, all of the same shape using the numpy.array() method x = np.array([1.5, 2.3]) y = np.array([3.7, 4.4]) z = np.array([5.3, 6.6]) # Display the arrays print("Array1...\n",x) print("\nArray2...\n",y) print("\nArray3...\n",z) # Display the datatype print("\nArray1 datatype...\n",x.dtype) print("\nArray2 datatype...\n",y.dtype) print("\nArray3 datatype...\n",z.dtype) # Check the Dimensions of both the arrays print("\nDimensions of Array1...\n",x.ndim) print("\nDimensions of Array2...\n",y.ndim) print("\nDimensions of Array3...\n",z.ndim) # Check the Shape of both the arrays print("\nShape of Array1...\n",x.shape) print("\nShape of Array2...\n",y.shape) print("\nShape of Array3...\n",z.shape) # To generate a pseudo Vandermonde matrix of the Hermite_e polynomial and x, y, z sample points, use the hermite_e.hermevander3d() in Python Numpy x_deg, y_deg, z_deg = 2, 3, 4 print("\nResult...\n",H.hermevander3d(x,y,z, [x_deg, y_deg, z_deg]))
출력
Array1... [1.5 2.3] Array2... [3.7 4.4] Array3... [5.3 6.6] Array1 datatype... float64 Array2 datatype... float64 Array3 datatype... float64 Dimensions of Array1... 1 Dimensions of Array2... 1 Dimensions of Array3... 1 Shape of Array1... (2,) Shape of Array2... (2,) Shape of Array3... (2,) Result... [[1.00000000e+00 5.30000000e+00 2.70900000e+01 1.32977000e+02 6.23508100e+02 3.70000000e+00 1.96100000e+01 1.00233000e+02 4.92014900e+02 2.30697997e+03 1.26900000e+01 6.72570000e+01 3.43772100e+02 1.68747813e+03 7.91231779e+03 3.95530000e+01 2.09630900e+02 1.07149077e+03 5.25963928e+03 2.46616159e+04 1.50000000e+00 7.95000000e+00 4.06350000e+01 1.99465500e+02 9.35262150e+02 5.55000000e+00 2.94150000e+01 1.50349500e+02 7.38022350e+02 3.46046996e+03 1.90350000e+01 1.00885500e+02 5.15658150e+02 2.53121720e+03 1.18684767e+04 5.93295000e+01 3.14446350e+02 1.60723616e+03 7.88945892e+03 3.69924238e+04 1.25000000e+00 6.62500000e+00 3.38625000e+01 1.66221250e+02 7.79385125e+02 4.62500000e+00 2.45125000e+01 1.25291250e+02 6.15018625e+02 2.88372496e+03 1.58625000e+01 8.40712500e+01 4.29715125e+02 2.10934766e+03 9.89039724e+03 4.94412500e+01 2.62038625e+02 1.33936346e+03 6.57454910e+03 3.08270198e+04] [1.00000000e+00 6.60000000e+00 4.25600000e+01 2.67696000e+02 1.63911360e+03 4.40000000e+00 2.90400000e+01 1.87264000e+02 1.17786240e+03 7.21209984e+03 1.83600000e+01 1.21176000e+02 7.81401600e+02 4.91489856e+03 3.00941257e+04 7.19840000e+01 4.75094400e+02 3.06363904e+03 1.92698289e+04 1.17989953e+05 2.30000000e+00 1.51800000e+01 9.78880000e+01 6.15700800e+02 3.76996128e+03 1.01200000e+01 6.67920000e+01 4.30707200e+02 2.70908352e+03 1.65878296e+04 4.22280000e+01 2.78704800e+02 1.79722368e+03 1.13042667e+04 6.92164891e+04 1.65563200e+02 1.09271712e+03 7.04636979e+03 4.43206064e+04 2.71376893e+05 4.29000000e+00 2.83140000e+01 1.82582400e+02 1.14841584e+03 7.03179734e+03 1.88760000e+01 1.24581600e+02 8.03362560e+02 5.05302970e+03 3.09399083e+04 7.87644000e+01 5.19845040e+02 3.35221286e+03 2.10849148e+04 1.29103799e+05 3.08811360e+02 2.03815498e+03 1.31430115e+04 8.26675658e+04 5.06176900e+05]]