#### By Laurent Bernardin

The speed control for an icebreaker moving through icy waters is a complex mathematical issue. |

Have you ever sat at a desk in the small hours of the morning, bent over a lukewarm cup of coffee, trying to make sense of a block diagram alongside a notebook full of mathematical equations derived weeks before, needing to make final changes to a simulation model due at 9 a.m.?

Regardless of whether you work in automotive engineering, biomechanical systems, spacecraft mechanisms, mechatronic multi-domain systems, or micro-robotics, model-based development promises to yield higher quality designs in less time.

High-fidelity computer-based models of systems can be created and then simulated to predict system operation, isolate problematic behavior in the early stages of the process, and develop solutions before the physical hardware is actually built. Depending on the project, this can save days or weeks as well as real money.

However, traditional software tools have not been able to keep up with increasingly complex project requirements. In particular, much of the mathematical background work still needs to be done by hand, which is an error-prone and time-consuming endeavor.

**The Challenge**

Ever since the birth of the digital computer, early simulation models were hand-coded, typically in Fortran. Then numeric solvers were developed to avoid having to start each new project from scratch. Eventually, the introduction of PCs and graphical user interfaces led to the appearance of the block diagram modeling paradigm. It meant many more engineers could develop dynamic system models on their computers.

IceTankPlot: “Icebreaker response generated with MapleSim.” |

For the first time, engineers could produce models on their desktops by simply “wiring” together block components that represented the mathematics of a physical model or control system, without having to write a single line of code, avoiding the time and cost of hand-coded simulations.

However, these traditional physical modeling tools force engineers to spend a great deal of time working with the mathematics representing their system, rather than developing, simulating, and evaluating their designs. The signal-flow concept upon which they are based is adequate for addressing the challenges of numeric simulation, but the modeling environment they present is non-intuitive and difficult to use, and quickly reaches its limits when applied to physical modeling.

Further, before engineers can even begin to use these traditional modeling tools, the physical system itself must be manipulated into a form that the software recognizes. This generally means that engineers must perform tedious manual derivations of the system equations, a process that is time consuming, error prone, and requires advanced mathematical knowledge. For example, even when working with something as simple as a spring-mass-damper system, engineers must first draw the free-body diagram and extract from it mathematical relationships between the physical components, derive the differential equations for the system, convert them to integral form, and finally break them down to represent blocks. In addition, the resultant block diagram looks nothing like the original system representation, making it hard to comprehend and make changes. Several pages of derivation are required just to go from a free-body diagram to the simple differential equation:

Just imagine how complex this becomes if you need to model a hybrid electric vehicle!

**A Better Way**

Luckily, we are at the dawn of an era with a new, more intuitive approach emerging to physical modeling and simulation. Symbolics-based physical modeling tools, like the multi-domain simulation software MapleSim from Maplesoft, let you represent the system graphically, using intuitive components such as gears, moving joints, pneumatic tires, or electric circuit components, making the models easier to build and understand. Engineering designs are described using components that represent their actual physical counterparts (e.g., electric circuits are built using resistors and inductors) and the mathematical derivations are handled automatically in the background.

Best of all, model equations are automatically generated and simplified, yielding concise models and high-speed simulations of sophisticated systems. All of the necessary relational, physical, and mathematical information for complex systems is automatically captured and managed, making it easier to develop efficient, high-fidelity models. The use of symbolics-based modeling tools is not predicated on one’s knowledge of advanced mathematics, but on the inherent talent of engineers to visualize how physical components connect and interact in real systems. Thus, the learning curve is much lower than that of signal-flow tools. Engineers can focus on the creative design process rather than having to deal with manual mathematical calculations and reference manuals.

Symbolic simplification has two primary benefits: By symbolically resolving algebraic loops (common stumbling blocks for traditional signal-flow tools) and automatically reducing differential algebraic equations (that arise naturally in many engineering problems), the equations are arranged into a form that lends itself to numeric simulation without manual intervention. Secondly, the simplified equations are provided to the numerical solvers in a computationally efficient form, again reducing total simulation time.

Computational efficiency of the resulting simulation models is particularly important for Hardware-in-the-Loop studies because it allows engineers to develop higher-fidelity models while maintaining real-time performance.

Physical model diagrams generated by MapleSim, unlike those created by traditional tools, map directly to the original system. |

**Dynamics of an Ice Tank Carriage**

An icebreaker is a special kind of ship. Before it is constructed, the hull design is rigorously tested for its ice-breaking capabilities in an ice tank. This is a refrigerated water tank in which a scale model of the ship’s hull is pulled by a gantry carriage through a layer of formed ice.

In one test example, the speed of the model ship was found to become difficult to control when the gantry carriage was operating at low speeds. The engineers discovered that the force generated by the ship’s hull when breaking ice induced backlash within the gearbox of the gantry carriage. In an attempt to compensate for the backlash, the controller caused the speed of the model ship to overshoot and then undershoot, causing damage to the test rig. MapleSim was used to create a high-fidelity physical model of the ice tank system and identify a mechanism to alleviate the backlash inherent in the design of the gearbox. The solution involved generating a back-tension to avoid the gear backlash.

The proposed solution was validated quickly, efficiently, and with minimal cost. Since the design was verified in advance, engineers were confident that only a single facility had to be shut to make the necessary modifications. The short time required for model formulation, solution validation, and implementation of modifications meant that the testing facility was reopened sooner than would have been possible with other approaches.

With the constant need to remain current in today’s increasingly competitive landscape, engineers in all industries will benefit from these new symbolic physical-modeling tools. Companies are working hard to meet the ever-growing need to increase productivity and drive innovation, while maintaining high quality standards. Virtual prototyping is an essential tool to speed up design cycles and replace expensive physical prototypes. By taking advantage of the next generation of multidomain modeling and simulation tools, engineers are freed from tedious derivations and routine calculations and are able to focus their skills on creating that elusive competitive advantage to help their companies succeed.

**More Info:**

MapleSim

Maplesoft

Waterloo, ONT.

*Laurent Bernardin is the vice president of research and development for Maplesoft. Send comments about this article to DE-Editors@deskeng.com. *