Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. function SFD_n_BMD(len,F,a,M,b)
  2.  
  3.  
  4. % Inputs:
  5. % len: Beam length [m];
  6. % F: Concentrated point load [N];
  7. % a: Distance of point load from the left [m]
  8. % M: Applied moment [Nm];
  9. % b: Distance of applied moment from the left [m]
  10. %--STEP 1: CALCULATE REACTIONS R--
  11.  
  12. % reaction force at left support
  13. FBy = (a * F - M) / len; % sum of moments at A(left support) = M + FBy * len - a * F = 0
  14.  
  15. % reaction force at right support
  16. FAy = F - FBy; % sum of forces in y direction = FAy + FBy -F = 0
  17.  
  18. fprintf('Reaction force at left support is %.2fN\n', FAy)
  19. fprintf('Reaction force at right support is %.2fN\n', FBy)
  20.  
  21. %--STEP 2: COMPUTE SF and BM AT SUPPORTS AND LOADING--
  22. x = 0:0.01:len;
  23. V = zeros(length(x));
  24. Mo = zeros(length(x));
  25.  
  26. for i=1:length(x)
  27. % before applied moment
  28. if (x(i) < a) % before point load
  29. Mo(i) = x(i) * FAy; % sum of moments at joint = M - x * FAy = 0
  30. V(i) = FAy; % sum of forces in y direction = FAy - V = 0
  31. else % after point load
  32. Mo(i) = x(i) * FAy - F * (x(i) - a); % sum of moments at joint = M - x * FAy + (x - a) * F = 0
  33. V(i) = FAy - F; % sum of forces in y direction = FAy - V - F = 0
  34. end
  35. % after applied moment
  36. if (x(i) > b)
  37. % before point load: sum of moments at joint = M - x * FAy + M = 0
  38. % after point load: sum of moments at joint = M - x * FAy + (x - a) * F + M = 0
  39.  
  40. Mo(i) = Mo(i) - M;
  41. end
  42. end
  43. %--STEP 3: PLOT SFD and BMD--
  44. subplot(1,2,1)
  45. plot(x, V)
  46. xlabel('x (m)')
  47. ylabel('Shear (N)')
  48. title('SFD')
  49.  
  50. subplot(1,2,2)
  51. plot(x, Mo)
  52. xlabel('x (m)')
  53. ylabel('Bending Moment (Nm)')
  54. title('BMD')
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement