Blogs Mathcad Community Challenges 2022 Collection

Mathcad Community Challenges 2022 Collection

January 1, 2023 Mathcad Challenges Index Mathcad Minute Sign-Up

Dave Martin is a Creo, Windchill, and PTC Mathcad instructor and consultant. He is the author of the books “Top Down Design in Creo Parametric,” “Design Intent in Creo Parametric,” and “Configuring Creo Parametric,” all available at amazon.com. He can be reached at [email protected].

Dave currently works as the configuration manager for Elroy Air, which develops autonomous aerial vehicles for middle-mile delivery. Previous employers include Blue Origin, Amazon Prime Air, Amazon Lab126, and PTC. He holds a degree in Mechanical Engineering from MIT and is a former armor officer in the United States Army Reserves.

See All From This Author

Beginning in January 2022, we launched the bimonthly Mathcad Community Challenges on PTC Community. This article discusses the solutions by community members to these six challenges, covering a wide range of applications and use cases:

  1. The Truss Problem
  2. Planetary Gears
  3. Isoperimetric Problem
  4. Area of a Spherical Triangle
  5. Resistors in Parallel
  6. Football Field Goals

Each challenge in this article starts with a description of the challenge, a link to its PTC Community thread where you can download the worksheets (without needing to log in!), and then commentary about those submissions, with concluding learnings about what Mathcad users can learn.

Mathcad Community Challenge January 2022: The Truss Problem

I pulled an old static mechanics problem from my sophomore year in college. I wanted to see how people would solve it today using Mathcad.

Page 88 of “An Introduction to the Mechanics of Solids,” by Stephen H. Crandall, Norman C. Dahl, and Thomas J. Lardner. Plane truss

The figure shows a truss with loads of 15,000 pounds and 10,000 pounds at different points. The truss material is aluminum; all of the outer members of the truss have a cross-sectional area of 4 in², and each of the three inner members has an area of 2 in². We wish to determine how much the length of each member changes due to the loads shown in the figure.

Like many mechanical engineering problems, there are multiple approaches people can take. Terry Hendicott and Dennis Fallon submitted correct answers using different methods. You can download their worksheets and read their discussion here; what follows is commentary about their solutions.

Solution similarities

Terry and Dennis used the same functionality in both their worksheets:

  • Embedded images. As the saying goes, a picture is worth ten thousand words. Any time you can include pictures in your engineering work, you improve communication.
  • Documentation. One of Mathcad’s strengths for performing engineering calculations is explaining your approach as you perform the math. Terry and Dennis made extensive use of Text Blocks and Text Boxes.
  • Constructing vectors with range variables. I rely on programs too much to construct matrices. Dennis and Terry both constructed vectors through the elegant use of range variables and functions that process those range variables.

Now let’s look at some things they did differently in their solutions.

Terry’s approach

Terry knocked my socks off by submitting his detailed solution the very next day after the problem was posted. I did not expect anyone to respond that quickly, and as you can see on the community page, his worksheet is thorough.

His solution essentially takes a finite element approach, using vectors and matrices to construct a stiffness matrix and rotation matrix. Incorporating the constraints and forces allows solving for the deflections. Knowing those values, you can “back out” the individual member forces. This is a vast oversimplification of Terry’s math. I recommend you look for yourself so you can see the power of matrix math for structural analysis.

Based on the response of another user, Terry incorporated Combo Boxes into his sheet. It allows for the solution to be changed based on the material of the truss.

My favorite part of Terry’s worksheet was the creation of a custom plotting program that he used in conjunction with the Chart Component to show the truss in both the original and undeformed shapes.

Mathcad Community Challenge Trusses solution submitted by Terry Hendicott

Dennis’s approach

Dennis solved the problem using equilibrium of forces at the joints and a Solve Block to calculate the forces in the 9 members and the 3 reaction forces. Knowing the forces in each member allows calculation of the stress. The change in length is then calculated via the stress, Young’s modulus, and initial length. Then he calculated the deflection at the middle using the virtual work principle. Very elegant.

He also used a tool that I’ve never used: the table. It’s a way of defining datasets that creates column vectors. My favorite part was the use of the Solve Block. I am a huge fan of that construct, which can be used for solving systems of equations as well as optimizing.

