MapleSim Questions and Posts

These are Posts and Questions associated with the product, MapleSim

Pretty much what the title says. I am a student and I've worked with B&R Automation Studio, which is a SCADA software, with the physical automation components in the lab in college. Now that I'm on the summer break, it would be great to continue this learning via the B&R connector that Maple offer, to create a "digitial twin". However, there doesn't seem to be any information as to whether MapleSim is actually included in the student edition, and whether the connector is included too.

Thanks

I was wondering whether a water molecule exhibits the intermediate axis theorem (IAT) effect.

I was also curious if a tool like MapleSim could be used for simulations, as it is designed with technical applications in mind. (It would have been handy to enter parameters in Angstroms and atomic mass, but MapleSim only provides length in mm and mass in grams for small objects.)  

The atoms of the H2O molecule form an obtuse triangle. An obtuse triangle exhibits the effect when rotated about its intermediate axis (horizontal axis in the image below) provided it consists of equal point masses (more details here) which is not the case for oxygen and hydrogen. 

Building and running a model is quick since geometry and masses are available online. Two molecules are modeled in the attached file with parameters from different sources. The left model in the image below represents the atoms as three discrete point masses without individual rotational inertia. The system's total inertia is derived entirely from the spatial distribution of these masses. On the right, the entire molecule is modeled as a single lumped mass located at the center of mass (CoM), with the molecule’s full rotational inertia tensor applied at that point.

IAT_H2O.msim

Both models are rotating about the assumed intermediate axis at 3 THz (3 trillion rotations per second), which is about two orders of magnitude less than near-infrared light (just beyond the visible spectrum). To generate the IAT effect an orthogonal tiny initial “kick” of 0.001 Hz was added.

Visualizing was not so easy since the models are in the picometer range. It was difficult to locate the molecules by zooming with the mouse wheel (the button “Fit scene” on the 3-D Playback window did not work). Running an animation to visualize the IAT effect was not possible because the display speed could “only” be slowed down by a factor of 2^31 (see A in the image below). However, the slider C to move back and forth in time worked. The time (B) was always rounded to zero due to the very short simulation time span of 1E-10 seconds (i.e. 10 picoseconds).

Export of an animation movie worked better. Over the displayed timespan of 10 ps the molecules flip 2 times back and forth. This corresponds to a flip frequency of 200 GHz.

Time is still not displayed in the movie but that is pretty much all what did not work. Overall, a good performance. Also the numerical results did not show signs of loss of fidelity despite the atomic scale  of the objects and the very short time span.

In reality, the rotation of a dipole results in the emission of electromagnetic radiation, which dissipates energy and decelerates the molecule. How can this damping effect be modeled in MapleSim? Someone has an idea?

I have tried to create a function "modelica style" that acts as a custom component.

The Modelica code editor recognizes it.  It correctly sees the language constructs "function, parameter, etc." and then the block has the {} symbology showing it is a function.  Also, the Syntax Template doesn't seem to work per chapter 07.  i.e., the reference of "function" plus CTL-SHIFT-SPACE does nothing. 

