Tuesday, November 26, 2024
Google search engine
HomeLanguagesPython | Numpy np.hermvander3d() method

Python | Numpy np.hermvander3d() method

With the help of np.hermvander3d() method, we can get the 3-D pseudo vandermonde matrix from hermite series of given degree by using np.hermvander3d() method.

Syntax : np.hermvander3d(x, y, z, deg)
Return : Return the 3-D pseudo vandermonde matrix of given degree.

Example #1 :
In this example we can see that by using np.hermvander3d() method, we are able to get the 3-D pseudo vandermonde matrix of hermite series by using this method.




# import numpy and hermvander3d
import numpy as np
from numpy.polynomial.hermite import hermvander3d
  
x = np.array([1, 2])
y = np.array([-1, -2])
z = np.array([1, -2])
x_deg, y_deg, z_deg = 2, 2, 2
  
# using np.hermvander3d() method
gfg = hermvander3d(x, y, z, [x_deg, y_deg, z_deg])
  
print(gfg)


Output :

[[ 1.000e+00 2.000e+00 2.000e+00 -2.000e+00 -4.000e+00 -4.000e+00
2.000e+00 4.000e+00 4.000e+00 2.000e+00 4.000e+00 4.000e+00
-4.000e+00 -8.000e+00 -8.000e+00 4.000e+00 8.000e+00 8.000e+00
2.000e+00 4.000e+00 4.000e+00 -4.000e+00 -8.000e+00 -8.000e+00
4.000e+00 8.000e+00 8.000e+00]
[ 1.000e+00 -4.000e+00 1.400e+01 -4.000e+00 1.600e+01 -5.600e+01
1.400e+01 -5.600e+01 1.960e+02 4.000e+00 -1.600e+01 5.600e+01
-1.600e+01 6.400e+01 -2.240e+02 5.600e+01 -2.240e+02 7.840e+02
1.400e+01 -5.600e+01 1.960e+02 -5.600e+01 2.240e+02 -7.840e+02
1.960e+02 -7.840e+02 2.744e+03]]

Example #2 :




# import numpy and hermvander3d
import numpy as np
from numpy.polynomial.hermite import hermvander3d
  
x = np.array([0.5, 0.10, 0.10, 0.5])
y = np.array([1, 2, 3, 5])
z = np.array([10.1, 20.2, 30.3, -50]) 
x_deg, y_deg, z_deg = 1, 1, 1
  
# using np.hermvander3d() method
gfg = hermvander3d(x, y, z, [x_deg, y_deg, z_deg])
  
print(gfg)


Output :

[[ 1.000e+00 2.020e+01 2.000e+00 4.040e+01 1.000e+00 2.020e+01
2.000e+00 4.040e+01]
[ 1.000e+00 4.040e+01 4.000e+00 1.616e+02 2.000e-01 8.080e+00
8.000e-01 3.232e+01]
[ 1.000e+00 6.060e+01 6.000e+00 3.636e+02 2.000e-01 1.212e+01
1.200e+00 7.272e+01]
[ 1.000e+00 -1.000e+02 1.000e+01 -1.000e+03 1.000e+00 -1.000e+02
1.000e+01 -1.000e+03]]

Dominic Rubhabha-Wardslaus
Dominic Rubhabha-Wardslaushttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Recent Comments