Dennis is the founding dean of the School of Engineering at The Citadel. You can tell his experience as an educator via the apparent simplicity of the solution. I use the word “apparent” because it incorporates fundamental concepts of statics in a way that students can understand and apply for themselves.

In an email to me, Dennis stated that his goal was “to make this more of a learning tool than an actual structural analysis.” I commend that intent. The numerical answers were not the important part of the challenge; the solution approach is.

What can we learn?

Both Terry’s and Dennis’s solutions demonstrate the tools in Mathcad that can be used to solve engineering problems, including variables, units, functions, matrices, Solve Blocks, and Chart Components. They complement the math tools with documentation via text and images. Students and engineering professionals can learn a lot from their solutions. I highly recommend downloading their solutions from PTC Community.

Mathcad Community Challenge March 2022: Planetary Gears

The Mathcad Community Challenge March 2022 was an open-ended invitation to devise a worksheet that evaluates a planetary gear system. Planetary gears are found in mechanical systems including transmissions, motors, and turbines. A planetary gear consists of a sun gear, a ring, a planet carrier, and multiple planets.

Planetary Gear animation

This challenge is tough because planetary gears can have different components as the input, the output, and the stationary member. Depending on the choices, the resulting gear ratio can be overdrive, reduction, or reverse reduction.

Three community members submitted solutions to the challenge: Bert, Adhariya, and Terry. If you haven’t downloaded their worksheets yet, I strongly advise that you do from PTC Community. I guarantee there are techniques in each of them that you can learn from. Before we talk about what they did differently, let’s talk about similarities.

Planetary gear solution commonalities

Documentation.

Bert and Adhariya made excellent use of Text Blocks and Text Boxes to document their solution process. Terry inserted images into his worksheet. Later, I will discuss another aspect of Terry’s worksheet that really set it apart for communicating results.

Combo Boxes.

The input/output Combo Box functionality was introduced in Mathcad Prime 7, and Bert and Adhariya incorporated Combo Boxes into their solutions. Bert used three Combo Boxes to specify the Sun, Planet Carrier, and Ring as either driven, driving, or stationary. Adhariya’s Combo Box allows you to select the stationary member.

Combo Boxes materials properties

Four Uses for Combo Boxes

Learn more about how and why to incorporate Combo Boxes into your worksheets.

All About Combo Boxes

 

Programs.

Given the open-ended problem and the various configurations, I figured it was pretty much impossible to devise any solution that didn’t use programs. Bert’s program issued a warning for an invalid configuration.

Solving for multiple variables simultaneously.

The Solve Block is my favorite tool in Mathcad. It’s a great construct for either solving for or optimizing variables in a system of equations. Terry used the Solve Block to calculate an angle. One thing I like about the two challenges so far is that I have learned new techniques. Adhariya used a function defined as a vector of equations, and then symbolically evaluated the system of equations using the solve keyword. Bert defined a single-row matrix as a vector of a system of equations, and then symbolically evaluated the system using the solve and float keywords to calculate rotational speeds.

Now that we’ve looked at some of the common techniques, let’s discuss some of the aspects that make each worksheet special.

Bert's solution

Bert employs multiple vectors to define the configuration of the system, such as gear teeth, mating teeth, diameters, and rotational speeds. The vector for the diameters is constructed via the vectorize operator, which is a nice touch.

Bert then calculated the normal modules using the built-in Floor function to round a number down, and reset the variables numerically using the clear.sym function. This enabled him to complete the worksheet by calculating the number of teeth of the various members and the gear ratio. This involves some nice use of symbolic evaluation with the simplify keyword.

Adhariya’s solution

As mentioned above, Adhariya’s solution employed extensive text in documentation, vectors with symbolic evaluation for sets of equations, a Combo Box, and programs. It was the easiest to follow. I was expecting someone to use a program with if and else statements to compute the gear ratios based on the user-selected configuration.

One aspect I particularly liked about this spreadsheet were the Tables that symbolically defined velocities and ratios based on the stationary component. I’m rapidly discovering that Tables are an underused gem that facilitates calculations and documentation.

Terry’s solution

