Lotka-Volterra modeller

> with(DEtools);

[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...
[DEnormal, DEplot, DEplot3d, DEplot_polygon, DFacto...

> with(plots);

[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...
[animate, animate3d, animatecurve, changecoords, co...

Vi definerer et enkett eksempel på et Lotka-Voterra differentialligningssystem:

> sys:=diff(x(t),t)=x(t)-x(t)*y(t),diff(y(t),t)=x(t)*y(t)-y(t);

sys := diff(x(t),t) = x(t)-x(t)*y(t), diff(y(t),t) ...

som vi løser numerisk, her med begyndelsesbetingelserne x(0)=1.5 og y(0)=1.5

> p:=dsolve({sys,x(0)=1.5,y(0)=1.5},[x(t),y(t)],type=numeric);

p := proc (rkf45_x) local i, rkf45_s, outpoint, r1,...

Løsningernes grafer ser sådan ud

> odeplot(p,[[t,x(t)],[t,y(t)]],0..50,thickness=2,title='LotkaVolterra',labels=[tid,bestand]);

[Maple Plot]

og kurven (x(t),y(t))

> odeplot(p,[x(t),y(t)],0..10,title='Fasediagram',thickness=2);

[Maple Plot]

cirkler omkring ligevægtspunktet (1,1).

Vi kan prøve at undersøge, hvad der sker når vi piller ved koeffcienter i Lotka_Volterra ligningssystemet. Her er et lidt andet system

> sys2:=diff(x(t),t)=2*x(t)-0.05*x(t)*y(t),diff(y(t),t)=-1*y(t)+0.1*x(t)*y(t);

sys2 := diff(x(t),t) = 2*x(t)-.5e-1*x(t)*y(t), diff...

som vi løser numerisk

> p2:=dsolve({sys2,x(0)=10,y(0)=5}, [x(t),y(t)], type=numeric);

p2 := proc (rkf45_x) local i, rkf45_s, outpoint, r1...

Vi tegner løsningernes grafer

> odeplot(p2,[[t,x(t)],[t,y(t)]],0..50,thickness=2);

[Maple Plot]

og kurven (x(t),(t))

> odeplot(p2,[x(t),y(t)],0..10,title='Fasediagram',thickness=2);

[Maple Plot]

Her er vektorfeltet for det andet system

> DEplot({sys2}, [x(t),y(t)], t= 0..10, [[x(0) = 10, y(0) = 5]] );

[Maple Plot]

Vi ser hvordan løsningskurverne (x(t),y(t)) løber periodisk rundt om ligevægtspunktet svarende

periodiske svingninger i bestandene af de to dyrearter.