কম্পিউটার

পাইথনে Hermit_e বহুপদী এবং x, y, z নমুনা বিন্দুর একটি সিউডো ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করুন


Hermit_e বহুপদী এবং x, y, z নমুনা পয়েন্ট, পাইথন নম্পিতে hermite.hermevander3d() ব্যবহার করুন। পদ্ধতিটি সিউডো-ভ্যান্ডেরমন্ড ম্যাট্রিক্স প্রদান করে। প্যারামিটার, x, y, z হল বিন্দু স্থানাঙ্কের অ্যারে, সব একই আকৃতির। কোনো উপাদান জটিল কিনা তার উপর নির্ভর করে dtypes float64 বা complex128-এ রূপান্তরিত হবে। স্কেলারগুলি 1-ডি অ্যারেতে রূপান্তরিত হয়। প্যারামিটার, deg হল ফর্মের সর্বাধিক ডিগ্রির তালিকা [x_deg, y_deg, z_deg]।

পদক্ষেপ

প্রথমে, প্রয়োজনীয় লাইব্রেরি আমদানি করুন -

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

numpy.array() পদ্ধতি ব্যবহার করে একই আকৃতির বিন্দু স্থানাঙ্কের অ্যারে তৈরি করুন -

x = np.array([1, 2])
y = np.array([3, 4])
z = np.array([5, 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 ম্যাট্রিক্স তৈরি করতে, পাইথন নম্পিতে hermite.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, 2])
y = np.array([3, 4])
z = np.array([5, 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.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 2]

Array2...
   [3 4]

Array3...
   [5 6]

Array1 datatype...
int64

Array2 datatype...
int64

Array3 datatype...
int64

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.00000e+00 5.00000e+00 2.40000e+01 1.10000e+02 4.78000e+02 3.00000e+00
    1.50000e+01 7.20000e+01 3.30000e+02 1.43400e+03 8.00000e+00 4.00000e+01
    1.92000e+02 8.80000e+02 3.82400e+03 1.80000e+01 9.00000e+01 4.32000e+02
    1.98000e+03 8.60400e+03 1.00000e+00 5.00000e+00 2.40000e+01 1.10000e+02
    4.78000e+02 3.00000e+00 1.50000e+01 7.20000e+01 3.30000e+02 1.43400e+03
    8.00000e+00 4.00000e+01 1.92000e+02 8.80000e+02 3.82400e+03 1.80000e+01
    9.00000e+01 4.32000e+02 1.98000e+03 8.60400e+03 0.00000e+00 0.00000e+00
    0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00
    0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00
    0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00 0.00000e+00]
   [1.00000e+00 6.00000e+00 3.50000e+01 1.98000e+02 1.08300e+03 4.00000e+00
    2.40000e+01 1.40000e+02 7.92000e+02 4.33200e+03 1.50000e+01 9.00000e+01
    5.25000e+02 2.97000e+03 1.62450e+04 5.20000e+01 3.12000e+02 1.82000e+03
    1.02960e+04 5.63160e+04 2.00000e+00 1.20000e+01 7.00000e+01 3.96000e+02
    2.16600e+03 8.00000e+00 4.80000e+01 2.80000e+02 1.58400e+03 8.66400e+03
    3.00000e+01 1.80000e+02 1.05000e+03 5.94000e+03 3.24900e+04 1.04000e+02
    6.24000e+02 3.64000e+03 2.05920e+04 1.12632e+05 3.00000e+00 1.80000e+01
    1.05000e+02 5.94000e+02 3.24900e+03 1.20000e+01 7.20000e+01 4.20000e+02
    2.37600e+03 1.29960e+04 4.50000e+01 2.70000e+02 1.57500e+03 8.91000e+03
    4.87350e+04 1.56000e+02 9.36000e+02 5.46000e+03 3.08880e+04 1.68948e+05]]

  1. পাইথনে লেগুয়ের বহুপদী এবং x, y জটিল বিন্যাসের বিন্দুর একটি সিউডো ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করুন

  2. পাইথনে Laguerre বহুপদী এবং x, y, z জটিল বিন্যাসের বিন্দুর একটি সিউডো ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করুন

  3. পাইথনে চেবিশেভ বহুপদী এবং x, y, z নমুনা পয়েন্টের একটি ছদ্ম Vandermonde ম্যাট্রিক্স তৈরি করুন

  4. পাইথনে হারমাইট বহুপদীর একটি ছদ্ম Vandermonde ম্যাট্রিক্স এবং x, y, z বিন্দুর জটিল বিন্যাস তৈরি করুন