The third solution submitted by Terry Hendicott had something I am still trying to figure out. He used multiple traces in a 2D XY plot to depict the arrangement and intermeshing of the teeth of the sun gear, ring carrier, and planets.

Terry Hendicott XY Plot Planetary Gears

What can we learn?

With such an open-ended problem, the variety within the three worksheets show the flexibility of Mathcad’s tools for tackling complex mechanical systems: Combo Boxes, vectors, built-in functions, programs, symbolic evaluation, and more.

Once again, I strongly recommend taking a look at the responses to learn what tools you can add to your toolbox for solving and documenting your engineering problems.

Mathcad Community Challenge May 2022: Isoperimetric Problem

The May 2022 Mathcad Community Challenge asked users to solve an isoperimetric problem:

Create a worksheet in which you calculate (1) the diameter of a circle and (2) the length of a side of a square that yields the minimum combined area for a combined perimeter of 1 meter. This is an optimization problem. What tools within Mathcad can provide you with a result? Optional: How can you depict the results? Can you use a 2D plot or Chart Component to visualize the answer?

Six qualifying solutions were submitted. Once again, if you have not looked at the solutions that people submitted, I strongly encourage you to do so. I guarantee you will learn something. Let’s take a look at what makes each of the submissions special.

Terry Hendicott

Once again, Terry was the first to respond, less than 10 hours after the challenge was posted. Terry used a Solve Block, which is the approach that immediately came to my mind for solving the problem. The Solve Block construct is my favorite tool in Mathcad because of its beauty.

Terry set up his functions. He entered his guess values, constraints, and vector to be minimized. He evaluated the results. To confirm the validity of the solution, he used a program and functions to graph the areas versus inputs on an XY Plot. Fast and correct.

ppal

The second entry by user “ppal” took a slightly different approach. They recognized that one method of finding a maximum or minimum is by evaluating the roots of the first derivative of a function. They set up user-defined functions for the perimeter and area calculations in terms of a single variable, the circle radius. Then they used the derivative operator, symbolic evaluation with the coeffs keyword, and the polyroots function.

My only quibble is that by solving for the radius instead of the diameter, they missed out on the revelation that the diameter of the circle and the length of a side of the square are equal.

Werner

User “Werner_E” remarked that he could not use symbolic evaluation due to using Mathcad Express Prime, the stripped down freemium version of Mathcad Prime. Therefore, he expressed the length of the side of the square in terms of the circle’s diameter; defined functions for the areas of the circle, square, and combined area; and used the root function to solve for the diameter. Another quick and elegant solution (very few functions involved), finished off with a plot of the combined area as a function of the diameter to verify a correct solution.

I liked Werner’s use of the range variable in the plot and units in the variables and functions.

TTokoro

After setting up variables and functions, user “TTokoro” took advantage of the partial derivative operator introduced in Mathcad Prime 8, as well as symbolic evaluation with the solve and simplify keywords, to find the answer. They also used the Combo Box input so users could see the effect of different conditions on the resulting areas, diameter, and square side length.

TTokoro verified the calculations with two XY plots, one for the area, and another that drew the resulting circle and square.

I liked TTokoro’s extensive use of documentation and vibrant colors for both math and text regions. It helped me feel more engaged with their worksheet. Also, nice use of the Draft View to hide certain calculations.

isoperimetric solutions collage ptc mathcad community challenge Left: Terry's Solve Block. Top right: Bengt's chart. Bottom right: Fred's XY Plot.

Fred Kohlhepp

Fred was our second user to solve the problem in Mathcad Express. He set up the area functions, the derivative of the area function, and a roots function to solve for the radius. I like how he documented that his XY Plot verified that the roots did indeed find the minimum value for the combined area as a function of radius. (The derivative can find a minimum or a maximum.)

Like Ttokoro, Fred graphed the circle and square and in XY plot. I like how Fred graphed the two with the same center. This visually depicts that the solution is a circle inscribed in the square. One of the most important aspects of any study is the communication of the results to others.

Bengt Bodine

Like some of the others, Bengt defined functions and performed symbolic evaluation to get to the solution. Their use of the substitute and collect keywords in the symbolic evaluation was unique. I also like the use of different colors for the text regions and math regions. Such a simple approach to differentiate between the two. I’m going to use that in my worksheets.

I especially like the text block that says, “They get equal – neat!” That’s the revelation of the isoperimetric problem: the diameter of the circle and the length of the side of the square are equal.

Bengt also was the only person to depict the results visually with the Chart Component tool. It’s an attractive, publication-ready graph with two y-axes, one for the areas of the circle and square, and the second for the combined area.

The beauty of the challenge

I’ve used Mathcad for fifteen years. I have learned something from every worksheet that has been submitted for the challenge. It might be an approach I had never used before. It might be a way of formatting or documenting the worksheet. It might be a way to depict a solution graphically.

This challenge shows the real beauty of community. People built upon each other’s solutions and discussed the approaches. Most importantly, it shows how many different tools are available to solve problems and communicate the answer. You’d benefit from taking a look at the solutions and downloading the worksheets.

Mathcad Community Challenge July 2022: Area of a Spherical Triangle

The Mathcad Community Challenge July 2022 on the PTC Community site was another geometry problem:
Given the following three points on a circle of radius 10 units, calculate the area of the spherical triangle:
(5.339, 6.948, 4.819)
(-4.018, -3.703, 8.375)
(6.455, -6.679, -3.705)
(Note that the point coordinates are rounded to three decimal places.)

Optional

  • Can you write a program or function that calculates the area for any three points on the surface?
  • Is there a symbolic evaluation for three generic points (a,b,c), (d,e,f), and (g,h,k)?

 

I generated the points using a part model of a sphere in Creo Parametric. With some construction geometry, I was able to trim to the spherical triangle. The area measurement function in Creo came up with a value of 246.72 square millimeters.

Spherical Triangle in PTC Creo 3D CAD

Let’s take a look at the qualifying submissions.

ppal

Username “ppal” was the first to respond, noting that the numbers in the original post indicated a circle not located at the model origin. Yikes! I had written down the coordinates of the second point incorrectly.

ppal submitted a couple worksheets. Referencing Folke Eriksson’s “On the Measure of Solid Angles,” they created vectors for the three points and solved quickly and easily for the area. Nice research! I also like the documentation, use of an image, and color applied to text regions.

A second submitted worksheet defined a function that calculates the spherical triangle using inputs of three-point vectors and the circle radius. The use of vectors makes the function elegant.

Mathcad Prime The Area of Spherical triangle for Spheres of radius R Centered at (0,0,0) can be shown as follows.

Terry Hendicott

As usual, Terry Hendicott was the first to submit a worksheet. Actually, he submitted multiple worksheets, solving for both the incorrect initial numbers as well as the corrected coordinates!

If you have not checked out Terry’s worksheets from previous challenges, I recommend you check those out as well as this month’s. His worksheets are always beautiful, making great use of text, images, color, and highlighting.

mathcad prime girard's theorem area spherical segment given three angles terry Hendicott]

One worksheet used Girard’s Theorem, which calculates the angles of the great circles between the three points, and using the “excess” (the sum of those angles minus pi radians) to calculate the area. He also solved the first optional problem of writing a program that calculated the area as well.

Another worksheet used L’Hillier’s Theorem, which is a really long formula. Even in landscape mode, you have to view the worksheet in Draft mode. Since much of the formula appears under a square root, I don’t think you can use one of Mathcad Prime’s Equation Break operators.

One of Terry’s earlier worksheets used an even longer version of L’Hillier’s Theorem to account for the incorrect coordinates I initially gave. It used symbolic evaluation with the solve keyword to calculate the origin of the sphere.

Terry also built on ppal’s work by using ppal’s formula to solve for the area via symbolic evaluation, which was the second optional challenge. Excellent teamwork! That’s what we like to see in these challenges: people using the power of community to build upon each other’s work.

Johan Eppinga

First-time challenger Johan Eppinga used a Solve Block to determine the center of the sphere and verified it was at the origin. (I love the use of Solve Blocks in this worksheet. Solve Blocks are my favorite construct in Mathcad.)

Then he calculated the distance and angles between points. With the three angles, you can determine the Spherical Excess, which can be used in a formula to determine the area.

For some reason, the area calculation was incorrect. I encourage a user to check their work to determine the error. (The calculation of the angles appears to be incorrect.) Nice worksheet, though.

