Advertisement
Guest User

Untitled

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