Blogs Mathcad & Beams: Calculate Shear, Bending, Max Moment, Deflection

Mathcad & Beams: Calculate Shear, Bending, Max Moment, Deflection

February 10, 2023 Mathcad for Civil/Structural Download Prime for Free

Brent Maxfield is from Salt Lake City, Utah. This is an ideal location for him because of his love for outdoor activities. He loves hiking and skiing in the nearby mountains, and also loves to explore the red rock canyons and deserts found in Southern Utah.

Brent Maxfield is a registered Professional Structural Engineer in the State of Utah. He graduated Magna Cum Laude from Brigham Young University with a degree in Civil Engineering and earned a Master of Engineering Management degree from BYU. He has been a practicing structural engineer for 36 years.

He was awarded the 2012 Utah Engineer of the Year by the Utah Engineers Council. He is active in professional associations having served on the Board of Directors of the Structural Engineers Association of Utah and the EERI Utah Chapter. He has also served on the Structural Advisory Committee to the Utah Uniform Building Codes Commission.

He has used PTC Mathcad extensively for 20 years. He is the author of “Essential PTC® Mathcad Prime® 3.0: A Guide for New and Current Users”, available on Amazon.com.

See All From This Author

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

A uniformly loaded simply supported beam made in PowerPoint

 

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.

Sum moments about point B, and then solve for RA to calculate the left reaction. Sum vertical loads and solve for RB to calculate the right reaction: Note: The function for the right reaction uses the function for the left reaction, RA. Test for a 20 foot beam and a 2 kip/ft load. Test for a 10 m beam and a 5kN/m load.

 

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).

Mathcad shear function on a uniformly loaded beam with accompanying figure made in PowerPoint, with test cases

 

Now, write a function for the moment at a distance x by summing the moments about x.

Mathcad calculation for the moment on a uniformly loaded beam

 

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.

Mathcad created range variables for XY Plot shear bending moments feet

 

Mathcad Prime XY Plot uniformly loaded beam shear bending moment in feet

 

Test again using metric units. Define values of span and uniform load, and the range variable, z, which will set the points to plot.

Mathcad-generated ranges for span and loads in meters

 

Mathcad Prime XY Plot uniformly loaded beam shear bending moment in meters

 

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.

Diagram of beam with a point load placed anywhere made in PowerPoint

 

Mathcad creating and solving for shear on a beam with a point load anywhere along the beam with a step function using if logic

 

Mathcad Prime calculate bending moment on a beam with a point load

 

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.

Mathcad Prime defined values for span load distance range variable for XY plot

 

Shear and bending moment diagram for a beam with a point load Mathcad Prime XY 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.

Beam with triangular loading diagram made in PowerPoint

 

Mathcad Prime create functions for triangular loaded beam civil engineering

 

Mathcad Prime shear function triangular loaded beam

 

Mathcad Prime Moment function for triangular loaded beam

 

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.

Mathcad Prime span loading range variables for triangular loaded beam XY plot

 

Mathcad Prime span loading range variables for triangular loaded beam XY 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.

beam combination point loads triangular loads uniform distribution diagram in PowerPoint

 

Mathcad Prime 8 formulas civil engineering loads conditions combination loaded beam shear bending moment

 

Shear and bending moment diagrams for combination-loaded beam XY plot Mathcad Prime

 

Combination point, uniformly, and triangularly loaded beam diagram made in PowerPoint

 

Mathcad Prime civil engineering beam triangular point uniform loaded combination beam values solving function reactions

 

Shear and bending moment plots diagrams for a combination (uniform, triangular, and point) loaded beam XY Plot Mathcad Prime

 

Combination two points, uniformly, and triangularly loaded beam diagram made in PowerPoint

 

Mathcad Prime civil engineering beam triangular two point uniform loaded combination beam values solving function

 

Shear and bending moment plots for a combination (uniform, triangular, and two points) loaded beam XY Plot Mathcad Prime

 

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

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

Deriving functions to calculate for shear and bending moment diagrams for uniform load on a beam in PTC Mathcad Prime.

 

Calculating point load

Deriving functions to calculate for shear and bending moment diagrams for triangular load on a beam in PTC Mathcad Prime.

 

Calculating triangular load

Deriving functions to calculate for shear and bending moment diagrams for uniform load on a beam in PTC Mathcad Prime.

 

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.

Deriving the function for maximum moment for a uniformly loaded beam.

 

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.

To find the location of zero shear, and thus maximum moment, use the function VZero1 as the input value of x in the function for moment.

 

Use the derived function with the numeric values above to check the function of the maximum moment.

Formulas for checking the function of the maximum moment of a uniformly loaded beam.

 

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 Vectorization operator when calculating maximum moment for a point load in Mathcad Prime. Shear is 0 at the location of the point load.

 

Calculate maximum moment of a point load for the maximum point, maximum value of the vector M2, and at a distance of VZero.

 

Use the MMaxPoint function to derive the formula for point load centered in a span.

The MMaxPoint function derives the formula for maximum moment for a point load at the center of a beam.

 

Function for maximum moment for beam with triangular load

Derive the function for maximum moment for a beam with a triangular load.

Setting up Mathcad Prime variables to derive the function for a beam with triangular load.

 

Function for deriving maximum moment for a beam with a triangular load.

 

Function for deriving maximum moment for a beam with a triangular load with function for slope and location of zero shear

 

Use the derived function with the numeric values above to check the result of the maximum moment.

Check the results of the maximum moment calculations and see that they match for the value of the MMax function, the vector M3, and at a distance of VZero.

 

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

heavy equipment

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
Mathcad Prime variable definitions numeric data to verify the calculated functions

 

Beam with Uniform Loading

Loading

Uniform loaded Beam W to calculate loading deflection from

 

Calculate the left reaction by summing moments about point B.

Formula to sum moments around point B for a uniform loaded beam.

 

SHEAR

Calculate the shear function by integrating the load function and including the integration constant C1.

Formula to integrate the load function and include 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.

Symbolic solving for the integration constant C1 for shear of uniform loaded beam

 

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.

Shear function plotted in Mathcad Prime for uniform load beam

 

MOMENT

Calculate the moment function by integrating the shear function and including the integration constant C2.

Moment function formula for uniform load beam including the integration constant C2.

 

Solve for the integration constant C2. We know that at x=0, the moment is 0.

Symbolic solution for integration constant C2 for moment of uniform load beam

 

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.

Mathcad Prime plot and function of moment for uniform loaded beam

 

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).

Function for slope of beam with uniform load derived with integration in Mathcad Prime with constant of integration

 

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.

Symbolic solving functions for slope on uniformly loaded beam in Mathcad Prime solving for constant of integration

 

DEFLECTION

Calculate the deflection by integrating the slope function. Note that there are two constants of integration that must be solved.

Calculation for deflection of uniformly loaded beam by integrating the slope function

 

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.

Derivation for deflection of a uniformly loaded beam solving for constants of integration

 

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.

Formulas and plots in Mathcad Prime for slope and deflection for a uniformly loaded beam

 

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.

PTC Mathcad Prime plot of uniform load beam of zero shear maximum moment zero slope maximum deflection formulas calculations

 

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.

Mathcad function calculating the maximum deflection for a uniformly loaded beam

 

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

Triangular loaded beam diagram and loading plot

 

Calculate the left reaction by summing moments about point B.

Calculation of left reaction by summing moments around Point B for triangular loaded beam

 

SHEAR

Calculate the shear function by integrating the load function and including the integration constant CT1.

Calculation of the shear function when 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.

Calculation solving for the integration constant CT1.

 

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.

Span*w/6 input into the function for shear of triangular loaded beam and plotted.

 

MOMENT

Calculate the moment function by integrating the shear function and including the integration constant CT2.

Calculating the moment function by integrating the shear function and including the integration constant CT2 for triangular loaded beam

 

Solve for the integration constant CT2. The moment at x=0 is 0.

Calculation solving for the integration constant CT2

 

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.

CT2 input and plotted into the function for moment for triangular loaded beam in Mathcad Prime.

 

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.

Calculation of slope on triangularly loaded beam when integrating moment function.

 

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.

Deriving formula for deflection by integrating slope function of triangular load beam with constants of integration

 

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.

Deriving formula for deflection by integrating slope function of triangular load beam with constants of integration

 

Now that CT3 and CT4 are known, the function for slope and deflection can be redefined.

Functions for slope and deflection triangular load beam redefined and plotted.

 

deflection triangular load beam plotted

 

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.

Mathcad Prime symbolic calculation solve operator for defining the maximum deflection for a triangular load, which occurs where beam slope equals zero.

 

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.

Calculations determining the deflection of a triangularly loaded beam by integrating slope zero, and checking the numeric results and selecting the 3rd solution

 

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.

PTC Mathcad Prime plot of triangular load beam of zero shear maximum moment zero slope maximum deflection formulas calculations

 

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
Brent Maxfield

Brent Maxfield is from Salt Lake City, Utah. This is an ideal location for him because of his love for outdoor activities. He loves hiking and skiing in the nearby mountains, and also loves to explore the red rock canyons and deserts found in Southern Utah.

Brent Maxfield is a registered Professional Structural Engineer in the State of Utah. He graduated Magna Cum Laude from Brigham Young University with a degree in Civil Engineering and earned a Master of Engineering Management degree from BYU. He has been a practicing structural engineer for 36 years.

He was awarded the 2012 Utah Engineer of the Year by the Utah Engineers Council. He is active in professional associations having served on the Board of Directors of the Structural Engineers Association of Utah and the EERI Utah Chapter. He has also served on the Structural Advisory Committee to the Utah Uniform Building Codes Commission.

He has used PTC Mathcad extensively for 20 years. He is the author of “Essential PTC® Mathcad Prime® 3.0: A Guide for New and Current Users”, available on Amazon.com.

Continue Reading