Summary

Once again, we had multiple submissions that took different approaches to the solution. Do you want to level up your Mathcad skills? I don’t think you’ll find a faster approach than looking at how some Mathcad experts tackle these challenges.

Mathcad Community Challenge September 2022: Resistors in Parallel

The Mathcad Community Challenge September 2022 was by far the most popular so far. Ten people submitted sixteen worksheets. That’s almost three times as many worksheets submitted than the previous record for a challenge. Three people submitted multiple worksheets, and one of those people built on the work of someone else’s worksheet. Exciting stuff. There was also great interaction on the PTC Community board.

Here was the problem:
We have a simple circuit with an electrical potential of 220 Volts. Initially we have a single 10 Ohm resistor. Then we add a second resistor in parallel, with 10% higher resistance. Then we add a third resistor in parallel, with 10% higher resistance than the previous resistor. And so on.

  • Calculate the current in the circuit for the single resistor case.
  • Calculate the resistance of each additional resistor and current through each resistor for 2, 3, 4, 5, and 10 resistors in parallel.
  • Can you write a function or program that calculates the resistance of each resistor and current through each resistor for n resistors in parallel?

Simple Circuit Resistors in Parallel

Confession: I am not an electrical engineer. I thought the math was going to be harder, requiring calculating the equivalent resistance. It didn’t. Therefore, the challenge really comes down to the execution. I’m grading on the methods and the presentation. How did people document and communicate their calculations?
Let’s take a look at the submissions.

The submissions

Cornel Bejan responded first, using programs with for loops and the if-else construct to calculate the correct results. However, I would have liked to see more documentation. If someone else picked up the worksheet, would they understand what was being solved?

Luc Meekes then responded with a worksheet that included documentation, and elegant custom functions that are more complex than they look due to the matrix built-in function. A second worksheet used the if function, then constructed and evaluated a vector inline.

Fred Kohlhepp, another regular contributor, wrote functions for the resistance and current, but then used a transposed vector as the input, and wisely used the vectorization operator when generating the results. Neat stuff. Fred was the first to submit a worksheet that used XY plots. He depicted the trend for equivalent resistance and total current as the number of resistors increases, using a logarithmic scale.

Check out user RantEng’s worksheet. I like the use of documenting the development of the logic for computing the combined resistance, via symbolic evaluation using the substitute and factor keywords. The results are displayed in vectors as well as an XY plot.

Mathcad Community Challenge September 2022 resistors in parallel current calculation solutions collage of worksheets

Return contributor ppal submitted three worksheets. The first solved each case explicitly, and then with functions and vectors, displaying current in each resistor and total current in XY plots. A second used functions and vectors like the others, but was unique in that it used the limit operator and symbolic evaluation to find the resistance and current as the number of resistors approaches infinity (a built-in constant in Mathcad).

Before discussing ppal’s third worksheet, Strib submitted a worksheet that documented a logical approach to solving the problem, including the summation operator which I don’t recall anyone else using prior. ppal built on this approach to solve the problem numerically.

I always like the use of color and creative plots in T. Tokoro’s worksheets. Be sure to view the worksheets in Draft mode to see how those plots are constructed. The plots even depict the circuit, including resistor and battery symbols! But I also like the current versus resistance XY plot and the total current plot using a column trace.

SC_2975838 submitted two versions of the same worksheet. These two show the additional steps of calculating and plotting the power dissipation as well. There’s good use of color for the math regions, but I suggest adding text regions for documentation.

ATSchida’s worksheet had much of same approaches in earlier submissions, but also included a function for the equivalent resistance, using the product and summation operators. I’m embarrassed to admit I’ve never used the product operator. The beauty of the community challenge is being introduced to new tools. A program with a for loop calculates the total current.

The final submission by MJ_9796426 includes the image from the problem (I always like images for documentation). The solution uses programs (for scalability, as noted by MJ in a post) with for loops, summation, and several uses of the matrix row operator, something not seen in previous submissions.

What we can learn

I say this all the time, but every month I am amazed at the skills and techniques in the user community. The running theme is that our community uses such a wide variety of different tools available in Mathcad approaching the same problem. I continue to recommend downloading their worksheets and learning from their examples.

