হারমাইট বহুপদীর একটি ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করতে, পাইথন নম্পিতে chebyshev.hermvander() ব্যবহার করুন। পদ্ধতিটি সিউডো-ভ্যান্ডেরমন্ড ম্যাট্রিক্স প্রদান করে। রিটার্নডম্যাট্রিক্সের আকৃতি হল x.shape + (deg + 1,), যেখানে শেষ সূচকটি সংশ্লিষ্ট হারমাইটপলিনোমিয়ালের ডিগ্রি। dtype রূপান্তরিত x এর মতই হবে।
প্যারামিটার, x পয়েন্টের একটি অ্যারে প্রদান করে। কোন উপাদান জটিল কিনা তার উপর নির্ভর করে dtype float64 বা complex128-এ রূপান্তরিত হয়। যদি x স্কেলার হয় তবে এটি একটি 1-D অ্যারেতে রূপান্তরিত হয়৷ প্যারামিটার, deg হল ফলাফলের ম্যাট্রিক্সের ডিগ্রি৷
পদক্ষেপ
প্রথমে, প্রয়োজনীয় লাইব্রেরি আমদানি করুন -
import numpy as np from numpy.polynomial import hermite as H
একটি অ্যারে তৈরি করুন -
x = np.array([-2.+2.j, -1.+2.j, 0.+2.j, 1.+2.j, 2.+2.j])
অ্যারে প্রদর্শন করুন −
print("Our Array...\n",x) মাত্রা পরীক্ষা করুন −
print("\nDimensions of our Array...\n",x.ndim) ডেটাটাইপ −
পানprint("\nDatatype of our Array object...\n",x.dtype) আকৃতি −
পানprint("\nShape of our Array object...\n",x.shape) হারমাইট বহুপদীর একটি Vandermonde ম্যাট্রিক্স তৈরি করতে, ব্যবহার করুন chebyshev.hermvander() −
print("\nResult...\n",H.hermvander(x, 2)) উদাহরণ
import numpy as np
from numpy.polynomial import hermite as H
# Create an array
x = np.array([-2.+2.j, -1.+2.j, 0.+2.j, 1.+2.j, 2.+2.j])
# Display the array
print("Our Array...\n",x)
# Check the Dimensions
print("\nDimensions of our Array...\n",x.ndim)
# Get the Datatype
print("\nDatatype of our Array object...\n",x.dtype)
# Get the Shape
print("\nShape of our Array object...\n",x.shape)
# To generate a Vandermonde matrix of the Hermite polynomial, use the chebyshev.hermvander() in Python Numpy
print("\nResult...\n",H.hermvander(x, 2)) আউটপুট
Our Array... [-2.+2.j -1.+2.j 0.+2.j 1.+2.j 2.+2.j] Dimensions of our Array... 1 Datatype of our Array object... complex128 Shape of our Array object... (5,) Result... [[ 1. +0.j -4. +4.j -2.-32.j] [ 1. +0.j -2. +4.j -14.-16.j] [ 1. +0.j 0. +4.j -18. +0.j] [ 1. +0.j 2. +4.j -14.+16.j] [ 1. +0.j 4. +4.j -2.+32.j]]