Solving an ode without ode45

4 views (last 30 days)
Kebels3
Kebels3 on 24 Mar 2020
Commented: darova on 24 Mar 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')

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!