However, trying to call this does not work and errors that the function is being called from main as a public declaration and gving the named function "myfunction_1" instantiation within main which errors out.

    Modelica coide in Main:   public MyFunction myfunction_1 annotation(Placement(transformation(origin={120.0,160.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=0)));

MyFunction is declared below Main along with another custom component model class "UseMyFunction" that calls this function with the variables being used in the simulation.

Where can I find the modelica language references that MapleSim accepts in the modelica coding region?

This mini-attempt is to find the usage syntax and method to reach higher custom functions that act similar to "Math" code blocks in the library.

Bill

The Schatz Mechanism should move like this

However, with the default solver settings it froze after a few seconds in a planar link configuration. To make it run, I played around with advanced solver settings. Here is one attempt that went nuts:

(More solver settings for strange behavior can be found here: Schatz_Linkage.msim)

Some people might find this amusing. Of course, it is less fun when the initial plan was to spend an hour just for fun with a simple model (an hour is a fair estimate for similar simple looking models in MapleSim). The immediate reaction when seeing such simulation results is to blame the software for being either buggy or incapable. In this case, however, this was not the case, but identifying the root cause was not obvious.

The Schatz mechanism is a so called closed-loop mechanism where the links of the mechanism form a loop (the ground in the model closes the loop). In general, building and modeling mechanisms with loops is less straight forward than thought. Without a-priory knowledge or help (either by documentation or software hints) users can quickly find themselves in a situation of desperate trial and error. What was easy with other models can become a frustrating experience with unsatisfactory outcome. This happened to me on various occasions.   

What makes closed-loop mechanisms more challenging?  After resting for a long time on my virtual pile of unanswered questions, it turned out that the model, on top of being a closed-loop mechanism, is ill-conditioned: The Schatzmechanism is an over-constrained mechanism that is only mobile for certain geometric parameters. MapleSim can simulate such over-constrained mechanisms, but this can be a balancing act for the solver.

Who could have known this? A knowledgeable expert might say that users who do not know what they are doing should not use the software. But how to become aware of over-constrained assemblies when building and running a model in MapleSim does not require to be an expert?  In this case the geometry was taken from a reference that sets the length of the ground link to Ö3. Model build, assembly and simulation instantly worked … but not for an extended time span.

In retrospect, everything is clear. Models that do not assemble do not fit together. Models that freeze in motion “jam numerically”. Linkages and joints of closed-loop mechanisms made of infinite stiff components may not fit together in all geometrical configurations. During runtime, after successful assembly, a stiff model can make a simulation sensitive to numerical errors. This does not mean that the user is dealing with a so-called numerical stiff problem that can be addressed by using stiff solvers. In this case, stiff solvers could not prevent sudden freeze or inversion of movements.

The only remedies that work for infinite stiff and over-constrained mechanisms are the ones that work also in real life. By either introducing mechanical play or elasticity in supports, joints and links, the simulation becomes robust. Numerically, for this case where none of the many advanced solver options made a difference, a simple increase of the relative error in the standard simulation settings worked.  This remedy could be described as introducing more numerical play. Interestingly in a completely different approach of animating a Schatzmechanism @one man also needed to introduce “deformations” in his simulation to make it work.

The Schatzmechanism is of little commercial interest and can therefore be shared. Is it a rare case of successful assembly and freeze during runtime or is it more frequent that users run into similar problems? Only MapleSoft can tell, but in the latter case it could make sense that MapleSim supports the user. I see several possibilities for that:

  • A more prominent mention in the documentation that kinematic loops require caution could raise awareness.  
  • Algorithmically detecting kinematic loops and informing the user that closed loops can be potentially over-constrained in certain geometric configurations.
  • (If possible, analyzing the Jacobian in the frozen configuration might give better hints than solver messages during runtime can provide. The attached model gives the hint with MapleSim 2025.1 that the error tolerance might be too tight, but no indication why.)
  • Implementing the mobility formula, analyzing closed loops and issuing a warning when the mobility M is less than 1 (meaning no degree of freedom)

The latter option sounds appealing. However, the degree of freedom calculated by the mobility formula only provides a necessary but unfortunately not a sufficient condition for mobility.  For example, connecting a prismatic joint coaxially to another increases the mobility by one but does not add to the mobility of a mechanism. This means that an advanced algorithm must take the orientation of joints into account to determine the effective degrees of freedom. On the other hand, the Schatzmechanism and some other mechanisms have a mobility of M=0 but can be mobile for certain geometries.

Should Maplesoft implement mobility analysis or are CAD tools that offer some sort of mobility analysis more suitable? In my opinion, from a conceptual point of view, it would be beneficial and faster to have this support already in MapleSim before going into details.

Should the user refrain from modeling infinite stiff mechanisms? I do not think so because they are useful in the context of deriving (analytical) forward and inverse kinematics. Furthermore, there are more mechanisms out there that are mathematically, according to the mobility formula, immobile but useful in daily life. The telescopic fork is a prominet example.

Final note for math enthusiasts:

The Schatzmechanism (invented by Paul Schatz) is a byproduct of the inversion of a cube. Recalling that the diagonal of the unit cube is Ö3 gives a hint of why the Schatz mechanism becomes mobile for this parameter. Also related to the inversion of a cube is the oloid: a solid with a developable surface that touches with its entire surface a flat surface when rolling. The oloid and the Schatz mechanism are closely related, which can be appreciated from this video.

Maplesoft continues to bring technology, collaboration, and learning together. Here’s some of the exciting industry news from the world of web converting and high-precision manufacturing lines, and what’s new with MapleSim for Web Converting Systems software.

How is MapleSim helping web converters and manufacturers?

From EV batteries to flexible packaging and medical films, industries that rely on thin web materials are advancing at remarkable speed. To keep pace, engineers need tools that let them model, simulate, and optimize every detail of their process with accuracy and confidence. Processes that once relied on intuition and trial-and-error are now guided by advanced modeling and simulation, such as MapleSim.

Using MapleSim simulation, engineering teams can perform process validation testing virtually - saving time and money compared to physical testing. The virtual models are used to explore and accelerate production — and the new release of MapleSim delivers a powerful set of features to make that possible.


What’s new in the latest MapleSim release?

The new release (available today) enhances MapleSim’s ability to answer “what-if” questions about industrial systems, easily review and compare results, and find strategies to improve production.


For converters and web material manufacturers, it is now even easier to create models of roll-to-roll systems. The updates to MapleSim for web converting systems include pre-built components for modeling spans and applying control during rewinding and matching tension profiles with PLC settings. There is also a new Utilities section to help users to handle sensor data and perform common calculation tasks.

These all reduce the effort to build and update models and add more detail to the simulations. The result: faster to innovate, shorter testing cycles, and more value from every simulation.

You can read more about the MapleSim new features.

Announcing the new Research Partnership Program for MapleSim

We are pleased to announce a new collaboration between Maplesoft and the research teams that are actively advancing converting and web manufacturing processes.
The MapleSim for Web Converting Systems - Research Partnership Program:

  • To support research communities across the web handling industry by providing licenses for MapleSim for Web Converting Systems at NO COST.

Our goal is to equip researchers with the same advanced modeling and simulation tools used in industry, helping them explore new concepts, test ideas, and drive meaningful discoveries.

Focus areas for research include:

  • manufacturing foils, plastic films, non-wovens, and other thin web materials.
  • any specialty process for handling or producing medical equipment, semi-conductors, or EV batteries.

More details of the program and the application process are available on this page.
 

How Simulation Gives You Operational Insights

We have a new web series of articles “R2R Operational Insights” that showcase the ways MapleSim models deliver deeper insights, greater efficiency, and better product quality. These modeling use case articles are sprinkled with customer stories from the world of packaging, EV battery manufacturing, and printing.

You can browse the R2R Operational Insight articles here.

 

Conclusion: Try MapleSim for Yourself

Together, these updates make it easier than ever to simulate, innovate, and learn in web-based manufacturing and design.
-->Start your Free Trial!

 

We have just released updates to Maple and MapleSim.

Maple 2025.2 improvements include fixes to print layout, PDF export, tooltips for keyboard shortcuts, Plot Builder, and more. We recommend that all Maple 2025 users install this update. This update is available through Tools>Check for Updates in Maple, and is also available from the Maple 2025.2 download page, where you can find more details.

At the same time, we have also released an update to MapleSim, which includes enhanced tools for comparing models and analyzing simulation data, and improved runtime performance for MapleSim connectors.You can find more information on the MapleSim 2025.2 download page.

I came across this

Can these library components be used to perform FFT on signals in MapleSim?

Any guidance on FFT and MapleSim appart from exporting to Maple would be very much appreciated.

(Easy) frequency analysis is among the top features I am missing in MapleSim.

Maple 2025.1

We have just released an update to Maple. Maple 2025.1 includes several enhancements to the new interface, as well as various small corrections throughout the product. As always, we recommend that all Maple 2025 users install this update.

In particular, please note that this update includes a fix to the problem where new documents were opening in a new window instead of a new tab.  Thanks for helping us, and other users, by letting us know!

This update is available through Tools>Check for Updates in Maple, and is also available from the Maple 2025.1 download page on web site, where you can also find more details.

MapleSim 2025

We are happy to announce that we just released MapleSim 2025. This release includes a new component library to support the modeling of motor drives and updates to several in-product apps that make it even easier to perform optimization and analysis.

See What’s New in MapleSim for details.

Doing multibody analysis on a ridig body results in

Turning quaternions on

Since I do not understand quaternions very well I was wondering why q0 is listed two times (why does the system uses 8 generalized coordinates for 7 degrees of freedom).

Ridig body help says about quaternions:Indicates whether the 3-D rotations will be represented as a four parameter quaternion or as three Euler angles.  Regardless of the setting, the initial conditions are specified with Euler angles.

Is that representation only internal? Can quaternions be probed?

To familarize myself with quaternions in MapleSim I would be greatfull for any examples using them. Are there any?

In which situations shall I use quaternions in MapelSim?

And what by way the stands q0slack in the above screen shot for?

When I measure the summary_Tension of the cable directly, the force of the cable suspending the weight is always somewhat different from the gravity of the weight. I'm not sure what summary_Tension a and b stand for and why they differ from the gravity force? I set the acceleration of gravity, g, to 10. m =1kg

Keywords: Intermediate axis theorem, Tennis racket theorem, Dzhanibekov effect, Coriolis force, Euler equations

In 1988 I witnesses the instability of the rotation about the intermediate axis of a foam brick.

Since then I have been fascinated by this effect. It was one of the many experiments which enriched a lecture series on kinetics and on that day Euler equations were on the agenda. Colored surfaces of the brick made it possible to observe the effect without micro gravity and slow-motion equipment.

This post is about reproducing an “intuitive” visualization of an explanation of the effect by Terry Tao from 2011 using 4 rigidly connected point masses. 8 years later the explanation was animated in a YouTube video (The Bizarre Behavior of Rotating Bodies) and considered to be the “best intuitive” explanation.

Motivated by the video, I wondered whether a similar animation with acting forces is possible with MapleSoft products and whether there might be a better intuitive explanation without the use of centrifugal forces. Initially I saw this more as a good test of MapleSim’s visualization capabilities. Finally, it took over 3 years and numerous attempts (mostly during vacation, kind of a substitute for drawing circles in the sand...) to come to a conclusion on the effect.

Intermediate_axis_theoreme_with_3_point_masses.msim


About the model:

Unlike the YouTube video, I decided to simulate 3 identical point masses because a 3-mass model fits better to a T-handle (overlayed in the animation above), video footage from space experiments and discussions in this forum (221298, 225760, 228066).

The movement of the model generates acceleration forces on each mass. The clip displays the corresponding opposing forces that act in the model (i.e. act on the massless T-structure). The blue mass, which is not perfectly centered on the axis of rotation at the start of the simulation perturbs the orbits of the red and the green masses. That was my initial intuitive attempt to explain the effect.

The 3 masses form an isosceles triangle. Here it is helpful to think of a rotating arrowhead where the shape determines stability of the rotation. The aspect ratio (the ratio of the height to the base length) of the triangle determines the stability of rotation about the mirror symmetry axis of the triangle (i.e. the symmetry axis of the T-structure). An obtuse triangle (“blunt”, aspect ratio < sqrt(3)/2) is unstable when rotating about an axis that is slightly inclined with respect to this axis of symmetry. The inclination can be in the plane of the triangle or out of plane. An acute (“pointy”) triangle only wobbles.

About the MapleSim model:

A supplementary rigid body component without mass and rotational inertia is used at the center of mass of the three masses to impose initial conditions. Rotating the triangle at the start of the simulation about the center of mass of the 3 masses prevents the triangle from drifting laterally away from its initial position. This effect of lateral drift is visible in video footage from space with the T-handle.

The rotational inertia of the other rigid body components is set to zero. Without rotational inertia it could be assumed that only Newtonian mechanics are used in the simulation (i.e. no Euler equations are integrated). This is however wrong. MapleSim generates automatically from a system with 3x6=18 coordinates a system with 3 Newtonian equations for translation and 3 Euler equations for rotation.

Forces and moments are measured with sensor components. Visualization is done with force and moment visualization components. These components are “abused” to display the following other physical quantities:

The angular momentum of the masses

The vectors of the angular velocity and the angular acceleration

Moments of the forces with respect to the center of mass

Moments of the forces with respect to the center of the base of the triangle

For a clean model, sensor components and mathematical components to calculate physical quantities are grouped in three subsystems (one per mass, indicated with a colored dot in the image below).

The model contains parameter sets for in plane and out of plane inclination of the axis of the T with respect to the initial axis of rotation (the x-axis).

Ein Bild, das Diagramm, Text, Screenshot, Plan enthält.

Automatisch generierte Beschreibung 

Visualization of physical components can be turned on by enabling the corresponding subsystems which are labeled accordingly (in the image above the display of the angular momentum is enabled). The subsystem “Verification” computes quantities that should either be conserved or should be equal to zero.  Calculation of quantities is done with MapleSim’s mathematical components (i.e. no embedded code or custom components are used).

 

Some observations

Kinetic energies are exchanged between the masses.  During a flip of the T (see animation above), the red and green masses “exchange” their energy. The blue mass mediates this exchange.  Depending on the initial conditions (in plane or out of plane), the energy of the red mass decreases first during the flip and the energy of the green mass increases (and vice versa, as seen below for the out of plane case which exhibits symmetric energy distributions).

Energy peaks are a good measure for the flip frequency. The frequency increases with the initial misalignment of the rotation axis to the symmetry axis of the T.

Ein Bild, das Text, Reihe, Diagramm, parallel enthält.

Automatisch generierte Beschreibung 

Tracing the blue perturbing mass reveals that the mass never gets closer to the (initial) rotation axis than its initial off-axis position.

Ein Bild, das Zeichnung, Kreis, Entwurf, Kunst enthält.

Automatisch generierte Beschreibung

The angular momenta of the masses vary, but the total angular momentum is, as expected, conserved. In the image below the angular momenta of the three masses are visualized to the left. The change of kinetic energy can be appreciated from the change in magnitude of the angular momenta.

The vector of the angular velocity (violet, at the origin) wobbles during the flip but does not flip direction. The vector of the angular acceleration (orange) rotates in the yz-plane

Forces act in the plane of the triangle. There is no component normal to the plane, as in the YouTube video, that could cause a flip. Thus, the displayed forces measured in the inertial reference frame do not provide an intuitive explanation why the flip occurs.

The same applies for the moments of the forces at the center of mass: They are perfectly balanced. There is no net component that could be attributed to an in-plane rotation.

 

Why are the animations different: Apparent vs. internal reactive forces.

The MapleSim animation shows internal reactive forces that illustrate the interplay of the moving masses which are bound to each other. They act in the model and obey actio = reactio, which means that the same vectors of opposite sign pull on the masses when the masses are isolated (they follow Newtons second law and equate to mass times the vector of acceleration; the last image in this post displays an isolated mass and the opposing force). 

On the contrary, the YouTube animation shows apparent forces (centrifugal forces) that appear when accelerations are described in a reference frame that moves (accelerates or rotates) with respect to the inertial reference frame. They look like external forces acting on the model, but they are not real. Since apparent forces are fictitious (not real), not everyone is satisfied with using them for an intuitive explanation.

 

Can the MapleSim animation be improved?

Calculation of apparent forces is possible but less straight forward for the simple reason that the Mathematical components library does not provide operators for coordinate transform and matrix multiplication. Those operators are normally not required for simulation purposes. (It would be interesting to see how calcualtion of apparent forces can be done in MapleSim. Verification of code implementation might not be as easy as in the inertial reference frame.)

What ultimately prevents a reproduction of the video is the observer/camera view that rotates with the model. This feature does not exist in the current version of MapleSim 2024. To reproduce the video, Maple has to be used. This would also make the implementation of the calculation of apparent forces much easier as compared to, for example, Modelica code implementation (at least for me).

 

Is the 3-mass model equally intuitive as a 4-mass model?

The initial idea was to have two orbiting masses that are perturbed by a third mass. The third mass flips like a pointer back and forth while the two masses still follow their orbit. This is in case of 3 identical masses only possible with a short-legged T as shown here:

Only a reduced mass would allow for a longer leg. Since the T has only one axis of symmetry, the two orbiting masses do not orbit in a plane. They perform a wobbling motion and shift laterally in position during a flip since the rotation is performed about the common center of mass. Only when 4 masses are used in a symmetrical cross configuration, two masses can orbit closer to a plane that contains the common center of mass while the two perturbing masses flip sides of the plane (the wobble is less pronounced but still visible by the enlarging blue trace in the animation below).

With a mass ratio of 1:100 in the animation below the two orbiting masses create kind of a centrifugal potential field in which the two perturbing masses swing like a pendulum. In this configuration the two perturbing masses can no longer be regarded as strongly disturbing, but rather as oscillating satellites. The sudden flip is created by the increasing accelerating field strength which increases with the distance from the axis of rotation. This lets a pendulum swing with a stronger than expected acceleration and is perhaps a new insight.

Both models represent the simplest possible implementation to generate the effect in terms of number of parameters. The 4-mass configuration has more objects but is simpler to understand because of the higher degree of symmetry.  Either identical masses at varying distances or identical distances at varying masses can be used in both models. No more reduction of parameters is possible to generate the effect. A two mass object cannot even wobble.

Out of plane initial inclination makes the acceptance of an explanation easier since the orbiting masses do not generate a momentum as in the case of an in plane inclination. For the latter case an intuitve explanation is more difficult and perhaps there is none.

Although the pendulum swing of the out of plane case might provide an intuitive explanation of the effect it is not fully satisfying. It does not explain why larger masses than the orbiting masses do not lead to a swing but smaller masses do. Another well-made video provides an explanation for that.

This newer video also gives an explanation why internal forces must act in the plane of the rotating object but does not display them in the animation. I guess this is because the introduction of real forces would have spoiled the intuitive explanation of the video. Isolating a mass and adding an internal force now as an external force leads to an equivalent system that reproduces the effect of the rotating object. If the same force is applied in the opposite direction on the isolated mass, the isolated mass moves along the same trajectory.

4_lumped_masses_and_one_single_force_driven_mass.msim

Isolating only one mass breakes the symmetry of the model. It also gives the false impression that the introduced perturbing force acts primarily on the opposite mass. A 3-mass model does not lead to such a false interpretation. By isolating the opposite mass and introducing a second perturbing force, the discussion shifts more to the analysis of the wobble and the rotational acceleration of the orbiting masses and less to the flip.

In summary, internal forces describe how the masses interact but their orientation is counterintuitively perpendicular to direction of the flip. On the other hand, centrifugal forces that we intuitively assume acting in a 4-mass model from the perspective of an observer from an inertial reference frame do not exist. This assumption provides an intuitive explanation which is physically wrong. In the same way an accelerating radial force field does not exist. Mathematically and physically correct is a description from a rotating observer which uses fictious forces.

For me both intuitive explanations of the videos are somehow useable, but both involve centrifugal forces (in one case explicitly and in the other wrongly assumed by an observer). This is not satisfying when the goal is not to use fictious forces.

Conclusion

MapleSim visualization components can be used for more than displaying forces and moments. They are very helpful to better understand physical phenomena.

A camera view observer on a rotating reference frame would have made observation of the direction of the internal forces much easier and might have given more insights. As of now, Maple is required to reproduce the animation in the video.

There is no better intuitive visualization/explanation with a model of 3 identical masses. A 4-mass configuration provides better insight but does not explain all.

In reality every freely rotating object with more than two point masses inevitably wobbles.

I can do that for a cylinder (in green below) but not for a box geometry.

Box_geometry_and_pendulum.msim

 

In the attached model I have tried (among other things) to simulate a disk pendulum without friction.

The simulation shows bouncing and angular lock.

There are also 3 warnings and an initialization problem that I could not fix.

How can the model be improved?

Disk_pendulum.msim

P.S.:

Rolling without friction worked fine here.

We have just released updates to Maple and MapleSim.

Maple 2024.2 includes ability to tear away tabs into new windows, improvements to scrollable matrices, corrections to PDF export, small improvements throughout the math engine, and moreWe recommend that all Maple 2024 users install this update.

This update also include a fix to the problem with the simplify extension mechanism, as first reported on MaplePrimes. Thanks, as always, for helping us make Maple better.

This update is available through Tools>Check for Updates in Maple, and is also available from the Maple 2024.2 download page, where you can find more details.

At the same time, we have also released an update to MapleSim, which contains a variety of improvements to MapleSim and its add-ons. You can find more information on the MapleSim 2024.2 download page.

In the attachment is an attempt with undesireable rendering artefacts

I did not use color functions because I intend to export the black fields of the ball to stl format to use them for a better visualisation of spinning spheres in MapleSim.

A related question: The generating function for the chessboard looks complicated to me. Maybe there is a more elegant way to do it.

Chessboard_sphere.mw

1 2 3 4 5 6 7 Last Page 1 of 43