Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- clc;
- g = 9.81;
- m = 4000;
- L = 4;
- r_max = 2.2;
- r_min = 1.2;
- theta_min = -20;
- theta_max = 80;
- %values to remember mins and maxs
- F_max = 10000;
- tempFExtension = 0;
- %values to remember angles where you minimise the maximum hydrulic ram
- %force
- thetaFinal =0;
- phiFinal = 0;
- aFinal = 0;
- bFinal = 0;
- for phi = 0:0.5:180
- gamma = phi +20;
- C_2 = (r_max.^2 - r_min.^2)./((cos(gamma + theta_min) - cos(gamma + theta_max)));
- C_1 = r_max.^2 + C_2.*cos(gamma + theta_max);
- a = ((C_1 +C_2).^(1/2)+(C_1-C_2))./2;
- b = C_2./2.*a;
- for theta = -20:10:80
- r = linspace(1.2,2.2,10); % taking all possible values of ram length
- F = (r./(b.*a)).*((m.*g.*L.*cos(theta))./(sin(gamma + theta)));
- % find maximum value of force in vector F
- tempFExtension = max(F);
- if tempFExtension > 0 && tempFExtension < F_max;
- F_max = tempFExtension
- thetaFinal = theta
- aFinal = a
- phiFinal = phi
- bFinal = b
- end
- end
- end
- a
- b
- thetaFinal
- phiFinal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement