Blogs and Articles
Moving from Excel to Mathcad
There are many reasons to move to Mathcad from Excel as an engineering calculation environment. These include, to name a few,
- clarity of notation (readability)
- clarity of dependencies (verification)
- unit analysis (error checking)
- breadth of calculation tools (completeness)
- Engineering-appropriate graphs, image analysis, matrix analysis, and data support
But what are the difficulties in making this transition? I'm frequently asked for advice on how engineers can gracefully move from Excel to Mathcad. While learning any new software tool requires spending time discovering the menus, entry conventions, and syntax, this doesn't seem to be the chief difficulty encountered by engineers trying to move to Mathcad. In my experience watching users who are familiar with Excel use Mathcad for the first time, the chief problem is a philosophical one. The difficulty has to do with a preference for vector/data-driven calculations versus functional calculations.
Both styles of calculation are possible in Mathcad, but our documentation and examples tend to prefer functional notation for its reusability and summarizing characteristics. Many Excel users are surprised or stymied by this difference in usage, or they are unable to gracefully transition from Excel cells to Mathcad vector and matrix notation. The vector style notation is closest to what Excel does in the cell format, but it's not always the most efficient way to pose a problem in Mathcad.
Here is an example of what I mean. Consider the problem of a cantilevered beam with a uniform force applied across it. The typical Excel sheet would contain some cells near the top with input values for the problem such as length of the beam, the distributed force along the beam, and the modulus and moment of the beam. What follows is a set of columns representing various positions along the beam, and the shear, moment, and deflection at each of those positions, each calculated with a formula that looks something like this:
=(-B3/(24*E3*E4))*(A7^4*B3^3*A7+3*B3^4)
Now aside from the fact that it's a little hard to know what the values represented by B3, E3, E4, and A7 represent, notice that Excel requires you to solve the problem in "vector format." A vector of positions, stored as sequential cells, feeds other vectors, one cell (or element) at a time. If you desire a table of data for the problem, then this can be a useful representation. Here's how you might replicate that style of problem solving in Mathcad.

Due to the weight of the beam itself, there will be a uniformly distributed load across the beam, causing reaction, shear, and moment. Let's assume that we'd like to see the calculations at 11 positions along the beam. Set up an index for the vectors, using a range defined as i.

This produces a set of tables that is similar to what you might see in Excel. But there are some important differences. Excel uses as many cell entries as you fill with explicit values for position. Mathcad requires that you say how many values you wish to calculate, and produces that number of cells in its vector display. The range i contains integers, and those are used as indices to iterate over values in the vectors x, V, M, and Δ y.
We might make this calculation just a little more flexible by assigning a number of points under a separate name. This would change the setup use N, say, as the end of the range, as as a divisor when creating the vector of x values along the length of the beam, L. The following will create 15 points in x, since the origin for vectors and matrix indexing is 0, although you can change this to 1 if you prefer.
Order Matters
By setting up the calculation in this way, you could change the value of N to anything you like, and your tables below the definition would update to show the appropriate spacing and number of entries. But notice that if I redefine these values below the original definitions, I'll have to make copies of the other dependent things to get them to pick up the new values. Unlike Excel, I care where my definitions are, because everything is in top-down-left-right order. This is the next shift in thinking that Excel users must adopt: order matters, and redefinition of the same name matters.
Functions and Flexibility
Fundamentally, the vector calculation shown isn't that different from an Excel-style calculation, with the important exceptions that columns now have names, they carry and convert appropriate units, and can be usefully parameterized with controls such as the number of points, to generate more or less accuracy in the table or in a graph. But Mathcad gives you an important advantage when doing calculations like these, and that is the ability to define your own reusable functions. When Excel calculations are simply replicated as discrete table points, they loose some of the utility of a full featured engineering calculation environment.
Consider the shear, moment, and displacement calculations encoded as functions.

Notationally, these look very much like the formulas from a book. They even cast the parameters of the beam as additional arguments so that they could be copied to other documents or use different values within the same document just by calling them with other variable names, or with specific values in place. With functions, you can integrate over them, differentiate over them, optimize on them, reuse them in other scenarios, and call them with a variety of inputs.
Functions make no assumptions about the discreteness of the problem, and can be used with any granularity of input. For example, we might now make a range of x's, rather than the integer indexes we defined earlier, and use it to plut the various curves represented the deflection of the beam.

Of course, if you are beginning with measured data, you can easily convert it into function form with any of the wide variety of splines or regression techniques offered by Mathcad. Once cast as a an interpolated or approximated function, you can use that function in all the ways described above. I believe it is this jump to functional or parameterized notation that represents the biggest mind-shift in setting up problems in Mathcad as opposed to Excel. Once you've mastered both styles of set-up, then any problem can be worked in Mathcad as easily, and more notationally and unit correct, than in Excel.
Let us hear from you about your experiences in both programs.