Mathcad for Electrical Engineers

More for Electrical Engineers

Learn more about why electrical engineers rely on PTC Mathcad

Electrical Engineers Calcs

 

Mathcad Community Challenge November 2022: Football Field Goals

The Mathcad Community Challenge November 2022 was based around kicking field goals in American football:
Create a Mathcad worksheet where you calculate the following angles from a given line of scrimmage for making a field goal:

  • The horizontal angle between the left and right field goal posts (18.5 feet apart).
  • The vertical angle between the horizontal bar of the goal post and the upper height of the goal post arms.

How can you show how those angles change as a function of the line of scrimmage?

First off, mea culpa. I added a third challenge involving calculating a kick trajectory based on an old college physics problem, but I forgot to specify the initial velocity as required by the trajectory equation. I messed up worse than Matt Sanchez’s butt fumble.

Or did I…

Fred Kohlhepp

Regular contributor Fred Kohlhepp was the first to get into the end zone. Once again, he submitted a beautiful worksheet with plenty of documentation and color. Given how screwy American football is mixing yards and feet, he was sure to incorporate units into his variables.

Fred used functions and vectors (including the Vectorize operator) to calculate the lateral (horizontal) angle within which a ball would have to be kicked through the uprights from the 20-yard line.

Then he defined a series of equations for horizontal, vertical, and total flight in order to determine the flight time. Since he is using Mathcad Express, he could not use the Solve Block construct. Instead, he used the root function to solve for time for all three equations and graphed all three in a 2D plot with a range variable.

Fred did indeed find the “shallow” angle for the trajectory of this kick but showed that the initial velocity would be more akin to a cannon than a placekicker.

ppal

ppal, another frequent contributor, created a worksheet using the same assumptions as Fred. I had trouble following some of the logic and equations. This worksheet could use a little more documentation. It also seemed to miss the angles requested to be solved. Nice try, but the refs call this one an incomplete pass.

ChaseP

The user with the handle ChaseP won the game though, delivering what I was looking for. They used the Law of Cosines to write a function to calculate the horizontal angle between the left and right goal posts as a function of field position. Then using a range variable, they plotted this from 0 to 100 yards.

It shows exactly the effect I wanted someone to capture. At the 0 yard line, a kicker has a window of almost 18 degrees to make the field goal. But once you get to the 50 yard line (middle of the field, where no one has ever made the kick, the window shrinks to 5.2 degrees.

Then they repeated the process for the vertical angle. At the 0 yard line, you have a 30 degree angle to kick the ball through. But at the 50 yard line, this shrinks to just under 10 degrees.

The use of plots and images in this worksheet are great. It’s important not just to solve for the answer, but to communicate the answer effectively.

In the November 2022 Mathcad Community Challenge, users were asked to calculate angles from a given line of scrimmage for making a field goal. A Chart Component of the horizontal and vertical football field goal angles from line of scrimmage, created by
Dave Martin, based off ChaseP's solution

Conclusion

Although I watch a lot of football, this problem was inspired by a frequent walk I make. Taking my little girl to school or the playground, we often cross a football field. Sometimes I start near the goalpost and walk backwards to see how the angle shrinks. It makes me respect kickers even more.

But here, our challengers (download their worksheets here) have used Mathcad Prime to figure out these angles quantitatively instead of qualitatively. How can you apply Mathcad to solve problems in your everyday life?

Up Next

Check out the challenges from 2023.

The Mathcad Community Challenge series continued to 2023, covering even more topics. Learn From Your Peers
Dave Martin

Dave Martin is a Creo, Windchill, and PTC Mathcad instructor and consultant. He is the author of the books “Top Down Design in Creo Parametric,” “Design Intent in Creo Parametric,” and “Configuring Creo Parametric,” all available at amazon.com. He can be reached at [email protected].

Dave currently works as the configuration manager for Elroy Air, which develops autonomous aerial vehicles for middle-mile delivery. Previous employers include Blue Origin, Amazon Prime Air, Amazon Lab126, and PTC. He holds a degree in Mechanical Engineering from MIT and is a former armor officer in the United States Army Reserves.

Continue Reading