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 http://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/26037#26037 – Michael E2 Apr 12 '15 at 21:12something[t]to a new interpolating function and the extend the integration byNDSolve, which automatically uses the new interpolating function. I thought that's what you wanted to do? – Michael E2 Apr 13 '15 at 01:57