%% simulation ODE dv/dt = (F - k * v )/ m; % Constant m = 1000; % mass % Parameters k = 50; F = 2000; % Variable v0 = 20; tspan = [0, 200]; % ODE equation dvdt = @ (t,v) (F - k * v )/ m; % solution [tSol, vSol] = ode45(dvdt, tspan, v0); plot(tSol, vSol, 'b-', 'LineWidth', 3); title('velocity')