Docsity

MATLAB Code | Engineering Analysis Using Numerical Methods | ME 2004, Study notes of Mechanical Engineering

Toggle sidebar
bg1
Problem 3.10, Chapra
Description
A simply supported beam is loaded as shown.
The deflection along the beam is
xxxxxxxu
y
25.238
6
57
7758
6
15
50
6
5
)(
3
2344
The singularity function is defined as
ax
axax
ax
n
n
,0
,
Objectives
1. Develop a function M-file to compute the singularity function.
2. Develop a function M-file to compute the displacement of the beam as a function of
position along the beam. The first line should be:
function uy = beamSimplySupported(x)
Use the singularity function developed in part (1).
3. Develop a separate “driver” function M-file to compute and plot the displacement of the
beam as a function of position.
pf3
pf4

Partial preview of the text

Download MATLAB Code | Engineering Analysis Using Numerical Methods | ME 2004 and more Study notes Mechanical Engineering in PDF only on Docsity!

Problem 3.10, Chapra Description A simply supported beam is loaded as shown. The deflection along the beam is

u y x  x   x    x   x   x   x

  238. 25 6 57 8 75 7 6 15 0 5 6 5 ( )^3 4 4 3 2 The singularity function is defined as

         x a x a x a x a n n 0 , , Objectives

  1. Develop a function M-file to compute the singularity function.
  2. Develop a function M-file to compute the displacement of the beam as a function of position along the beam. The first line should be: function uy = beamSimplySupported(x) Use the singularity function developed in part (1).
  3. Develop a separate “driver” function M-file to compute and plot the displacement of the beam as a function of position.

MATLAB Code: Vectorized function y = singularity(x,a,n) % Syntax: % y = singularity(x,a,n) % input: % x, a, n % output: % y y = (x-a).^n .* (x>a); function uy = beamSimplySupported(x) % Displacement along a simply supported beam % syntax: % uy = beamSimplySupported(x) % input: % x = position along beam (ft) % output: % uy = displacement (ft) uy = -5/6*( singularity(x,0,4) - singularity(x,5,4) )...

  • 15/6*singularity(x,8,3)...
  • 75singularity(x,7,2) + 57/6x.^3 - 238.25*x; function beamSimplySupported_plot %% Problem 3.10, Chapra % Plot of the deflection of a simply supported beam. % Vectorized %% compute solution at each x x = linspace(0,10); uy = beamSimplySupported(x); %% create plot close all plot(x,uy,'linewidth',2) title('Deflection of a Simply Supported Beam') xlabel('Position, x') ylabel('Deflection, uy')

Results 0 1 2 3 4 5 6 7 8 9 10

  • 0 Deflection of a Simply Supported Beam Position, x Deflection, uy Comments Both the vectorized and non-vectorized codes produce exactly the same graph. The vectorized methodology is much more efficient and simple and is more natural with the basic data structure in MATLAB: the MATtrix. The units for the displacement are probably 10-6^ ft since 500 ft displacements make no sense on a real beam. We would have to study the original derivation of the beam displacement equation to find out for sure.