Mat Lab
Mat Lab
MATLAB.
% Input Parameters
L = 3; % Length of the column in meters
A = 4000; % Cross-sectional area in mm²
I = 8e6; % Moment of Inertia in mm⁴
E = 2e5; % Modulus of Elasticity in MPa (for steel)
fy = 250; % Yield stress in MPa
K = 1; % Effective length factor (1 for pinned-pinned)
P_applied = 400e3; % Applied axial load in N
% Calculations
L_eff = K * L * 1000; % Effective length in mm
r = sqrt(I / A); % Radius of gyration in mm
lambda = L_eff / r; % Slenderness ratio
% Safety Check
if P_applied < min(P_cr, P_yield)
status = 'SAFE under applied axial load';
else
status = 'FAILURE possible - exceeds critical capacity';
end
% Display Results
fprintf('\n--- Steel Column Analysis ---\n');
fprintf('Length (m): %.2f\n', L);
fprintf('Area (mm²): %.2f\n', A);
fprintf('Moment of Inertia (mm⁴): %.2e\n', I);
fprintf('Slenderness Ratio (λ): %.2f\n', lambda);
fprintf('Euler Critical Load (N): %.2f\n', P_cr);
fprintf('Yield Load (N): %.2f\n', P_yield);
fprintf('Applied Load (N): %.2f\n', P_applied);
fprintf('Status: %s\n', status);
% Input Parameters
L = 6; % Length of the beam in meters
b = 150; % Width of the beam in mm
h = 300; % Height (depth) of the beam in mm
E = 2e5; % Modulus of Elasticity of steel in MPa
fy = 250; % Yield strength in MPa
w = 20e3; % UDL in N/m
% Calculations
I = (b * h^3) / 12; % Moment of inertia in mm^4
Z = I / (h / 2); % Section modulus in mm^3
% Bending Stress
f_bending = M_max_mm / Z; % in MPa
% Display Outputs
fprintf('\n--- Steel Beam Analysis ---\n');
fprintf('Beam Length (m): %.2f\n', L);
fprintf('Section (b x h in mm): %d x %d\n', b, h);
fprintf('Moment of Inertia (mm⁴): %.2e\n', I);
fprintf('Section Modulus (mm³): %.2e\n', Z);
fprintf('Max Bending Moment (N·m): %.2f\n', M_max);
fprintf('Bending Stress (MPa): %.2f\n', f_bending);
fprintf('Max Shear Force (N): %.2f\n', V_max);
fprintf('Average Shear Stress (MPa): %.2f\n', tau_avg);
fprintf('Max Deflection (mm): %.2f\n', delta_max);
fprintf('Status: %s\n', status);