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?

Hi Bob, Thank you so much for this and your prompt reply. It is such a relief, I can’t tell you! I will try downloading it now. I can’t thank you enough for your kindness as well as efficiency.

C

Good balance of basic information and practical tips for the more experienced

DV, Manchester, UK

When working with many data points, graphing is often the quickest way to qualify data and identify trends. With the Origin statistics gadget, it’s also easy to pull quantitative information, such as mean and standard deviation, straight from a data plot. This lets me make better decisions about which data to select for more detailed analysis.

Boaz Vilozny - Postdoctoral Researcher, University of California at Santa Cruz

Adept are continuing to be the most reliable and effective of all the technical helpline staff that I encounter.

MD, Worcs, UK

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.