Home Profile Projects Articles

Maple: Variation of Predator-Prey Model

Saturday, 17 of November , 2007 at 9:06 pm

> restart; a := 20; alpha := 2; sigma := .3; c := 30; g := 2

20
2
0.3
30
2

> e1 := diff(x(t), t) = a*x(t)-alpha*x(t)*y(t)-sigma*x(t)^2;
> e2 := diff(y(t), t) = -c*y(t)+g*x(t)*y(t);

\frac{d}{dt}x(t) = 20x(t) - 2x(t)y(t) - .3x(t)^{2}
\frac{d}{dt} y(t) = -30y(t) + 2 x(t)y(t)

> solve({rhs(e1) = 0, rhs(e2) = 0}, {x(t), y(t)}):
> sol(1):
> with(DEtools): with(plots):
> DEplot({e1, e2}, {x(t), y(t)}, t = 0 .. 5, [[x(0) = 15, y(0) = 7]], stepsize = 3)

> plotX := DEplot({e1, e2}, {x(t), y(t)}, t = 0 .. 4, [[x(0) = 1, y(0) = 1]], stepsize = 3, scene = [t, x], arrows = NONE, linecolor = RED);
> plotY := DEplot({e1, e2}, {x(t), y(t)}, t = 0 .. 4, [[x(0) = 1, y(0) = 1]], stepsize = 3, scene = [t, y], arrows = NONE, linecolor = BLUE);
> plots[display]([plotX, plotY])

Category: Differential Equations, Maple

1 Comment

Comment by Nikita Nikolaev

Made Sunday, 27 of January , 2008 at 7:53 pm

wow… This is wonderful!

I am currently using Mathematica. I have purchased a few pieces of literature to start learning MatLab in details, finer than I know at the moment (which is frankly quite basic). May be I should also gain some familiarity with Maple… hm…

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> [tex]