System dravec-korist (Lotka-Volterra)
> | with(plots); |
> | unprotect(gamma); |
Parametry:
> | alpha := 1;
beta := 0.1; gamma := 1; delta := 0.1; |
System rovnic:
> | sys := {diff(x(t),t)= x(t)*(alpha - beta*y(t)), diff(y(t),t)= -y(t)*(gamma - delta*x(t))}; |
Pocatecny podminky:
> | pocatecni := {x(0)=10, y(0)=4}; |
Numericke reseni:
> | q:= combine(dsolve(sys union pocatecni,{x(t), y(t)}, type=numeric, range=0..10)): |
Vykresleni reseni:
> | odeplot(q, [[t,x(t),color=green, thickness=3], [t,y(t),color=red, thickness=3]]); |
> | odeplot(q, [x(t),y(t)],color=blue, thickness=3, numpoints=100); |
Charakteristicke vektorove pole (integralni krivky jsou charakteristiky):
> | fieldplot([x*(alpha - beta*y),-y*(gamma - delta*x)],x=0..22,y=0..22,arrows=SLIM, color=orange); |
> | display(%,%%); |
> |
> |