Group Abstract Group Abstract

Message Boards Message Boards

Solve a system of ODE's with DSolve[ ]?

Attachments:
POSTED BY: Jay Gourley
4 Replies

Thanks, again Robert Nachbar.

POSTED BY: Jay Gourley
POSTED BY: Robert Nachbar

Thanks, Robert Nachbar for the explanation. And also thanks for including the plot. Is it possible to animate the plot with sliders for the parameters? Also, I'm new to applied math. Is a system of closed form solutions not possible, even in a case like this where S'+I'+R'=0 for all t?

Is there web tutorial on Mathematica syntax? I understand functions I write with my limited vocabulary. But understanding yours involves guesswork. Your functions work perfectly, but I cannot explain why.

POSTED BY: Jay Gourley

This system of equations contains two nonlinear equations, and therefore cannot be solved in closed form.

They can be solved numerically with ParametricNDSolve that will allow you to play with the parameters.

{ss, ii, rr} = {s, i, r} /. 
  ParametricNDSolve[{eqns, {s[0] == s0, i[0] == i0, r[0] == r0}}, {s, 
    i, r}, {t, 0, 100}, {s0, i0, r0, \[Beta], g, m}]

The following Plot can be put inside of Manipulate

Plot[{ss[1000, 1, 0, 0.002, 0.2, 0.003][t], 
  ii[1000, 1, 0, 0.002, 0.2, 0.003][t], 
  rr[1000, 1, 0, 0.002, 0.2, 0.003][t]}, {t, 0, 30}]

enter image description here

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