Saturday, September 7, 2013

Beam with uniformly varying distributed load: Matlab


Matlab program solves problem 6-73 of the textbook
"Mechanics of Materials", 8th. edition, by Hibbeler.

Applying the symmetry of the problem, only half of the beam
is calculated.


% prob6_73.m
% Ricardo E. Avila, Sep. 6, 2013
% Universidad Autonoma de Ciudad Juarez, Mexico

clc
clear
disp(' ')
disp('Problem 6-73, Hibbeler, "Mechanics of Materials", 8th. ed.')

% Data input section

% The units of the problem are US customary, not SI (Lb, inch)
% A beam supports a uniformly varying load applied on 24 ft. span length.   
% At midpoint of beam load is 500 Lb/ft, going down to 0 at both ends.
% Only half the problem is solved (12 ft.), using symmetry of beam.

I = 152.34;             % Moment of inertia, in^4, steel beam section.
E = 29e6;               % Elastic modulus, Lb/in^2, ASTM A-36 steel
delta_x = .5;           % Increment for discretization of x axis.
x = (0: delta_x: 144)'; % Generate column array for x-axis. 

N = size(x, 1);         % Size of the x-axis discretization

V = zeros(N, 1);        % Shear force function of x.
M = V;                  % Bending moment function of x.
y = V;                  % Coordinates of elastic curve.
C1 = -1250 * 12^4;      % Integration constant. (dy/dx) = 0 @ x = 144 in.

 

% Data processing section

for index = 1: N;   % For every discrete point along x.
   % First half of the beam, 0 < x < 144 (inch)
   V(index) = 3000 - 1.446759259259259e-001 * x(index)^2;
   M(index) = 3000 * x(index) - 4.822530864197531e-002 * x(index)^3;
   y(index) = 500 * x(index)^3 ...
       - 2.411265432098765e-003 * x(index)^5 + C1 * x(index);
end

y = y / (E*I); % E and I are constants, through the beam length.

% Data post-processing section

% Shear force diagram
figure(1)
plot(x,V, 'b', 'linewidth', 2.5)
grid
xlabel('x, inch')
ylabel('Shear force, Lb')
title('Shear force diagram')
axis tight

% Bending moment diagram
figure(2)
plot(x,M, 'r', 'linewidth', 2.5)
grid
xlabel('x, inch')
ylabel('Bending moment, Lb-in')
title('Bending Moment diagram')
axis tight

% Beam deflection: elastic curve
figure(3)
plot(x,y, 'k', 'linewidth', 2.5)
grid
xlabel('x, inch')
ylabel('Elastic Curve, in')
title('Bending Deflection')
axis tight

format long e
disp('Maximum deflection of beam: ')
disp(min(y))
disp(' ')
format short

disp('*** Successful execution of program ***')

% end of Matlab program
_____________________________________________________________________

Problem 6-73, Hibbeler, "Mechanics of Materials", 8th. ed.
Maximum deflection of beam:
   -5.407113851502764e-001


*** Successful execution of program ***

_____________________________________________________________________

figure(1)


figure(2)
 


figure(3)



No comments:

Post a Comment