Solve a variable and then the second order differential equation (ODE45)
显示 更早的评论
Hello,
I have my dynamic equation M*q'' +C*q'+g=Tau and I created a program using ODE45 to solve q and q' as follows:
qinit=[0;0;0]; % q(0), q'(0) and q''(0)
[t,y] = ode45(@EQM,[0,1],qinit);
function dqdt = EQM(t,q)
Tau=M*q(3) +C*q(2)+g;
dqdt=[q(2);M^-1(Tau-C*q(2)-g)]
But in ode45 the vector returned by ODE function (EQM) and the initial conditions vector (qinit) must have the same number of elements.
What can I do if I need to solve my EQM having a q'' initial condition?
Thanks in advance!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!