% Cantilever beam, two nodes, cantd.m % W8x31 beam, uniform load = 60 lb/in clear % variables format short e w2 = 60 % uniform load ex = 30e6 % steel elastic modulus ei = ex*110; s = 27.5 % E x I and section modulus Len = 100; f2 = w2*Len/2; m2 = f2 * Len / 6; L2 = 2*ei/Len; L4 = 4*ei/Len L6 = 6*ei/Len^2; L12 = 12*ei/Len^3 beta = L12 * 1e7 stiff = [ L12 L6 -L12 L6 % stiff matrix L6 L4 -L6 L2 -L12 -L6 L12 -L6 L6 L2 -L6 L4 ] df = [ 0*beta; 0*beta; -f2; m2 ] % combined d, F zienk = stiff; zienk(1,1)=zienk(1,1)+beta; zienk(2,2)=zienk(2,2)+beta format short e displ = inv(zienk) * df; % displacements displt = displ' force = (stiff * displ)' % force vector % print the results fprintf('\n Cantilever beam, two nodes, 4x4, cantd ') fprintf('\n Your name, MENG 421, ') disp(date) fprintf('\n Node Deflection Rotation Force Moment\n') for i = 1:2:length(df-2) fprintf(' %2.0f %11.2e %11.2e %5.0f %11.2e \n',... (i+1)/2,displ(i),displ(i+1),force(i),force(i+1)) end % Cantilever beam, two nodes, 4x4, cantd % Your name, MENG 421, 19-Feb-2004 % Node Deflection Rotation Force Moment % 1 -7.58e-009 -6.31e-007 3000 2.50e+005 % 2 -2.27e-001 -3.03e-003 -3000 5.00e+004