second order differential equation with variable coefficients
Mostra commenti meno recenti
I have to solve this differential equation: m*d^2x/dt^2 +k*x= F(x) where F(x) is known for points
Risposta accettata
Più risposte (2)
Giuseppe Esposito
il 8 Ago 2017
Giuseppe Esposito
il 8 Ago 2017
0 voti
1 Commento
Torsten
il 9 Ago 2017
... 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.
Categorie
Scopri di più su Numerical Integration and Differential Equations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!