second order differential equation with variable coefficients
显示 更早的评论
I have to solve this differential equation: m*d^2x/dt^2 +k*x= F(x) where F(x) is known for points
采纳的回答
更多回答(2 个)
Giuseppe Esposito
2017-8-8
0 个投票
1 个评论
Torsten
2017-8-9
... and dxdt has to be a column vector:
function dxdt=myfun(t,x,m,k,Fc);
dxdt=zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(-k*x(1)+Fc(x(1)))/m;
end
Best wishes
Torsten.
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!