Solving an ode without ode45

5 Ansichten (letzte 30 Tage)
Kebels3
Kebels3 am 24 Mär. 2020
Kommentiert: darova am 24 Mär. 2020
Hi guys,
I want to solve an ODE but i dont want to use ode45. I want to numerically intergrate v and s.
Im stuck at this point.
Can any one of you guys help me out pls?
Greets
Jeroen
F = @(t, x) [x(2); -0.1/50*x(2) - 2*x(1)];
T = 0:0.001:10;
S = [0.5 0];
for a = 1:T
v ( Position + 0.001) = v (Position) + a (Position) * 0.001;
s ( Position + 0.001 = s (Position) + v (Position * 0.001:
end
%%[t, y] = ode45(F, T, S);
plot(t,y)
legend({'Position', 'Speed'});
ylabel('Position / Speed [m / m/s]')
xlabel('Time [s]')
title('Mass-spring-damper system')

Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by