Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.62 KB | None | 0 0
  1. V0 = [7.7137, -2.4986 ];
  2. XY = [0,1.6];
  3. G = 9.8066;
  4. Q = 4.648; %верно для нормального ускорения
  5. P1 = -0.2466;
  6. P2 = -1.67;
  7. C3 = 0;
  8. F = @(T,V) [...
  9.    -Q * V(1) - (P1 * (V(1).^2 + V(2).^2)...
  10.    + P2 * sqrt(V(1).^2 + V(2).^2)) * V(1)/sqrt(V(1).^2 + V(2).^2);...
  11.    Q * V(2) - (P1 * (V(1).^2 + V(2).^2)...
  12.    + P2 * sqrt(V(1).^2 + V(2).^2)) * V(2)/sqrt(V(1).^2 + V(2).^2) - G];
  13.  
  14. [T, V] = ode45(F, [0 1.5], V0);
  15.  
  16. for I = 2: numel(V(:,1))
  17.     DT = (T(I) - T(I - 1));
  18.     XY(I,1) = XY(I-1, 1) + V(I - 1, 1)* DT;
  19.     XY(I,2) = XY(I-1, 2) + V(I - 1, 2)* DT;
  20. end
  21. plot(XY(:,1), XY(:,2),'green');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement