makispaiktis

PROS_Exercises1_sim

Mar 2nd, 2021
671
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. % Παραμετροι
  2. m = 1;
  3. k = 100;
  4. b = 2;
  5.  
  6. % Function Handle
  7. u = @(t) sin(t);
  8.  
  9. % Initial State
  10. x0(1) = 0;
  11. x0(2) = 1;
  12. tspan = [0 10];
  13.  
  14. % Simulation
  15. [t, state] = ode15s(@(t, state)PROS_Exercises1_msd(t, state, m, b, k, u), tspan, x0);
  16.  
  17. % Plot
  18. figure(1);
  19. plot(t, state(:, 1));                % Θεση
  20. figure(2);
  21. plot(t, state(:, 2));                % Ταχυτητα
  22. % Φυσικο πορτρετο - Τροχια
  23. figure(3);
  24. plot(state(:, 1), state(:, 2));
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×