Question: Plotting equilibrium points

I am preparing some examples to start the year in the differential equations lesson. And I was wondering if there is any other way to represent the equilibrium points than the following which I found and then plotted using pointplot.

restart

NULL

alpha := 0.4e-1; beta := 0.8e-2; sys := {diff(g(t), t) = -.25*g(t)+beta*p(t)*g(t), diff(p(t), t) = .7*p(t)*(1-(1/100)*p(t))-alpha*p(t)*g(t)}; ics := {g(0) = 5, p(0) = 20}
 

sol := dsolve(`union`(sys, ics), {g(t), p(t)}, numeric, range = 0 .. 50); with(plots); plots:-display(plots:-odeplot(sol, [t, p(t)], 0 .. 50, color = blue, legend = ["p(t)"]), plots:-odeplot(sol, [t, g(t)], 0 .. 50, color = red, legend = ["gt)"]), labels = ["t", "Population"], title = "Population Dynamics")

 

eqns := {.7*p(t)*(1-(1/100)*p(t))-alpha*p(t)*g(t) = 0, -.25*g(t)+beta*p(t)*g(t) = 0}; eq_points := solve(eqns, {g(t), p(t)}); eq_points

{g(t) = 0., p(t) = 0.}, {g(t) = 0., p(t) = 100.}, {g(t) = 12.03125000, p(t) = 31.25000000}

(1)

eqpoints := pointplot([[0, 0], [100, 0], [31.25000000, 12.03125000]], color = [red], symbol = diamond, symbolsize = 15)

``
phaseplot := odeplot(sol, [p(t), g(t)], 0 .. 35, color = green, thickness = 2)

with(DEtools); vectorfield_plot := dfieldplot([diff(p(t), t) = .7*p(t)*(1-(1/100)*p(t))-alpha*p(t)*g(t), diff(g(t), t) = -.25*g(t)+beta*p(t)*g(t)], [p(t), g(t)], t = 0 .. 35, p = 0 .. 150, g = 0 .. 30, arrows = small, color = blue, axes = boxed)

 

 

display([vectorfield_plot, phaseplot, eqpoints])

 

NULL


 

Download aquarium.mw

Please Wait...