How can I save internal variable to a vector with ode45.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
function [dx]= system(t,x)
global m I
F= expression;
u=F+alpha*u(t-1);
dx(1)=x(2);
dx(2)=m*x(1)+u/I;
dx(3)=-m*x(1)-u/I;
dx=[dx(1);dx(2);dx(3)]';
end
[time,Xs]=ode45(@system(t,x),[0:0.1: 7],x01)
x01=[0.05 0.05 0 ]'
I want to save u , and use it to have u(t-1)
2 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!