Message Boards Message Boards

Error while using NDSolve?

Attachments:
2 Replies
Posted 4 years ago

Restart Mathematica and, before doing anything else, scrape this code off the screen and paste it into your notebook and run it and report what you get

nN=100000;beta0=1.0;gamma=1/5;sigma=1/7;iI0=1;
sol=NDSolve[{sS'[t]==-beta0*sS'[t]*iI[t]/nN,
eE'[t]==beta0*sS[t]*iI[t]/nN-sigma*eE[t],
iI'[t]==sigma*eE[t]-gamma*iI[t],rR'[t]==gamma*iI[t],
sS[0]==nN-iI0,eE[0]==iI0,iI[0]==0,rR[0]==0},
{sS[t],eE[t],iI[t],rR[t]},{t,0,240}];
Plot[Evaluate[{sS[t],eE[t],iI[t],rR[t]}/.sol],{t,0,120},
PlotRange->All,AxesOrigin->{0,0}]

If it works then compare that character by character with the code you showed above and look at every tiny difference.

POSTED BY: Bill Nelson

Your first equation includes derivative of sS in both parts, left and right

sS'[t] == (-beta0) * (sS'[t]) * (iI[t]) / nN
POSTED BY: Konstantin Nosov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract