Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tic
- L = 40; %length of beam in m
- b = 10; %distance between forces in m
- P_1 = 200; %force in kN
- P_2 = 300; %force in kN
- %x-coord of P_1 in m
- x = linspace(-b,L,500);
- %deflection * EI at the middle of the beam due to P_1
- d_1 = zeros(1,length(x));
- %d_1*EI when P_1 is located before the middle of the beam
- d_1( (x<L/2) & (x>=0)) = P_1 .* x( x<L/2 & x>=0) .* (L/2) .* ...
- (L^2-x( x<L/2 & x>=0 ) .^2 -(L/2)^2) ./ (6*L);
- %d_1*EI when P_1 is located at or after the middle of the beam
- d_1(x>=L/2 & x<=L) = P_1 .*(L-x(x>=L/2 & x<=L)) .* (L/2) .* ...
- (L^2 - (L - x(x>=L/2 & x<=L)).^2 -(L/2)^2) ./ (6 .* L);
- %deflection * EI at the middle of the beam due to P_2
- d_2 = zeros(1,length(x));
- %d_2*EI when P_2 is located before the middle of the beam
- d_2( (x+b<L/2) & (x+b>=0)) = P_2 .* (x( x+b<L/2 & x+b>=0)+b) .* (L/2) .* ...
- (L^2-(x( x+b<L/2 & x+b>=0 )+b) .^2 -(L/2)^2) ./ (6*L);
- %d_2*EI when P_2 is located at or after the middle of the beam
- d_2(x+b>=L/2 & x+b<=L) = P_2 .*(L-(x(x+b>=L/2 & x+b<=L)+b)) .* (L/2) .* ...
- (L^2 - (L - (x(x+b>=L/2 & x+b<=L)+b)).^2 -(L/2)^2) ./ (6 .* L);
- %deflection*EI of the beam at the center if there was no support at B
- d_3 = d_1 + d_2;
- %Support B is added back in as an upward force that makes the deflection zero
- %at the centre of the beam
- B_z = 48 .* d_3 ./ L^3;
- plot(x,B_z,'-b')
- hold on
- [a,I] = max(B_z);
- %the value of x that gives the max value for B_z
- max_x = x(I)
- plot(max_x,a,'xk','MarkerSize',15)
- toc
Advertisement
Add Comment
Please, Sign In to add comment