2012-11-26 66 views
3

我有一个Maxima微分方程组。我正在试图提出解决方案。非线性微分方程解的绘图

diff_eq1: 'diff(p(t),t) = (5/2 + (3^(1/2))/24 - (5/8)*p(t) - ((3^(1/2))/24)*q(t)) * p(t); 
diff_eq2: 'diff(q(t),t) = (7/8 + (3*(3^(1/2))/2) - (3*(3^(1/2))/8)*p(t) - (7/8)*q(t)) * q(t); 
atvalue (p(t), t=0, 0.25); 
atvalue (q(t), t=0, 3); 
sol: desolve([diff_eq1, diff_eq2], [p(t),q(t)]); 
plot2d([rhs(sol[1]), rhs(sol[2])], [t,0,5]); 

但我有一个错误:

plot2d: expression evaluates to non-numeric value everywhere in plotting range. 
plot2d: expression evaluates to non-numeric value everywhere in plotting range. 
plot2d: nothing to plot. 

回答

2

看来最大值一直没有找到解决办法。但是,您可以使用Runge-Kutta方法来获得数值结果。

http://maxima.sourceforge.net/docs/manual/en/maxima_50.html

diff_eq1: (5/2 + (3^(1/2))/24 - (5/8)*p - ((3^(1/2))/24)*q) * p; 
diff_eq2: (7/8 + (3*(3^(1/2))/2) - (3*(3^(1/2))/8)*p - (7/8)*q) * q; 

(p0: 0.25, q0: 3); 
sol: rk([diff_eq1, diff_eq2], [p, q], [p0, q0], [t, 0, 2, 0.1])$ 
pq: map(lambda([x], [x[2], x[3]]), sol)$ 
plot2d([discrete, pq], [xlabel, "p"], [ylabel, "q"]); 
2

看看千里马功能 'plotdf'。它绘制方向场并绘制解(数值计算)。