Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
InterpolatingFunction
Posted:
Oct 7, 1996 1:59 AM
|
|
I have a question about using a InterpolatingFunction obtained by NDSolve as a usual function.
I posted similar questions ealier last month, and received much help to which I am very grateful.
First I ran:
NDSolve{c'[k]==...,w'[k]==...,c[ks]==cs,w[ks]==ws},{c,w},{k,ks,k0}]
Then I got:
{{c->InterpolatingFunction [...], w->InterpolatingFunction [...]}}
Next I ran, using the above result:
NDSolve[{k'[t]==0.715c[k[t]]+... /. %..%[[1]],k[0]==0.3},k,{t,0,40}]
Then I successfully (with the helpful suggestions from MathGroup) got
{{k->InterpolatingFunction [...]}}
Now there is a problem that I can not solve. I want to look at how c[k[t]] moves as t moves from 0 to 40.
I found in page212 of the last edition of 'Mathematica' book the following command and tried it.
k /. First[%]
which allowed me to plot k[t] by:
Plot[%[t],{t,0,40}]
When I similarly tried to plot c[k[t]] by:
Plot[%%%%[%[t],{t,0,40}] ^this is supposed to mean c[k] obtained by c/. First[%] immediately after getting {c->InterpolatingFunction[ ]}
Then I got a very strange looking plot together with some error messages.
Can anybody suggest what went wrong?
Noriaki Kinoshita University of Cambridge
|
|
|
|