Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1.  
  2. clear all;
  3. clc;
  4. g = 9.81;
  5. m = 4000;
  6. L = 4;
  7. r_max = 2.2;
  8. r_min = 1.2;
  9. theta_min = -20;
  10. theta_max = 80;
  11.  
  12. %values to remember mins and maxs
  13. F_max = 10000;
  14. tempFExtension = 0;
  15.  
  16. %values to remember angles where you minimise the maximum hydrulic ram
  17. %force
  18. thetaFinal =0;
  19. phiFinal = 0;
  20. aFinal = 0;
  21. bFinal = 0;
  22.  
  23. for phi = 0:0.5:180
  24. gamma = phi +20;
  25. C_2 = (r_max.^2 - r_min.^2)./((cos(gamma + theta_min) - cos(gamma + theta_max)));
  26. C_1 = r_max.^2 + C_2.*cos(gamma + theta_max);
  27. a = ((C_1 +C_2).^(1/2)+(C_1-C_2))./2;
  28. b = C_2./2.*a;
  29.  
  30. for theta = -20:10:80
  31. r = linspace(1.2,2.2,10); % taking all possible values of ram length
  32. F = (r./(b.*a)).*((m.*g.*L.*cos(theta))./(sin(gamma + theta)));
  33.  
  34. % find maximum value of force in vector F
  35. tempFExtension = max(F);
  36. if tempFExtension > 0 && tempFExtension < F_max;
  37. F_max = tempFExtension
  38. thetaFinal = theta
  39. aFinal = a
  40. phiFinal = phi
  41. bFinal = b
  42. end
  43. end
  44. end
  45. a
  46. b
  47. thetaFinal
  48. phiFinal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement