Faster Physical Modelling for Mathcad

Like many engineers, I use Mathcad as a scratchpad to jot down equations, model physical systems and explore technical ideas. My specialty is fluid dynamics and heat transfer, but I also dabble in electromechanical modelling.

But deriving equations for dynamic engineering systems demands time and skill. I’ll be the first to admit that I often lack both.

I recently discovered I already had the tools to translate an initial schematic of an engineering system to a Mathcad function (but my own lack of foresight prevented me from connecting the dots earlier).  The technology lets me

  • model multidomain engineering systems by connecting physical components on a virtual workspace,
  • and convert these block-diagram models to Mathcad functions.

The technology is a software tool called MapleSim. It has blocks for modelling electrical, mechanical, multibody, hydraulic, thermal and magnetic systems, as well as signal-flow functionality. The equations are already programmed in, so I don’t need to derive them.

MapleSim also generates C code from your model (simply point-and-click). The code can be parameterised with any set of properties (for example, resistances, inertias etc) and includes a solver.

This code can also be compiled to a Mathcad-compatible DLL.

This, for example, is a MapleSim model of a DC motor with backlash and a PI controller. The model was created by dragging physical components on a workspace, then connecting them together.

And this is the compiled function (after code generation) implemented in Mathcad.

I’ve parameterised the Mathcad function with respect to the set point and controller gains, but I could have picked any other combination of properties.

Compiling MapleSim code to a Mathcad-compatible DLL sounds tricky. You need some awareness of C coding, but you don’t need to be an expert or even consider yourself a competent programmer. Once you know the steps to follow, it’s simple and is mostly copy and paste. For anyone who wants to try, I’ve prepared a Visual Studio example project to make this easier (email me for the link).

Converting block-diagram physical models to Mathcad functions is novel and has the potential to save countless hours. Given that the volume of coffee I drink is positively correlated with the amount of algebra I do, this approach could lower my blood pressure as well.

What do our Customers say about us?

I had just upgraded to Windows 7, and after having Mathcad for several years I found that I could not complete the final stages of installation. After reading help files I finished up confused and really helpless, until I contacted you. THANK YOU.

JD, Dorset, UK

Your technicians are always really friendly, reassuring and helpful.

HM, Cambs, UK

I like thinking back to all the people I’ve worked well with during the year, and you have been particularly helpful throughout.

HM, Durham, UK

Very enthusiastic, willing to answer questions, helpful, friendly – overall very good

For the time being we are unable to offer the following product ranges although we are currently working hard to increase the number of products we can offer in the future. Please contact us to talk about alternative products that we may be able to offer you.