Question: System Recursive Equations

Hello!

How do I get the plot of P(t) and C(t) and also a table with the values of P(t) for each t? Itried but I couldn't...

``

restart; beta := 0.7e-2; Lambda := 0.2e-4; `ρ__o` := 0.3e-2; lambda := 0.8e-1; h := 0.1e-1; n := 100

Error,

restart; beta := 0.7e-2; Lambda := 0.2e-4; `ρ__o` := 0.3e-2; lambda := 0.8e-1; h := 0.1e-1; n := 100

 

for i from 0 to n-1 do P[i+1] := (1+h*(`ρ__o`-beta)/Lambda)*P(i)+h*lambda*C(i); C[i+1] := h*beta*P(i)/Lambda+(-h*lambda+1)*C(i) end do:

seq(i, i = 0 .. 30); seq(P[i], i = 0 .. 30)

Error,

seq(i, i = 0 .. 30); seq(P[i], i = 0 .. 30)

 

with(plots); with(DEtools); p1 := plot([P(t)], t = 0 .. 100, [[P(0) = 1]], scene = [t, P(t)], thickness = 2, linecolor = red, stepsize = .1); p2 := plot([C(T)], t = 0 .. 100, [[C(0) = beta/(Lambda*lambda)]], scene = [t, C(t)], thickness = 2, linecolor = red, stepsize = .1); display([p1, p2])

``

Download System_Recursive_Equations.mw

Thank!!!

Please Wait...