Home python The bilinear interpolation table python

The bilinear interpolation table python

Author

Date

Category

I’m not a programmer, but you need to find the coefficient of Nu-known ro and xi. Tried many options including interp2d, nothing happens.

 png image description here enter

import numpy as np
from scipy import interpolate
ro = 12
xi = 9.17
Table_11_6_x = [5, 10, 20, 40, 80, 160, 350]
Table_11_6_y = [0.1, 5, 10, 20, 40, 80, 160]
x, y = np.meshgrid (Table_11_6_x, Table_11_6_y)
st1 = [0.95, 0.92, 0.88, 0.83, 0.76, 0.67, 0.56]
st2 = [0.89, 0.87, 0.84, 0.8, 0.73, 0.65, 0.54]
st3 = [0.85, 0.84, 0.81, 0.77, 0.71, 0.64, 0.53]
st4 = [0.8, 0.78, 0.76, 0.73, 0.68, 0.61, 0.51]
st5 = [0.72, 0.72, 0.7, 0.67, 0.63, 0.57, 0.48]
st6 = [0.63, 0.63, 0.61, 0.59, 0.56, 0.51, 0.44]
st7 = [0.53, 0.53, 0.52, 0.5, 0.47, 0.44, 0.38]
Table_11_6 = np. array ([st1, st2, st3, st4, st5, st6, st7])
f = interpolate.interpn ((x, y), Table_11_6, (ro, xi), method = 'splinef2d')
Table_11_6

Answer 1, Authority 100%

import numpy as np
from scipy import interpolate
ro = 12
xi = 9.17
Table_11_6_x = [5, 10, 20, 40, 80, 160, 350]
Table_11_6_y = [0.1, 5, 10, 20, 40, 80, 160]
st1 = [0.95, 0.92, 0.88, 0.83, 0.76, 0.67, 0.56]
st2 = [0.89, 0.87, 0.84, 0.8, 0.73, 0.65, 0.54]
st3 = [0.85, 0.84, 0.81, 0.77, 0.71, 0.64, 0.53]
st4 = [0.8, 0.78, 0.76, 0.73, 0.68, 0.61, 0.51]
st5 = [0.72, 0.72, 0.7, 0.67, 0.63, 0.57, 0.48]
st6 = [0.63, 0.63, 0.61, 0.59, 0.56, 0.51, 0.44]
st7 = [0.53, 0.53, 0.52, 0.5, 0.47, 0.44, 0.38]
Table_11_6 = np. array ([st1, st2, st3, st4, st5, st6, st7])
f = interpolate.interpn ((Table_11_6_x, Table_11_6_y), Table_11_6, (ro, xi), method = 'splinef2d')

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions