Guest User

Untitled

a guest
Feb 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. tic;
  2. x0 = [0 0 0 0];
  3. tspan = [0, 2];
  4. V=-2.5;
  5.  
  6. eoms = @(t,x) [V*x(1)-x(2); V*x(2)-x(3)-x(1); V*x(3)-x(4)-x(2); V*x(4)-x(5)-x(3)];
  7. [t, x] = ode45(eoms, tspan, x0)
  8. toc
  9. plot(t,x)
Add Comment
Please, Sign In to add comment