Group Abstract Group Abstract

Message Boards Message Boards

Use NDSolve to calculate a particular x-value, given y-value?

Posted 5 years ago
Attachments:
POSTED BY: Alex L
2 Replies
Posted 5 years ago

The first thing I did was modify your code slightly so I could take a look at the graph and see where the root might be.

q=3/100;c=1/2;b=d=1;k=G=20000;g=1;
slv=x[t]/.NDSolve[{x'[t]==x[t]*b*h[t]/G-x[t]*d*x[t]/k,
y'[t]==y[t]*b*(1-c*g)*h[t]/G+y[t]*b*(1-c*g)*g*(1-h[t]/G)-
y[t]*d*(x[t])/k,h'[t]==-q*h[t],x[0]==k,y[0]==1,
h[0]==G},{x[t],y[t],h[t]},{t,0,1000}][[1]];
Plot[slv,{t,100,1000}]

That shows me that x[t] will not equal 1 anywhere in the range of 0..1000. Outside that range it is going to have to extrapolate and any result will be far more questionable. Does this give you any idea where to begin looking for the reasons this has happened?

Note, to be really honest, the first plot I did included x[t],y[t] and h[t] from 0..1000. You might peek at that graph.

POSTED BY: Bill Nelson
Posted 5 years ago

Thank you!! I see what I was doing wrong now.

POSTED BY: Alex L
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard