Question: 2D Matrix interpolation

 

``

restart

``

``

(1)

``

interface(displayprecision = 4)

-1

(2)

(3)

NULL

``

Vert_Coef := Matrix(10, 5, {(1, 1) = 0.332e-1, (1, 2) = 0.187e-1, (1, 3) = 0.104e-1, (1, 4) = 0.52e-2, (1, 5) = 0.21e-2, (2, 1) = 0.509e-1, (2, 2) = 0.301e-1, (2, 3) = 0.166e-1, (2, 4) = 0.83e-2, (2, 5) = 0.31e-2, (3, 1) = 0.571e-1, (3, 2) = 0.364e-1, (3, 3) = 0.218e-1, (3, 4) = 0.104e-1, (3, 5) = 0.42e-2, (4, 1) = 0.582e-1, (4, 2) = 0.405e-1, (4, 3) = 0.260e-1, (4, 4) = 0.125e-1, (4, 5) = 0.42e-2, (5, 1) = 0.582e-1, (5, 2) = 0.416e-1, (5, 3) = 0.270e-1, (5, 4) = 0.135e-1, (5, 5) = 0.52e-2, (6, 1) = 0.582e-1, (6, 2) = 0.416e-1, (6, 3) = 0.281e-1, (6, 4) = 0.145e-1, (6, 5) = 0.52e-2, (7, 1) = 0.582e-1, (7, 2) = 0.416e-1, (7, 3) = 0.291e-1, (7, 4) = 0.166e-1, (7, 5) = 0.62e-2, (8, 1) = 0.582e-1, (8, 2) = 0.416e-1, (8, 3) = 0.301e-1, (8, 4) = 0.177e-1, (8, 5) = 0.62e-2, (9, 1) = 0.582e-1, (9, 2) = 0.416e-1, (9, 3) = 0.301e-1, (9, 4) = 0.187e-1, (9, 5) = 0.73e-2, (10, 1) = 0.582e-1, (10, 2) = 0.416e-1, (10, 3) = 0.301e-1, (10, 4) = 0.197e-1, (10, 5) = 0.83e-2})

Matrix(10, 5, {(1, 1) = 0.332e-1, (1, 2) = 0.187e-1, (1, 3) = 0.104e-1, (1, 4) = 0.52e-2, (1, 5) = 0.21e-2, (2, 1) = 0.509e-1, (2, 2) = 0.301e-1, (2, 3) = 0.166e-1, (2, 4) = 0.83e-2, (2, 5) = 0.31e-2, (3, 1) = 0.571e-1, (3, 2) = 0.364e-1, (3, 3) = 0.218e-1, (3, 4) = 0.104e-1, (3, 5) = 0.42e-2, (4, 1) = 0.582e-1, (4, 2) = 0.405e-1, (4, 3) = 0.260e-1, (4, 4) = 0.125e-1, (4, 5) = 0.42e-2, (5, 1) = 0.582e-1, (5, 2) = 0.416e-1, (5, 3) = 0.270e-1, (5, 4) = 0.135e-1, (5, 5) = 0.52e-2, (6, 1) = 0.582e-1, (6, 2) = 0.416e-1, (6, 3) = 0.281e-1, (6, 4) = 0.145e-1, (6, 5) = 0.52e-2, (7, 1) = 0.582e-1, (7, 2) = 0.416e-1, (7, 3) = 0.291e-1, (7, 4) = 0.166e-1, (7, 5) = 0.62e-2, (8, 1) = 0.582e-1, (8, 2) = 0.416e-1, (8, 3) = 0.301e-1, (8, 4) = 0.177e-1, (8, 5) = 0.62e-2, (9, 1) = 0.582e-1, (9, 2) = 0.416e-1, (9, 3) = 0.301e-1, (9, 4) = 0.187e-1, (9, 5) = 0.73e-2, (10, 1) = 0.582e-1, (10, 2) = 0.416e-1, (10, 3) = 0.301e-1, (10, 4) = 0.197e-1, (10, 5) = 0.83e-2})

(4)

``

``

whattype(Vert_Coef)

Matrix

(5)

``

NULL

``

``

``

``

SR := Vector([10.8696, 21.7391, 32.6087, 43.4783, 46.7391, 54.3478, 65.2174, 76.0870, 86.9565, 100.0000], datatype = float)

Vector(10, {(1) = 10.8696, (2) = 21.7391, (3) = 32.6087, (4) = 43.4783, (5) = 46.7391, (6) = 54.3478, (7) = 65.2174, (8) = 76.0870, (9) = 86.9565, (10) = 100.0000})

(6)

E_G := Vector([250, 500, 1000, 2500, 10000], datatype = float)

Vector(5, {(1) = 250.0000, (2) = 500.0000, (3) = 1000.0000, (4) = 2500.0000, (5) = 10000.0000})

(7)

``

``NULL

NULL

``

NULL

``

B_interp := proc (SR, E_G) options operator, arrow; CurveFitting:-ArrayInterpolation([SR, E_G], Vert_Coef, Array(1 .. 1, 1 .. 1, 1 .. 2, [[[SR, E_G]]]), method = linear) end proc

proc (SR, E_G) options operator, arrow; CurveFitting:-ArrayInterpolation([SR, E_G], Vert_Coef, Array(1 .. 1, 1 .. 1, 1 .. 2, [[[SR, E_G]]]), method = linear) end proc

(8)

``

``

f[18*_1] := B_interp(25.0, 1500.0)

Error, (in CurveFitting:-ArrayInterpolation) invalid input: dimensions of independent data do not match the dimensions of dependent data

 

 

Download Matrix_Interpolation.mw

Hello Mapleprime Community,

Would you be kind to help me with the attached Maple worksheet. My goal is to do a 2D interpolation given the value of SR (slenderness ratio) and E_G (Young's modulus / Shear modulus ratio) in the Matrix table Vert_Coeff with header as vector E_G and the other as vector SR. I’m confused as to how to do the interpolation. Please help.

 

Regards,

 

Moses

Please Wait...