You are on page 1of 2

MIE 124

Homework 7

Two important concepts for any engineer to understand are shear forces and bending
moments of beams. A bending moment is the reaction induced in a structural element when an
external force or moment is applied causing it to bend. Similarly, shear force is a reaction
induced in a structural element when an external force is applied. Both bending moment and
shear force can be represented as functions of distance. One important concept to note is that
bending moment is the integral of shear force along the length of the beam.
In this problem, you are given a beam of unknown length that is supported on the left end
of the beam, with a distributed force acting on the beam. The beam has a uniform mass
distribution of 0.25 kg/m which causes a downward gravitational force. The distributed load has
an intensity of 0.75*x, where x is the distance from the left end of the beam. To get the force
caused by this distributed load you must integrate the intensity from 0 to x (more on this below).
Beam

Distributed Load:
0.75x N/m

Your assignment is to determine the length of a beam where the internal bending moment
is zero at the leftmost end of the beam. You will create a function that utilizes root finding to
determine the length of the beam and numerical integration to calculate the internal bending
moment. You will turn in two files, a script and function, named in the same way as previous
assignments.

Function
Create a function with two inputs and two outputs. The inputs are the number of
segments used for integration (N_seg), and the tolerance value at which your root finding while
loop stops (tol). The outputs are the required length of the beam (beam_length) and the number
of iterations used to find the root. All inputs and outputs are scalar values.
1. With your engineering knowledge of beams, you know that the length of the beam must
be between 0.1 meters and 20 meters. Initialize two scalar values called L_lower and
L_upper. These are your root finding brackets.
2. As described below, you will create a sub-function to calculate the value of the bending
moment for any value of the beam length. Use this function to calculate the bending
moment for the upper and lower brackets. These values can be called Moment_upper and
Moment_lower.
3. Use the bisection method to find the root of the bending moment, i.e. the value of
beam_length that causes the bending moment to be 0.
a. Use a while loop that will run until the current value of the absolute approximate
error (e_a) of the root is less than tol.
b. You should initialize e_a to be 1 before the while loop begins and then update it at
the end of the loop for each iteration and store it in a vector.
c. In the while loop, you should store each estimate of the root in a vector called
L_root. You should calculate the bending moment for this value as well and store
it in a vector called Moment_root.
d. Once the while loop has finished set beam_length equal to the value of L_root
(the correct answer is around 9.81 m).
4. Within your main function, create a sub function to calculate the bending moment using
numerical integration. This sub function should have two inputs, N_seg and Length, and
one output Bending_Moment.
a. Initialize a 1 by N_seg vector filled with evenly spaced values of distance
between 0 and Length. This vector should be called x_dist. The linspace
command may be helpful while creating the matrix.
b. Create two 1 by N_seg vectors that are called Distributed_Force and
Gravitational_Force.
i. Distributed_Force should be defined as the integral of the intensity of the
distributed load acting on the beam with respect to x. It is recommended to
do the integral by hand to derive the force function. That is, integrate the
distributed force intensity equation to get an equation for the distributed
force as a function of x. Then you can create the Distributed_Force vector
using this equation.
ii. Gravitational_Force can be calculated as x_dist times the mass per unit
length times gravitational acceleration, 9.81 m/s^2.
c. Create a vector called Shear_Force by summing all of the forces acting on the
beam, where any force acting upwards is positive and any force acting
downwards is negative.
d. Use the trapezoidal rule to calculate the integral of Shear_Force. This can be done
without a for loop.

Script
In your script, do the following.
1. Use a for loop to call your function for tol=10^-6, and N_seg = [2^6 2^8 2^10 2^12
2^14]. In a comment, discuss how the value for the beam length varies with the number
of integration segments.
2. Now call your function for N_seg=2^10, for tol = [10^-2 10^-3 10^-4 10^-5 10^-6 10^-7
10^-8]. Use semilogx and plot the number of iterations on the y-axis versus tol on the x-
axis. Again use a comment to discuss the results.

You might also like