কম্পিউটার টিউটোরিয়াল

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


হারমাইট_ই পলিনোমিয়াল এবং x, y, z নমুনা পয়েন্ট দিয়ে একটি সিউডো ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করতে, পাইথন নাম্পাই-তে hermite_e.hermevander3d() ফাংশনটি ব্যবহার করুন। এই মেথডটি সিউডো-ভ্যান্ডারমন্ড ম্যাট্রিক্স রিটার্ন করে। প্যারামিটার x, y, z হলো একই আকারের পয়েন্ট কোঅর্ডিনেট অ্যারে। ডিটায়পগুলো ফ্লোট64 বা কমপ্লেক্স128-এ কনভার্ট হবে, যারা এলিমেন্টে কমপ্লেক্স নম্বর আছে কিনা তার উপর নির্ভর করে। স্কেলারগুলো 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([-2.+2.j, -1.+2.j]) y = np.array([0.+2.j, 1.+2.j]) z = np.array([2.+2.j, 3. + 3.j])

অ্যারেগুলো প্রদর্শন করুন —

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)

হারমাইট_ই পলিনোমিয়াল এবং x, y, z নমুনা পয়েন্ট দিয়ে সিউডো ভ্যান্ডারমন্ড ম্যাট্রিক্স তৈরি করতে 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([-2.+2.j, -1.+2.j]) y = np.array([0.+2.j, 1.+2.j]) z = np.array([2.+2.j, 3. + 3.j]) # 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...   [-2.+2.j -1.+2.j] Array2...   [0.+2.j 1.+2.j]   Array3...   [2.+2.j 3.+3.j] Array1 datatype... complex128 Array2 datatype... complex128 Array3 datatype... complex128 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.0000e+00 +0.000e+00j 2.0000e+00 +2.000e+00j  -1.0000e+00  +8.000e+00j    -2.2000e+01 +1.000e+01j -6.1000e+01-4.800e+01j   0.0000e+00 +2.000e+00j    -4.0000e+00 +4.000e+00j -1.6000e+01-2.000e+00j -2.0000e+01 -4.400e+01j    9.6000e+01 -1.220e+02j -5.0000e+00+0.000e+00j  -1.0000e+01 -1.000e+01j    5.0000e+00 -4.000e+01j 1.1000e+02 -5.000e+01j 3.0500e+02 +2.400e+02j     0.0000e+00 -1.400e+01j 2.8000e+01 -2.800e+01j 1.1200e+02 +1.400e+01j    1.4000e+02 +3.080e+02j -6.7200e+02 +8.540e+02j -2.0000e+00 +2.000e+00j    -8.0000e+00 +0.000e+00j -1.4000e+01 -1.800e+01j 2.4000e+01 -6.400e+01j    2.1800e+02 -2.600e+01j -4.0000e+00 -4.000e+00j 0.0000e+00 -1.600e+01j    3.6000e+01 -2.800e+01j 1.2800e+02 +4.800e+01j 5.2000e+01 +4.360e+02j    1.0000e+01 -1.000e+01j 4.0000e+01 +0.000e+00j 7.0000e+01 +9.000e+01j    -1.2000e+02 +3.200e+02j -1.0900e+03 +1.300e+02j 2.8000e+01 +2.800e+01j     0.0000e+00 +1.120e+02j -2.5200e+02 +1.960e+02j -8.9600e+02 -3.360e+02j   -3.6400e+02 -3.052e+03j -1.0000e+00 -8.000e+00j 1.4000e+01 -1.800e+01j    6.5000e+01 +0.000e+00j 1.0200e+02 +1.660e+02j -3.2300e+02 +5.360e+02j    1.6000e+01 -2.000e+00j 3.6000e+01 +2.800e+01j 0.0000e+00 +1.300e+02j    -3.3200e+02 +2.040e+02j -1.0720e+03 -6.460e+02j 5.0000e+00 +4.000e+01j    -7.0000e+01 +9.000e+01j -3.2500e+02 +0.000e+00j -5.1000e+02 -8.300e+02j    1.6150e+03 -2.680e+03j -1.1200e+02 +1.400e+01j -2.5200e+02 -1.960e+02j    0.0000e+00 -9.100e+02j 2.3240e+03 -1.428e+03j 7.5040e+03 +4.522e+03j]    [ 1.0000e+00 +0.000e+00j 3.0000e+00 +3.000e+00j -1.0000e+00 +1.800e+01j    -6.3000e+01 +4.500e+01j -3.2100e+02 -1.080e+02j 1.0000e+00 +2.000e+00j   -3.0000e+00 +9.000e+00j -3.7000e+01 +1.600e+01j -1.5300e+02 -8.100e+01j    -1.0500e+02 -7.500e+02j -4.0000e+00 +4.000e+00j -2.4000e+01 +0.000e+00j   -6.8000e+01 -7.600e+01j 7.2000e+01 -4.320e+02j 1.7160e+03 -8.520e+02j    -1.4000e+01 -8.000e+00j -1.8000e+01 -6.600e+01j 1.5800e+02 -2.440e+02j   1.2420e+03  -1.260e+02j 3.6300e+03 +4.080e+03j -1.0000e+00 +2.000e+00j   -9.0000e+00 +3.000e+00j -3.5000e+01 -2.000e+01j -2.7000e+01 -1.710e+02j   5.3700e+02 -5.340e+02j -5.0000e+00 +0.000e+00j -1.5000e+01 -1.500e+01j   5.0000e+00 -9.000e+01j 3.1500e+02 -2.250e+02j 1.6050e+03 +5.400e+02j    -4.0000e+00 -1.200e+01j 2.4000e+01 -4.800e+01j 2.2000e+02 -6.000e+01j   7.9200e+02 +5.760e+02j -1.2000e+01 +4.284e+03j 3.0000e+01 -2.000e+01j   1.5000e+02 +3.000e+01j 3.3000e+02 +5.600e+02j -9.9000e+02 +2.610e+03j   -1.1790e+04 +3.180e+03j -4.0000e+00 -4.000e+00j 0.0000e+00 -2.400e+01j   7.6000e+01 -6.800e+01j 4.3200e+02 +7.200e+01j 8.5200e+02 +1.716e+03j    4.0000e+00 -1.200e+01j 4.8000e+01 -2.400e+01j 2.1200e+02 +8.400e+01j   2.8800e+02 +9.360e+02j -2.5800e+03 +3.420e+03j 3.2000e+01 +0.000e+00j 9.6000e+01 +9.600e+01j -3.2000e+01 +5.760e+02j -2.0160e+03 +1.440e+03j -1.0272e+04 -3.456e+03j 2.4000e+01 +8.800e+01j -1.9200e+02 +3.360e+02j -1.6080e+03 +3.440e+02j -5.4720e+03 -4.464e+03j 1.8000e+03 -3.084e+04j]]
  1. পাইথনে ল্যাগার পলিনোমিয়ালের ছদ্ম ভ্যান্ডারমন্ড ম্যাট্রিক্স জেনারেট করা জটিল পয়েন্টস দিয়ে

  2. পাইথনে জটিল x, y, z বিন্দু দিয়ে ল্যাগার পলিনোমিয়ালের ছদ্ম ভ্যান্ডারমোন্ড ম্যাট্রিক্স তৈরি করুন

  3. পাইথনে চেবিশেভ পলিনোমিয়ালের छদ্ম ভ্যান্ডারমন্ড ম্যাট্রিক্স এবং x, y, z স্যাম্পল পয়েন্ট বের করুন

  4. পাইথনে হার্মাইট পলিনোমিয়াল এবং x, y, z জটিল পয়েন্টের সিউডো ভ্যান্ডারমন্ড ম্যাট্রিক্স জেনারেট করুন