Editor’s Note: This series of blog articles, now combined into one, were originally written as PTC Mathcad Prime 8 worksheets. For the best reading and interactive experience, please download the three worksheets here. If you need a Mathcad Prime worksheet viewer, download Mathcad Prime for free here.
A truck driving on a bridge causes the supporting beams to deflect, resulting in various stresses in the beams. Similarly, as you walk across the floors in your home, the beams or joists deflect under your weight. The deflection is a result of the loading, which is related to the shear, the bending moment, the beam slope, and the beam deflection. In this blog, I will discuss how Mathcad can be used to calculate, plot, and derive these relationships.
Calculate and Plot Shear and Bending Moments in Mathcad
Drawing shear and bending moment diagrams of simply supported beams is one of the tasks in a basic engineering statics course. Mathcad can be used to calculate shears and moments and also draw the shear and bending moment diagrams.
In this blog, I will show how to do this for simply supported beams with varying loading conditions.
I am a proponent of creating functions so that they can be used multiple times, rather than just solving a single problem. So, first, let's create some functions to help solve for and plot the shear and bending moment diagrams for a uniformly loaded, simply supported beam.
The figures in this blog were created in Microsoft PowerPoint as embedded objects. If you download the linked Mathcad file and double-click on the figure, it will open in PowerPoint.
Beam with Uniform Load
Let's first calculate the left reaction, RA, by summing the moment about point B, and then calculate the right reaction, RB, by summing the vertical loads.
Once these functions are written, the results will be tested. A clockwise moment will be considered positive.
The variable "Span" is the length of the beam, and the variable "w" is a uniform load (force/length) along the length of the beam. Because Mathcad is unit aware, the span and load can be in any units of length and force.
The right arrow in the below functions is the Symbolic Evaluation Operator from the Symbolics section on the Math tab. It provides a symbolic solution rather than a numeric solution.
Next, write a function for shear at a distance x by summing the vertical loads. The shear at a distance x from the left is equal to the left reaction less the load applied to the beam between the left and the distance x (w*x).
Now, write a function for the moment at a distance x by summing the moments about x.
Now that the equations are written, calculate and plot the shear and moment diagrams using the XY plot features. Insert the plot from the Plots menu in the Traces section. Select XY Plot from the Insert Plot button.
In order to create the plots, define the values for span and load, and then create a range variable for the points to plot. The range variable is defined by a starting value with the second value setting the step size. The final number is the ending value. It is created just like it looks. Type the first value, then type a comma and enter the second value, which sets the step size. Then, type . . and enter the ending value.
The equation for shear or moment will be on the y-axis.
Test again using metric units. Define values of span and uniform load, and the range variable, z, which will set the points to plot.
Beam with Point Load
Let's now create shear and moment diagrams for a point load, P, placed anywhere along the beam at a distance "a" from the left end. Create functions to describe the loading, shear, and moment. Ignore the beam weight for this exercise. For this example, I use the keyword solve with the Symbolic Evaluation Operator to demonstrate how to solve for RA.
Now that the equations for a point load are written, calculate and plot the shear and moment diagrams using the XY plot features.
In order to create the plots, define the values for span, load, and distance, and then create a range variable for the points to plot.
Beam with Triangular Load
This final example derives the functions for a triangular loading.
Similar to the previous examples, create functions for the reactions, and then create functions for shear and moment.
This example uses the solve keyword with the Symbolic Evaluation Operator to derive the functions for reactions.
Define values for span, loading, and the range variable, z, which will set the points to plot. Display the values of the range variable and the calculated shears and moments that will be included in the plot.
Multiple Loading Conditions
Now that functions for uniform load, point load, and triangular load have been derived, use these functions to combine multiple loading conditions.
For these examples of combining loads, numeric results will be used and values of the loading conditions must be provided. Range variables will be used to define the points to plot and locations to calculate shears and moments. It is important to evaluate the range variable (using the = sign) to convert the range variable to a vector of values.
Note the use of the Vectorization operator in these examples. It is found on the Matrices/Tables tab in the Matrices and Tables section, in the Vector/Matrix Operators button. The Vectorization operator is the bottom operator. (It is also found in the Operators section of the Math tab in the Vectors and Matrix area. The keyboard short cut is CTRL + SHIFT + ^.) It is a right pointing arrow above the expression. It tells Mathcad to perform the operation on an element-by-element basis.
Editor’s Note from the future: Directly converting a range data type to a vector data type is no longer possible as of Mathcad Prime 10. Starting in Mathcad Prime 11, a new numeric function, vec(), was added, which allows for the creation of simple vectors like Brent Maxfield is employing, without creating a range variable first. Watch the video below for more information.
The following examples show a combination of point loads, uniform loads, and triangular loads.
In this blog, I have used shear and bending moment diagrams to illustrate many Mathcad features. In addition, I have shown how to combine functions for uniform load, triangular load, and point loads to calculate and plot reactions, shears, and bending moments. These examples illustrate:
- The significant use of functions
- The power of using the Symbolic Evaluation Operator, including the use of keywords
- The use of Microsoft PowerPoint component to create graphics
- Using XY plots
- Defining range variables for plotting
- Evaluating range variables to create a vector of values
- Using the Vectorization operator to do element-by-element operations
Mathcad for Civil Engineers Webinar Replay
Watch Dr. Pat Heffernan show live examples of how civil and structural engineers use Mathcad Prime.
Watch Webinar Replay
Functions for Deriving Maximum Beam Moment
In this part of the blog, I will show how to derive functions that will provide the maximum moment for the three loading conditions of uniform load, triangular load, and point loads.
Most structural engineers know that for a uniformly loaded beam, the maximum moment occurs at mid-span and the value of the moment is (w*l2)/8. For a point load at the center, the maximum moment is (P*l)/4. If the load is not centered, the maximum moment is (P*a*b)/l and it occurs at the location of the point load. For a triangle load the maximum moment is located at (√3 *l)/3 and it is (√3 *w*l2)/27.
Summary of functions derived in the previous section
Calculating uniform load
Calculating point load
Calculating triangular load
Function for maximum moment for beam with uniform load
Let's first derive the function for maximum moment for a uniformly loaded beam.
Notice from the plot below that the maximum moment occurs at the location where the shear is zero. The shear is equal to the slope of the moment curve, and the slope is zero at the point of maximum moment.
We will use numeric data to plot the shear and moment diagrams and then use this data to find the maximum moment. This data will then be compared to the derived function for maximum moment as a check.
Note that the Vectorization operator is required to have Mathcad perform the calculations on an element-by-element basis. Refer to the end of the previous section for a discussion of the Vectorization operator, or watch the video below.
The location of maximum moment will be calculated in two ways. The first is to use the derived shear function and solve for location where shear is zero. The second way is to take the derivative of the moment function to get a slope function (which is the same as the shear function), and then solve for the location of zero slope. The Derivative operator is located on the Math tab in the Operators section.
The location function for zero shear (and also zero slope) will then be used as the input value of x in the moment function, which will then provide the function for maximum moment.
To derive the formula for the maximum moment for a uniformly loaded bean, find the location of zero shear. Use the symbolic solve keyword to find the location of zero shear.
Use the derived function with the numeric values above to check the function of the maximum moment.
Function for maximum moment for beam with point load
Derive the function for maximum moment for a point load. The maximum moment for a beam with a point load will occur at the location of the point load.
Use the MMaxPoint function to derive the formula for point load centered in a span.
Function for maximum moment for beam with triangular load
Derive the function for maximum moment for a beam with a triangular load.
Use the derived function with the numeric values above to check the result of the maximum moment.
In this blog, I have showed how Mathcad can be used to derive functions for the maximum moment on simply supported beams with uniform load, point load, and triangular load. These examples illustrate:
- The significant use of functions
- The power of using the Symbolic Evaluation Operator with keywords
- Using XY plots with multiple traces
- Defining range variables for plotting
- Evaluating range variables to create a vector of values
- Using the Vectorization operator to do element-by-element operations
- Using the Derivative operator to calculate the slope of a curve
How Mathcad Helped Payne-Huber (ISTI) Achieve Peak Quality Assurance
Read how structural engineering group Payne-Huber Engineering relies on Mathcad Prime.
Read the Case Study
Using Integration to Derive Beam Deflection
In this section, I will derive functions for the shear, moment, slope, and deflection for a uniformly loaded, simply supported beam starting only with the loading condition and using integration. The process will then be repeated for a triangular loading.
When integrating, Mathcad does not include the integration constant C. This will need to be solved using known constraints.
Editor’s Note from the future: PTC Mathcad Prime 10, which released in 2024, added the keyword “standard”, which allows you to receive the integration result with the integration constant. We have retained Brent’s Mathcad Prime 8-era work of deriving the constant below because it’s instructive. For more information on keyword “standard”, watch the video below.
Since the uniform load is acting downward, I will use a negative value for w (force/length).
I will also use some numeric data to verify the calculated functions:
- Beam Length: Length=20 ft
- Uniform Load: W=2.0 kip/ft
- Modulus of Elasticity: E1=29000 ksi
- Moment of inertia: I1=448 in4
Beam with Uniform Loading
Loading
Calculate the left reaction by summing moments about point B.
SHEAR
Calculate the shear function by integrating the load function and including the integration constant C1.
Solve for the integration constant C1. We know that at x=0, the shear is equal to the left reaction, RA.
C1 is equal to Span*w/2. It can now be input into the function for shear, and the function for shear can be redefined without the need for C1 as an input variable.
MOMENT
Calculate the moment function by integrating the shear function and including the integration constant C2.
Solve for the integration constant C2. We know that at x=0, the moment is 0.
C2 is equal to 0. It can now be input into the function for moment, and the function for moment can be redefined without the need for C2 as an input variable.
SLOPE
The relationship for the radius of curvature p, of a beam is defined from mechanics of materials as 1/p = M/(E*I), and the relationship of moment to slope, θ, is defined as M = E * I * d/dx(θ). Calculate the slope by integrating M/(E*I).
There are two ways to solve for C3 for a uniformly loaded beam.
First, we know that for a uniformly loaded beam, the beam slope is equal to zero at the point of maximum moment, and we know that the maximum moment occurs at the location where the shear is equal to zero. The first way to solve for C3 is to calculate the location of zero shear, and use the constraint of slope=0 at the location of zero shear.
The second way to calculate C3 is to wait until the function for deflection is derived and use the two locations where the deflection is equal to zero. Then use two equations to solve for the two unknowns C3 and C4.
DEFLECTION
Calculate the deflection by integrating the slope function. Note that there are two constants of integration that must be solved.
C3 and C4 are unknown. The deflection at x=0 is 0, and the deflection at x=Span is 0. Use these two values to solve for C3 and C4.
C3 is equal to -((span3 * w) / (24 * E * I)). It can now be input into the function for slope, and the function for slope can be redefined without the need for C3 as an input variable. C4 is equal to zero, and C4 can be eliminated.
The below plot has plots of shear, moment, beam slope, and deflection. The values of slope and deflection are multiplied by 100 to allow them to plot at the needed scale. The vertical marker, located at mid-span, is at the location of zero shear, maximum moment, zero slope, and maximum deflection.
Derive a function to calculate the maximum deflection for a uniformly loaded beam. The maximum deflection occurs where the beam slope is 0, where the moment is greatest, and where the shear is 0. This value, VZero, was calculated earlier.
Beam with Triangular Loading
The following example repeats the process used above to derive functions to calculate the shear, moment, slope, and deflection for a triangular loaded beam, beginning with a triangular load function.
LOADING
Calculate the left reaction by summing moments about point B.
SHEAR
Calculate the shear function by integrating the load function and including the integration constant CT1.
Solve for the integration constant CT1. We know that at x=0, the shear is equal to the left reaction, RA.
CT1 is equal to Span*w/6. It can now be input into the function for shear, and the function for shear can be redefined without the need for CT1 as an input variable.
MOMENT
Calculate the moment function by integrating the shear function and including the integration constant CT2.
Solve for the integration constant CT2. The moment at x=0 is 0.
CT2 is equal to 0. It can now be input into the function for moment, and the function for moment can be redefined without the need for CT2 as an input variable.
SLOPE
The relationship for the radius of curvature, p, of a beam is defined from mechanics of materials as 1/p = M/E * I, and the relationship of moment to slope, θ, is defined as M = E * I * d/dx(θ). Calculate the slope by integrating M/E * I.
For the case of triangular loading, the maximum deflection does not occur at the location of zero shear and maximum moment. Because of this, we do not know of any constraints to solve for CT3.
For this case, the only way to solve for CT3 is to wait until the function for deflection is derived and then use the two locations where the deflection is equal to zero to solve for the two unknowns CT3 and CT4.
DEFLECTION
Calculate the deflection by integrating the slope function. Note that there are two constants of integration that must be solved.
CT3 and CT4 are unknown. The deflection at x=0 is 0, and the deflection at x=Span is 0. Use these two values to solve for CT3 and CT4.
Now that CT3 and CT4 are known, the function for slope and deflection can be redefined.
Derive a function to calculate the maximum deflection for a triangular load, which occurs where beam slope equals zero. The solution for x has four solutions.
Check the numeric results and select the 3rd solution for the location of zero beam slope.
Notes: The subscript 3 is obtained using the left bracket [, and the worksheet ORIGIN is set to 1.
The plot below has plots of shear, moment, beam slope, and deflection. The values of slope and deflection are multiplied by 100 to allow them to plot at the needed scale. The left vertical marker is at the location of zero beam slope and at the location of the maximum deflection. The right vertical marker is at the location of zero shear and maximum moment.
In this blog, I have used integration to derive functions for deflection starting only with a loading function. Along the way, I derived functions for shear, bending moment, and beam slope. These functions were checked using known equations from the AISC Steel Construction Manual.
Integration is a powerful tool in the Mathcad tool box. I demonstrated how to solve for the constants of integration by using known constraints and how to use the solve keyword with the Symbolic Evaluation Operator along with other keywords to help derive the desired functions.
In this blog, I used loading on beams to illustrate the concepts, but these same concepts can be used in numerous other fields of science and engineering. The examples in this blog illustrate the use of:
- Functions
- Symbolic evaluation to derive functions, especially when the numeric values are not known
- XY plots with multiple traces
- Vertical markers to illustrate locations on a plot
- Range variables
- Integration and solving for the constants of integration
Up Next
Try PTC Mathcad Prime
Download a free 30-day trial of Mathcad Prime to see the best of Mathcad for yourself.
Get My Trial