Author 
Comment/Response 
fpghost

07/24/12 06:19am
Hi,
I'm currently doing something like:
y[a,b,c]:= y./ NDSolve[{eqn[a,b,c], y[0]==init[a,b,c], y'[0]==dinit[a,b,c],y,{r,2,10000}][[1]]
This works and I can get out numeric values for a particular y[a,b,c][r1], but the problem is if I then go to get y[a,b,c][r2] (i.e. feeding the same coefficients (a,b,c) into my differential equation, but wanting a different value of r in the already computed InterpolatingFunction) it does the whole computation of the InterpolatingFunction all over again for the whole 10000 range (which takes a couple of minutes which I can't spare)
There must be a better way to do this given that for the parameters (a,b,c) the InterpolatingFunction has already been constructed once, so I should then be able to just cherry pick diff values of 'r'.
If I just wrote:
f= y./ NDSolve[{eqn[1,2,3], y[0]==init[1,2,3], y'[0]==dinit[1,2,3],y,{r,2,10000}][[1]]
i.e. solving for specific values of parameters (a,b,c)=(1,2,3), then I can access the precomputed interpolating function instantaneously after running once only, i.e. f[10], f[200] at lightening speed.
How should I set this up so I can feed into general parameters (a,b,c) but then be able to accress the InterpolatingFunction for this set with redoing the NDSolve?
thanks
URL: , 
