Advertisement
Guest User

Radial acceleration due to rotation

a guest
Sep 12th, 2011
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.38 KB | None | 0 0
  1. # http://www.youtube.com/watch?v=Im2JdZ_bvFI
  2.  
  3. v0 = 0
  4.  
  5. #constants
  6. time = 0;
  7. end_time = 1;
  8. steps = 1*25000; # cover the time period in that many intervals. Te more, the higher is precision
  9. dt = end_time/steps;
  10. t = 0:dt:end_time;
  11. steps = length(t);
  12. w = 2*pi; # angular speed
  13.  
  14. #initial values
  15. b = 0; # arm angle
  16. a = 0; # speed angle with respect to arm push direction (arm normal vector) before push
  17. v = 0; # speed vector length
  18. g = 0; # speed angle with respect to arm push direction (arm normal vector) after push. Normal component is increased, horizontal - intecat.
  19. r = 1; # initial radius
  20.  
  21. v = 500; a = 1*99.9 /180 * pi;
  22.  
  23. v_records = zeros(1, steps);
  24. a_records = zeros(1, steps);
  25. r_records = zeros(1, steps);
  26. b_records = w*t;
  27.  
  28. db = w * dt;
  29. #b = b + db;
  30.  
  31. ctb = cot(db);
  32. for i = 2:steps
  33.   vsina = v * sin(a);
  34.   wr = w * r ;
  35.   v = sqrt(vsina^2 + wr ^2); # absolute speed
  36.   tg = vsina / wr; # tg(g), g = arctg(tg);
  37.   #printf("%d: r=%f, a=%f, b=%f, v=%f, g=%f, tg=%f\n", i, r, a, b, v, g, tg);
  38.   g = atan(tg);
  39.   r = r * sqrt(1+ctb^2) / (ctb-tg); # mult raises r due to tangent move vertically up, div by (ctg-tg) due to moving away from center (horizontal)
  40.   a = db + g;
  41.   r_records(i) = r * 10;
  42.   v_records(i) = v;
  43.   a_records(i) = a*180/pi*100;
  44. end
  45.  
  46.  
  47. plot (t, r_records, ";radius;", t, v_records, ";absolute velocity;", t, a_records, ";decline from tangent;");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement