Solving an ode without ode45

2 次查看(过去 30 天)
Kebels3
Kebels3 2020-3-24
评论: darova 2020-3-24
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')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by