% Scrip to calculate the deflection (y) of a cantilever beam
% subject to a linearly decreasing load (W)
% W = load at station x (N/m)
% Wo = maximum load at station x=0 (N/m)
% E = Modulus of elasticity (N/m-m)
% I = Moment of inertia (m-m-m-m)
% x = beam station = distance from datum point (wall) to any point on the
% beam (m)
% l = beam length (m)
% y = beam deflection at any station (m)
% Deflection equation
% y = -Wo * x.^2 / (120*E * I * length_of_beam) .* (10 * length_of_beam^3 ...
% - 10 * length_of_beam^2 .*x + 5 * length_of_beam .* x.^2 - x.^3);
% Beam properties
Wo = 6000; % Newtons/m
E = 200e9; % N/m-m - value for Steel = 200e9
I = 0.001; % meters to the fourth power
length_of_beam = 9; % meters
%1.Use linspace to create x
%2.Calculate deflection to the beam at any point in the beam length
%3.Plot the deflection