clear; close all % % COEN45 lab 5, cantilever beam % len = 8; %% length, feet len = 12*len; %% in E = 29.5e6; %% modulus of steel, psi I = 200; %% in^4 % % load condition 1 % w = 100; %% lb/ft w = w/12; %% lb/in [M,V,y,x] = cbeam(len,E,I,w); figure subplot(3,1,1); plot(x,M); title('Load condition 1'); xlabel('distance, in.'); ylabel('moment, in-lb'); grid subplot(3,1,2); plot(x,V); xlabel('distance, in.'); ylabel('shear, lb'); grid subplot(3,1,3); plot(x,y) xlabel('distance, in.'); ylabel('displacement, in'); grid % % load condition 2 % w = 0; P = 500; xP = len/2; [M,V,y,x] = cbeam(len,E,I,w,P,xP); figure subplot(3,1,1); plot(x,M); title('Load condition 2'); xlabel('distance, in.'); ylabel('moment, in-lb'); grid subplot(3,1,2); plot(x,V); xlabel('distance, in.'); ylabel('shear, lb'); grid subplot(3,1,3); plot(x,y) xlabel('distance, in.'); ylabel('displacement, in'); grid % % load condition 3 % w = 100/12; P = 500; xP = len/2; [M,V,y,x] = cbeam(len,E,I,w,P,xP); figure subplot(3,1,1); plot(x,M); title('Load condition 3'); xlabel('distance, in.'); ylabel('moment, in-lb'); grid subplot(3,1,2); plot(x,V); xlabel('distance, in.'); ylabel('shear, lb'); grid subplot(3,1,3); plot(x,y) xlabel('distance, in.'); ylabel('displacement, in'); grid % % load condition 4 % w = 100/12; P = [2000 2000]; xP = [len/2 0]; [M,V,y,x] = cbeam(len,E,I,w,P,xP); figure subplot(3,1,1); plot(x,M); title('Load condition 4') xlabel('distance, in.'); ylabel('moment, in-lb'); grid subplot(3,1,2); plot(x,V); xlabel('distance, in.'); ylabel('shear, lb'); grid subplot(3,1,3); plot(x,y) xlabel('distance, in.'); ylabel('displacement, in'); grid