Maple/非線性常微分方程

維基教科書,自由的教學讀本

Lotka Volterra 方程[編輯]

DE := [diff(r(t), t) = 2*r(t)-alpha*r(t)*f(t)/(1+s*r(t)), diff(f(t), t) = -f(t)+alpha*r(t)*f(t)/(1+s*r(t)), r(0) = 300, f(0) = 100]; params := alpha = 0.1e-1, s = 0.1e-2; DES := subs(params, DE);

solu := dsolve(DES, numeric); plots[odeplot](solu, [t, r(t), f(t)], 0 .. 30, color = red, thickness = 3, title = "Saturable Volterra equation plot", font = [HELVITICA, 20]);

plots[odeplot](solu, [[t, f(t), color = blue, thickness = 3], [t, r(t), color = red, thickness = 3]], 0 .. 25, title = "Saturable Volterra equation plot", font = [HELVITICA, 20], legend = ["Fox", "Rabbit"], legendstyle = [font = ["HELVETICA", 19], location = bottom]);

> plots[odeplot](solu, [r(t), f(t), color = blue, thickness = 3], t = 0 .. 40, title = "Saturable Volterra equation fox-rabbit plot", font = [HELVITICA, 20]);