Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Pee computation

By: a guest on Nov 11th, 2013  |  syntax: MatLab  |  size: 0.42 KB  |  hits: 33  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. r=0.004;
  2. m = (4*pi*r^3 / 3 * 1000);
  3. A=pi*r^2;
  4. cd=0.5;
  5. rhoair=1.29;
  6. a = 1/2*rhoair*cd*A/m;
  7. b=9.81;
  8.  
  9. t=0:0.01:5;
  10.  
  11. y=sqrt(b/a)*tanh(sqrt(a*b)*t);
  12. p=cumtrapz(t,y);
  13.  
  14. ax=plotyy(t,y,t,p);
  15. hold on
  16. plot(t, sqrt(b/a)*ones(1, numel(t)), 'r:')
  17. hold off
  18. xlabel('time')
  19. legend('velocity [m/s]', 'terminal velocity', 'distance [m]', 'Location', 'SouthEast');
  20. ylabel(ax(1), 'velocity [m/s]');
  21. ylabel(ax(2), 'distance [m]');