作者greethux (招呼袜)
看板MATLAB
标题[讨论] 微分方程相关
时间Fri Nov 30 17:43:21 2018
想解xsin(x)+ycos(x)跟xsin(x)-ycos(x)
但不知为何以及哪里错
主程式
x0 = [0 1];
tsp = [0 2];
[x1,x2] = ode45('tseat',tsp,x0);
副程式
function dx = tseat(x1,x2)
dx = zeros(2,1);
dx(1) = x(1)*sin(x)+x(2)*cos(x);
dx(2) = x(1)*sin(x)-x(2)*cos(x);
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.198.183.28
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1543571007.A.654.html
※ 编辑: greethux (114.198.183.28), 11/30/2018 21:14:41
1F:→ book5601: 副程式的X(1)跟X(2)没有定义啊… 12/01 01:04