Advertisement
SilLAwNeD

Scilab, tp6 tracevdp function

Dec 3rd, 2018
2,821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.62 KB | None | 0 0
  1. function tracevpd(a, t0, T, Neuler, Nptmil, Nrk4, Node)
  2.     // Approximation euler
  3.     u = euler(a, t0, T, Neuler, vdp);
  4.    
  5.     // Approximation point milieu
  6.     v = pointmilieu(a, t0, T, Nptmil, vdp);
  7.    
  8.     // Approximation runge kutta 4
  9.     w = rk4(a, t0, T, Nrk4, vdp);
  10.    
  11.     // Approximation ode
  12.     tode = linspace(t0, T, Node+1);
  13.     y = ode(a, t0, tode, vdp)
  14.    
  15.     // Euler
  16.     plot(u(1,:), u(2,:), '+');
  17.    
  18.     // Pt milieu
  19.     plot(v(1,:), v(2,:), 'yo');
  20.    
  21.     // RK4
  22.     plot(w(1,:), w(2,:), 'black.');
  23.    
  24.     // ODE
  25.     plot(y(1,:), y(2,:), 'rx');
  26.    
  27.     title('VDP');
  28. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement