k_cleanup();
k_unitsPreferenceActivate('mm_N_s');
k_unitsVariables('ft, mm, in, ksi, kg, m, G');

%% Define the parameters
L = 1*ft; 
h = 3*mm;
b = 1*in;
E = 29e3*ksi;
rho = 7860*kg/m^3;

%% Additional calculations
% Bending moment of inertia, I
I = (1/12)*b*h^3;

% Beam total mass
A = b*h; % beam cross-sectional area
M_beam = rho*A*L;

% Distributed load, w
w = M_beam*G/L;

% yMax is at x = L
x = L;
yMax = (w/(24*E*I))*(x^4 - 4*L*x^3 + 6*L^2*x^2);
display(yMax)

yMax = yMax.convert('in');
display(yMax)




