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?

Very helpful in providing advice on which courses were applicable. Very clear. Checked with trainees to ensure the pace was accurate. Very aware of individual needs of trainees without letting individual issues take over. My interaction with Adept has always been very good. Staff are helpful, efficient and responsive.

Dr C Stott, Cambridge, UK

Excellent! Very much appreciated how the content was tailored to our needs.

Yet again Origin and OriginPro upholds its foremost status as the best purposeful and all-embracing data analysis and graphing software on the market. Although other software packages exist, few are as straightforward to use, flexible, and high-quality when it comes to performing challenging data analysis or creating publication superior graphs.

Keith J. Stevenson, Professor of Chemistry, The University of Texas at Austin

Thank you for all your efforts. A perfect example of what support should be. Again thank you.

GT

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.