Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function [ dy ] = Cricket_Model_1(t,Y)
  2.  
  3. % Define Variables
  4. % Y(1) = Horizontal Displacement (x)
  5. % Y(2) = Horiztonal Velocity (u)
  6. % Y(3) = Vertical Displacement (y)
  7. % Y(4) = Vertical Velocity (v)
  8.  
  9.  
  10. %Declare constants
  11. % g = gravity
  12. % Cd = drag coefficient of baseball
  13. g=9.81;
  14. Cd=0.346;
  15.  
  16. dy= zeros (4,1); %define speed
  17.  
  18. %
  19. dy(1)= Y(2); %horizontal velocity
  20. dy(2)= -Cd*Y(2); %horizontal acceleration
  21. dy(3)= Y(4); %vertical velocity
  22. dy(4)= -g; % vertical acceleration
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement