ode45,Too many output arguments error
2 次查看(过去 30 天)
显示 更早的评论
The equation is complex , I can not get the solution, how can I solve it?
0 个评论
采纳的回答
Jan
2022-3-23
编辑:Jan
2022-3-23
The complete error message is (remember to include it in a question, whenever an error occurs):
The Problem occurs here:
function [du] = mart( t,u )
...
Mt=@(t) 9.6*sin(w*t);
...
F = [m(1)*e(1)*w^2*cwt+c(1)*e(1)*w*swt-c(1)*e(2)*w*swt-k(1)*e(1)*cwt+k(1)*e(2)*cwt+Fz(t)
m(2)*e(2)*w^2*cwt-c(1)*e(1)*w*swt+c(1)*e(2)*w*swt+c(2)*e(2)*w*swt-c(2)*e(3)*w*swt+k(1)*e(1)*cwt-k(1)*e(2)*cwt-k(2)*e(2)*cwt-k(2)*e(3)*cwt
m(3)*e(3)*w^2*cwt-c(2)*e(2)*w*swt+c(2)*e(3)*w*swt+c(3)*e(3)*w*swt-c(3)*e(4)*w*swt+k(2)*e(2)*cwt-k(2)*e(3)*cwt-k(3)*e(3)*cwt-k(3)*e(4)*cwt
m(4)*e(4)*w^2*cwt-c(3)*e(3)*w*swt+c(3)*e(4)*w*swt+c(4)*e(4)*w*swt-c(4)*e(5)*w*swt+k(3)*e(3)*cwt-k(3)*e(4)*cwt-k(4)*e(4)*cwt-k(4)*e(5)*cwt
m(5)*e(5)*w^2*swt+c(4)*e(4)*w*swt-c(4)*e(5)*w*swt-k(4)*e(4)*cwt+k(4)*e(5)*cwt
m(1)*e(1)*w^2*swt+c(1)*e(1)*w*swt-c(1)*e(2)*w*swt-k(1)*e(1)*cwt+k(1)*e(2)*cwt+Fy(t)
m(2)*e(2)*w^2*swt+c(1)*e(1)*w*cwt-c(1)*e(2)*w*cwt-c(2)*e(2)*w*cwt+c(2)*e(3)*w*cwt+k(1)*e(1)*swt-k(1)*e(2)*swt-k(2)*e(2)*swt+k(2)*e(3)*swt
m(3)*e(3)*w^2*swt+c(2)*e(2)*w*cwt-c(2)*e(3)*w*cwt-c(3)*e(3)*w*cwt+c(3)*e(4)*w*cwt+k(2)*e(2)*swt-k(2)*e(3)*swt-k(3)*e(3)*swt+k(3)*e(4)*swt
m(4)*e(4)*w^2*swt+c(3)*e(3)*w*cwt-c(3)*e(4)*w*cwt-c(4)*e(4)*w*cwt+c(4)*e(5)*w*cwt+k(3)*e(3)*swt-k(3)*e(4)*swt-k(4)*e(4)*swt+k(4)*e(5)*swt
m(5)*e(5)*w^2*swt+c(4)*e(4)*w*swt-c(4)*e(5)*w*swt-k(4)*e(4)*cwt+k(4)*e(5)*cwt
Mt % <== here! Mt is a function handle and needs an argument
0
0
0
0];
Maybe you mean Mt(t).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!