# Interpolation for different Parameters

I am rather new to Mathematica and I tried to find a solution for my Problem on my own, also looking through this site and the suggested Similar Questions, but I at least could not make out that my Question has been addressed yet. Perhaps it is too basic.

I have a Code where I need to do a few Interpolations and this I do for the same Variables and Boundaries for the Variables. However to test some things I need to change these Variables in the same way in every Interpolation. This is nothing dramatic of course, but I was wondering if there is a neat way to do it.

All Interpolations look as follows

int =
Interpolation[
Flatten[
Table[{#1, #2, #3,
F}, {x, -#4, #4}, {y, -#4, #4}, {z, -#4, 4}] & @@ {x, y,
z, 5}, 2], InterpolationOrder -> 4]


So now when I want to get the results for different variables I will change x to x/2 etc. in each Interpolation.

Perhaps someone could even tell me how to Parallelize this Question, though the Interpolation is quick anyhow.

Edit

I am abbreviating my code here, but trying to give a working example (can't test it at the moment) while making more explicit what I am thinking of.

I am solving a PDE numerically, this is necessary for my work. Afterwards I interpolate the Solution to get NIntegrate to take it properly and not give me an error of evaluating to non-numerical values. Since in my Integration I am not actually using the interpolated solution, but Derivatives of it I interpolatedthe Derivative again and give that to the NIntegrate.

l=5;
k=1;
Tf=10;
uIn[x_,t_]:=Exp[-x^2];

sol= u /. First[
NDSolve[
{D[u[x,t], {t,2}] - D[u[x,t],{x,2}] - k (u[x,t])^3 == 0 ,
u[x,0]==uIn[x,0],
Derivative[0,1][u][x,0]==Derivative[0,1][u4][x,0],
u[-l,t]==u[l,t]}, u, {t,0,Tf}, {x,-l,l},
Method->{"MethodOfLines", "SpatialDiscretization"->{"TensorProductGrid","DifferenceOrder"->"Pseudospectral"}}]]

intSol= Interpolation[
Flatten[
Table[{#1,t, sol[x,t]},{x,-#2,#2},{t,0,Tf}]&@@{x,5}, 3], InterpolationOrder->4]

derInt=(D[intSol[#1,Tf],x]-0.5*intSol[#1,Tf]^2+ 0.25*k*intSol[#1,Tf]^4) &@@{x,5};

intDeriv =
Interpolation[
Flatten[ Table[{#1,derInt},{x,-#2,#2}] &@@{x,5}, 2],InterpolationOrder->4];


In the next step, after the Notebook has evaluated, I would now change the {x,5} to {x/2,10} and have the notebook evaluate again. Since I would have to change that a number of times for each iteration, I was wondering if there was a possibility to just having to change it once and give that to all the Interpolations.
• I'm using the Interpolation afterwards in NIntegrate. I was hoping to get something like interpolation1=...[#1,#2,#3], interpolation2=...[#1,#2,#3] /@@ {variables} If that makes any sense to you. As in I only want to have to write the changes variables once and not copy/past it like 8 times. I hope my reply makes any sense and of course there isn't really a problem. Dec 16 '20 at 14:58