Blogs Mathcad Community Challenge September 2025: Algorithm Programming

Mathcad Community Challenge September 2025: Algorithm Programming

October 28, 2025 Download Entrants’ Worksheets Visit Prior Challenges Index

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

I was inspired by Dijkstra’s algorithm for the September 2025 Mathcad Community Challenge. Dijkstra’s algorithm finds the shortest path from a single source to all the other nodes in a network, based on weighting. I came up with a much simpler, manageable scenario that people could apply Mathcad’s programming functionality to solve. This challenge involved points in a 2D plot, and the weighting was the distance between the points.

Sample of a 2D plot of 10 nodes created in PTC Mathcad Prime. The challenge is to find the shortest distance between these points

The Challenge

Challenge 1: Known Points
For the provided points, write a program to calculate the shortest path from the first node (5,5) to all other nodes, always choosing the shortest path from the current node.
Challenge 2: Graphing
Create a Chart Component or XY Plot that graphs this path.
Challenge 3: Advanced Inputs
Incorporate advanced input controls to allow the user to change quantities such as the number of points or generate new points / path.
Challenge 4: 3D
Can you write a program that performs the same calculation, but for points in 3D instead of 2D?

The Submissions

We had six main contributions from two of our loyal repeat contributors, Werner E and Alan Stevens.

Werner E submitted two worksheets. The first has a very clean look, incorporating a slider advanced input control for the user to change the number of points, a list box to control the index of the start node, and a button to change the number of nodes. The path length and XY plot update with the user inputs. It’s fun to play with.

The math is contained in two collapsed area and the draft view. They contain six programs with the algorithms for both 2D and 3D. The programs themselves are relatively short and elegant. While this solution was submitted relatively quickly on the day that the challenge was issued, a couple of the programs could benefit from additional documentation, especially if someone were to access the worksheet for the first time. (I find it is generally a best practice to make worksheets that “stand on their own.”) The first four programs have great explanations for what they do.

The second worksheet appears to incorporate guardrails to prevent too many solution iterations, which can lock up a worksheet. That’s a nice touch. It also contains clearer XY Plots for the closed loop and the open loop solutions. There is a nice 3D plot for the solution in 3D, but for some reason it is hidden away in the draft view.

One of Werner's submissions for the Mathcad Community Challenge September 2025, creating the Traveling Salesman algorithm in PTC Mathcad Prime. His worksheet features several Advanced Controls (slider, button, listbox), 2D plots, and a 3D plot, as well as extensive programming hidden in areas

Alan Stevens submitted four worksheets, which is even more impressive when you consider that he participates every month using Mathcad Prime Express.

The Express version does not have programming functionality. Therefore, Alan took more of a brute force approach using function definitions to calculate distances and construct a new matrix of the ordered points. The new matrix is used to plot the path on an XY Plot.

Alan’s second worksheet took on the fourth challenge, tackling the problem in 3D. He adapted the functions from his first worksheet to incorporate the Z-direction. Given that the Express version does not support 3D plots, he created 3 XY Plots in which the points and the paths are projected onto the x-y, x-z, and y-z planes.

Alan Stevens graphing the shortest path between 10 points in the Mathcad Community Challenge September 2025. He split what would be a 3D plot into three 2D plots, with the 2D plots showing the x-y, x-z, and y-z planes

His third worksheet tackled the 3D plotting limitation even more. He created a new variable gamma for the rotation of the plot. Then using a couple of custom functions in a collapsed area, he calculates the y-axis for the rotated simulation of the 3D plot, the projection of the points, and the vector connecting the paths. This kind of logic reminded me of video game graphics from the 1980s or the M2 Bradley Fighting Vehicle simulator I used to use at Fort Knox in the early 1990s.

Alan’s final worksheet is really impressive, as it replicates the 3D plot from the regular Mathcad Prime version. It’s pretty cool looking. I recommend you check it out. That’s quite a bit of ingenuity to replicate 3D plotting in 2D.

Alan Stevens submission for the Mathcad Community Challenge September 2025. He recreates the look of a 3D plot using the 2D XY plots available to him in PTC Mathcad Express

There was an additional submission from a community member with the username Uni. He used AI to solve the problem. We haven’t made any rules regarding AI in the challenge. However, we know that engineers and scientists use AI all the time in their programming and problem solving. I’m sure that one day we will see AI in Mathcad, Creo, and Windchill. I was eager to see what AI came up with in its approach.

User Uni (Viacheslav N. Mezentsev) used a combination of custom function .dlls and an external generative AI program to develop a PTC Mathcad Prime worksheet to solve the Mathcad Community Challenge September 2025

However, the end result was disappointing. It appears that AI created a custom external function. I don’t understand externally coded functions, but as a Mathcad user, I shouldn’t have to. While there is a Mathcad Prime worksheet, it lacks one of the core strengths of Mathcad as an engineering tool: documentation to communicate the problem, method, and solution to others, specifically other humans. This AI generated approach may or may not have achieved the right answer. But as I have discussed the past three years, getting the right answer is often not the most important part. Who knows, AI may be able to create worksheets that can both solve and communicate effectively (to humans) one day.

What Can We Learn?

Programs are a core part of Mathcad Prime’s functionality. They help you develop complex algorithms for advanced problems. Programming is a useful and powerful tool that all users should have in their back pocket. Being able to code path-finding algorithms like Traveling Salesman, Dijkstra, or other heuristic approaches have lots of applications in networks, search, electrical engineering, and other areas.

As Alan showed, complex algorithms can be tackled without programs using the other tools in Mathcad Prime. In real-world product engineering, we often see that additional constraints force us to find more creative solutions.

Next Month

Join us in November for another programming challenge based on a popular kids’ game!

CTA Image

Stay up-to-date with the Mathcad Minute!

Subscribe to the Mathcad Minute newsletter to learn when new Community Challenges go live, and more!

Subscribe Here
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.

Up Next