soln = integrateODE(dx~r*x*(1-x/k), k=10, r=.5, domain(t=0:20), x=1)
soln$x(10)
soln$x(30) # outside the time interval for integration
traj_plot(x(t)~t, soln, domain(t=0:10))
soln2 = integrateODE(dx~y, dy~-x, x=1, y=0, domain(t=0:10))
traj_plot(y(t)~t, soln2)
SIR <- makeODE(dS~ -a*S*I, dI ~ a*S*I - b*I, a=0.0026, b=.5, S=762, I=1)
epi = integrateODE(SIR, domain(t=0:20))
traj_plot(I(t) ~ t, epi)
Run the code above in your browser using DataLab