I have NDSolve
` StateData
from an NDSolve
` ProcessEquations
evaluation. I can NDSolve
` Iterate
from t0 to t1, but then my boundary condition (an interpolation function) runs out of data.
This interpolation function gets updated externally. I just want to continue iterating (t1 to t2) with the updated interpolation function. However, calling myStateData@"NumericalFunction"
shows that NDSolve holds onto the old interpolation function, even though this function is defined with a delayed set i.e. myInterpFunction[t_]:=something[t]
Is there any way to update the functions inside of the state data?
Here is a simplified version of what I'm doing:
myStateData = NDSolve`ProcessEquations[
{myPDE[x,t],
(*boundary conditions*)
T[xf, t] == myInterpolationFunction[t],
T[0, t] == 0,
(*Initial condition*)
T[x, t0] == initialCondition[x]};
T, t, {x, 0, xf}]
Then I need to solve so...
NDSolve`Iterate[myStateData,t1]
Then externally I update my boundary condition so that now it goes to t2 but when I evaluate
NDSolve`Iterate[myStateData,t2]
Mathematica returns an error saying that the interpolation function doesn't cover that range (t1 - t2) because it's holding onto the old interpolating function. In other words, looking at
myStateData@"NumericalFunction"
shows myInterpolationFunction has a domain of {t0,t1}
myInterpolationFunction[t_?NumericQ] := something[t]
. See also mathematica.stackexchange.com/questions/18393/… $\endgroup$