% Ex. 7: 2-span beam - calculate deformed shape EI = 1e6; h = 0.1; x = 0:h:12; Mfree = 80*x - 80*max(x-3,0) - 80*max(x-9,0); Mreactant = 55*x-110*max(x-6,0); M = Mfree - Mreactant; Ro = -90/EI; [R d] = MomentArea(M, EI, h, Ro, 0); subplot(3,1,1); plot(x,M); grid on; ylabel('Bending Moment (kNm)'); subplot(3,1,2); plot(x,1e3*R); grid on; ylabel('Rotation (mrads)'); subplot(3,1,3); plot(x,d*1e3); grid on; xlabel ('Distance Along Member (m)'); ylabel('Deflection (mm)');