I am trying to interpolate a function of $5$ variables
$$f[m,M,k,v,w]$$
by creating a 5D
table of $n$ values in each dimension.
For[im = mbegin, im <= mend, im += (mend - mbegin)/n,
For[iM = Mbegin, iM <= Mend, iM += (Mend - Mbegin)/n,
For[iv = vbegin, iv <= vend, iv += (vend - vbegin)/n,
For[iw = wbegin, iw <= wend, iw += (wend - wbegin)/n,
For[ix = xbegin, ix <= xend, ix += (xend - xbegin)/n,
Module[{ik = g[im,ix], val},
val = f[im, iM, ik, iv, iw];
AppendTo[vals, val];
AppendTo[keysm, im];
AppendTo[keysM, iM];
AppendTo[keysv, iv];
AppendTo[keysw, iw];
AppendTo[keysx, ix];
]
]
]
]
]
];
No idea how to use that next.
I have tried using Interpolation, but even with $3$ dimensions it fails:
data = Flatten[
Table[{nm, nM, nv, f[nm, nM, kbegin, nv, wbegin]}, {nm, mbegin,
mend, (mend - mbegin)/count}, {nM, Mbegin,
Mend, (Mend - Mbegin)/count}, {nv, vbegin,
vend, (vend - vbegin)/count}], 1];
f = Interpolation[data];
FunctionInterpolation
and comparison with other function interpolation methods. $\endgroup$