Dialectic Mechanics: Extension for Real-Time Simulation

Dialectic mechanics was introduced as an approximative modeling alternative to the classic Newtonian formulation of mechanics. It allows for additional freedom in placing a systems eigenvalues to facilitate simulation of systems, that are not suitable for most integration methods, when modeled according to the classic approach. The original idea of dialectic mechanics enables the suppression of high frequencies, but may still yield very stiff systems unsuitable for explicit integration methods. An additional term is added to enable real-time simulation with explicit methods. The goal of this paper is an analysis of the resulting equations and a comparison to the classic Newtonian formulation, aiming for an understanding of which applications most benefit from using dialectic mechanics.


Introduction
Industrial robots are designed to move precisely and repeatably in the presence of external forces, leading to systems that are built stiffly.These properties pose problems during simulation, since both within the robot itself as well as in its interaction with the environment stiff springs are an obvious choice for the modeler.While considering the robots gear stiffness does not require special care, simulation performance takes a significant hit, when the structural parts are explicitly modeled as flexible bodies with a stiffness a few orders of magnitude higher.
Another challenge is the simulation of a process, that requires the robot to touch a non-compliant object or environment.An example is the standard robot task of gripping an workpiece and moving it.One way to include the contact dynamics in the existing Modelica models would be to model the contact between gripper and object as a stiff spring and locking both parts together with friction.As the simulation performance with realistic parameters is unacceptable for most use cases of the model, approximations are usually necessary.Just reducing the stiffness might get the simulation to run well, but has unwanted side effects like larger oscillations and changed equilibriums.
Being able to simulate such processes in real-time would enable model use cases like model predictive control, virtual commissioning and Hardware-in-the-loop testing.In these applications the bandwidth of interest is often limited and well below the eigenfrequencies of very elastic kinetic m > 0 stiff objects.Removing high frequency oscillations with small amplitudes, that are not relevant to the models purpose, is the main goal of dialectic mechanics.

Real-Time simulation of stiff systems
Stability is an essential property in both system dynamics as well as solver methods.Even if a system is stable, simulating it stably require a careful choice of solver method and step size.For a lot of solver methods stability regions can be calculated, in which a systems eigenvalues have to be for a stable simulation.Although Higham and Trefethen (1993) indicate looking at eigenvalues is not enough in some cases, stability regions provide a useful tool for most systems in explaining problems with stiff systems.Higham and Trefethen (1993) summarized the essence of stiffness of Ordinary Differential Equations (ODE) as the case, when "Stability is more of a constraint than accuracy".A remark earlier made by Hairer and Wanner (1991) states, that "Stiff equations are problems for which explicit methods don't work".A remedy for this is the usage of implicit methods as pointed out by e.g.Dahmen and Reusken (2008).The authors mention backward differentiation formula (BDF) methods as especially useful, as well as higher order implicit Runge-Kutta methods.
When adding the requirements for real-time simulation, the number of suitable integration methods reduces significantly.The analysis in Cellier and Kofman (2006) comes to the conclusion, that mostly low-order explicit methods fulfill the need for predictable, bounded execution times.This creates a dilemma when planning to simulate a stiff system in real-time.Two ways around this fact proposed in Cellier and Kofman (2006) are linear implicit methods and multi-rate integration which requires slow and fast dynamics to be contained in discernible subsystems.Arnold, Burgermeister, and Eichberger (2007) mention the possibility of having dedicated real-time models neglecting stiff terms.This comes with the disadvantage of having to keep all models consistent.

Extending the equations of dialectic mechanics
Figure 1 shows a concept drawing of a dialectic massspring-damper-system.Although it cannot be used to derive the equations because of the way forces are split up between components it is helpful to explain the general idea of dialectic mechanics.The system is split into a massless elastic part on top and a kinetic part below.Both parts are connected by a first order filter that allows for low frequency interaction, but reduces high frequency effects.In addition to the system introduced in Zimmer and Oldemeyer (2023) a damper is placed between the elastic and kinetic parts.The resulting behavior, beneficial for real-time simulation as will be shown in the following sections, limits high-frequency energy transfer within the two domains.
The additional damper extends the equations presented in Zimmer and Oldemeyer (2023) and is marked with squared brackets in Equation 1b:

Content
Based on the change to the dialectic equations this publication will analyze and illustrate the properties of damped dialectic mechanics.In section 2 the eigenvalues of the dialectic mass spring damper system are formulated and a choice for the added damping parameter is derived.Section 3 compares the properties of damped dialectic mechanics with the standard modeling approach, before section 4 illustrates the contents of the previous sections with simulation examples implemented in Modelica.In the end section 5 provides a summary and an outlook towards remaining work.
Illustration of the eigenvalue limitation of dialectic mechanics with added damping as shown by Equation 18.All eigenvalues are transformed into the gray area.

Properties of damped dialectic mechanics
For an understanding of what effect damped dialectic mechanics has on a system's dynamics Equation 1 can be combined to form a second order differential equation.
The eigenvalues λ ′ of the dialectic system are: Based on these equations it is interesting to derive limits, within which the eigenvalues of the dialectic system lie.The maximum absolute value of the eigenvalues is derived differently depending on whether they are real-valued or complex-valued.
Considering the assumptions made in Figure 1 the second term of D ′ is always positive, which in the first case leads to the upper bound With this upper bound Equation 4 is limited to In order to come to a useful conclusion, a suitable choice for d el is necessary.Setting d el = d + cT D and using the assumption m > 0 again, results in In the second case the absolute value simplifies to With the same choice for d el as in the first case and the strict inequalities m > 0 and dT D > 0 this results in an upper bound for the absolute value of the eigenvalues As a result Equations 4 and 5 can be replaced by the simple limitation of the absolute value of the eigenvalues of the dialectic system: Together with the fact that β ′ > 0, which can be seen from Equation 3a, Equation 18 enables the user to specify a half-circle in the left half-plane in which all eigenvalue of the dialectic system lies.The imaginary axis is not part of the half-circle.An illustration is presented in Figure 2. The radius depends only on one design parameter T D , that can be adjusted to fit the stability requirements for a chosen solver-method and step size.Figure 3 illustrates the qualitative difference in the dialectic modification of eigenvalues depending on the scale of the original eigenvalues.The original eigenvalues in Figure 3c, lying well within the gray area, are changed relatively little.In the middle figure, where the original eigenvalues are of the same magnitude as the limit, the transformation is considerably more obvious.Note that all original real-valued eigenvalues become complex-valued.For the highest magnitude, depicted on the left, the transformation is very aggressive and shoves all eigenvalues into the same region of the limit semicircle.
Another interesting observation is visible in the enlarged part of Figure 3a.The real part of the transformed eigenvalues are all very similar and appear to be bounded by This is explained by the steps taken to get from Equation 8to Equation 11.The omission of m goes from just leading to a valid inequality to being a decent approximation, if the mass is far smaller than the rest of the denominator.This is the case here, because of the fixed, high undamped eigenfrequencies used to create the original eigenvalues.The same is true for the inequality 18.Hence, when the undamped eigenfrequencies are increased even higher than in the left picture, all transformed eigenvalues trend more and more towards For systems with low stiffness and high damping however this is not the case and there the transformed eigenvalues stay real-valued and move towards Generally the properties of damped dialectic mechanics discussed in this section are advantageous for real-time simulation with explicit solvers.The semicircle boundary provides a solid assumption about the placement of the eigenvalues even in complex systems and is easily configured by a single global parameter.A difference in magnitude of 100 is enough to have a strong reduction in the fast dynamics without changing the slow dynamics significantly.This behavior gets more pronounced, when there are more orders of magnitude between fast and slow dynamics.Of course the user has to check in every application, whether the model still fulfills its purpose with the changes made to the system.This check, however, can be conducted in an easy manner since the library enables the global setting of T D .A corresponding sensitivity analysis is thus quickly performed.

Comparison to the classic Newtonian formulation
Formulating the eigenvalues of a regular mass spring damper system analogous to Equation 3 gives: A comparison of the eigenvalue equations shows that the difference between Newton and dialectic mechanics can be viewed as a modification of damping and mass, while the stiffness remains untouched.Results of numerical experiments related to this observation will be presented in subsection 4.1.Notice that without the additional damper introduced in Equation 1b the modification is limited to the damping parameter.
The design parameters d el and T D allow a modification of the system dynamics without explicitly changing the values of m and d.Thus effects like gravity can still be calculated based on the original values.This is beneficial, as it prevents also changing the steady state of the system.
An advantageous choice of the additional damper parameter is d el = d + cT D , as shown in section 2. With this choice the eigenvalues of a stiff system with little damping are modified depending on the remaining design parameter T D as shown in Figure 4.While the imaginary part of the eigenvalues becomes smaller with every increase in T D , the real parts absolute value increases at first before decreasing again as the dialectic transformation gets more and more aggressive.In general the transformed eigenvalues show a strong trend towards the included stability regions of the solver methods.
Figure 4 also shows what happens, if just the damping of the original system is increased.As can be seen from Equation 23bfor a single pair of eigenvalues this is equivalent to the modification done by dialectic mechanics as presented in Zimmer and Oldemeyer (2023) without the additional damper.The values of d were chosen based on the varied T D according to Equation 23b to get a better comparison between the two approaches.Since the transformed eigenvalues travel along the semicircle with radius of the eigenfrequency of the original system, they circumvent the solver stability regions of the explicit solver methods.This modification however is sufficient for the use of implicit methods, because it effectively lower the imaginary part of the eigenvalues, thereby suppressing high frequencies.

Modelica examples
In order to verify the theoretical results derived above, example Modelica models are built with the dialectic planar mechanics library introduced in Zimmer and Oldemeyer (2023).The models are simulated using Dymola.Equations 1b and 23d are added to the elastic components, for which they are relevant.

Spring Damper System
Section 3 showed, that dialectic mechanics can be viewed as a modification of the parameters of the Newton system, for a simple mass spring damper system.To verify this the system is built twice, once with the Modelica Standard Library (MSL) and once with the Dialectic Planar Mechanics Library (DPM) introduced in Zimmer and Oldemeyer (2023).
Table 1 lists the parameters used.The parameters on the right have been calculated according to Equation 23.Both models are simulated with the same solver settings using an explicit fixed step solver.Dymola's Linear Analysis feature confirms, that both models have the same eigenvalues.The masses return to their equilibrium from the same starting position.
When comparing the masses trajectory, a first order filter with time constant T D is required for the position s in the dialectic model to receive the exact same output in both models.This raises the question of whether to include first order filters in sensor implementations in the DPM library.

Moving two stiffly coupled masses
An example showing the capability of dialectic mechanics to use stiff springs as a means for force transfer is shown in Figure 5.  5. Plotted is an excerpt of the respective spring forces beginning with a step of the applied force f from 10 N to 0 N.Under the assumption that the modeler is mainly interested in the macroscopic movement of the bodies, accuracy in the high-frequency oscillations is not necessary to fulfill the models purpose.in a point-to-point motion of both bodies.The forces acting between both bodies in the DPM model are compared with the corresponding forces in the MSL model.Since elastic and kinetic forces are separated in the DPM library, the spring forces are calculated within the spring component from the stiffness and the displacement.In contrast to the previous example the MSL model is parameterized with the same values as the DPM model.The stiffness c is chosen together with the step size of the 3 rd order Runge-Kutta method to bring the MSL model close to the border of the stability region.Figure 6 shows an excerpt of the simulation results.The dialectic model reacts slower to the start of the movement and oscillations of the force values die down much quicker towards a value of zero than in the other model.Note that the oscillations in the MSL model are damped as well despite there being no damping modeled.The damping is introduced by the solver method itself as described by Cellier and Kofman (2006).Looking at the mean value of the difference between both signals, which is close to zero, verifies that the dialectic model approximates the MSL model well by filtering the high frequency oscillations.Although they have a high amplitude, these oscillations have little effect on the large movement of the two bodies.The oscillations are visible in the difference between both bodies' positions, but their final positions are exactly the same.
After establishing the difference between MSL and DPM models, it is time to make use of the advantages of the DPM model and increase the stiffness beyond what the MSL model could do without changing solver settings.to have all curves in the same order of magnitude.
The order of magnitude of the spring stiffness is doubled and tripled in successive simulation runs.While the MSL model becomes unstable with these settings, the dialectic simulates as expected as Figure 7 shows.The difference in the masses positions gets smaller as expected, when increasing the stiffness.In the plot this has been adjusted by applying scaling in order to focus on the transient behavior.The small change in dynamics fits the observation formulated in Equation 20.A T D of 0.001 s leads to a limit period of 0.007 25 s, which is roughly the distance that can be measured between minima in Figure 7.

Performance considerations
The strength of damped dialectic mechanics mainly lies in enabling the simulation with settings, that would otherwise be unstable.More equations and variables lead to a higher computational cost for function evaluations.
First observations indicate an increase of approximately 20% in the dialectic example models used in this section, when compared to the MSL ones.Hence using the dialectic model for systems suitable for simulation with classic MSL models might slow down simulation.Variable step solvers in combination with stiff systems benefit from using the dialectic approach by enabling larger step sizes.Once the number of necessary function evaluations decreases significantly, a simulation speed-up is observed.

Discussion
Summing up the previous sections, damped dialectic mechanics appears to be a powerful tool for simulating models including challenging eigendynamics with explicit solvers.The central result is the guaranteed limit to the absolute value of the transformed eigenvalues.Since this limit is configured via a single parameter adaption to different use-cases should be straightforward.Heavily modifying fast dynamics, while largely keeping slow dynamics the same is another beneficial property.The integration into the Dialectic Planar Mechanics library enables further exploring example applications within existing tools.
Additional attention should be dedicated to more complex systems and how dialectic mechanics works within higher order or nonlinear systems.
For robotic applications a 3D implementation of dialectic mechanics is necessary.Especially the inclusion of 3D rotations might introduce different challenges, that require addressing.Existing models will need to be rebuild for use with dialectic mechanics.To avoid this the feasibility of automatic model transformation or adapters between a MSL and a DPM part in one model should be checked.

Figure 1 .
Figure 1.Concept drawing of damped dialectic mechanics.Additionally to the first order filter a damper connects elastic and kinetic domains.

Figure 3 .
Figure3.Dialectic transformation of eigenvalues for three different magnitudes of undamped eigenfrequecies.Original eigenvalues () are created by increasing damping in a system with a chosen undamped eigenfrequency.For each pair of original eigenvalues the dialectic eigenvalues (×) are calculated based on Equation3.The area to which transformed eigenvalues are constrained is marked by the same gray (cut-off) semicircle in all figures corresponding to the chosen T D = 1 × 10 −5 s.Each figure zooms in by a factor of 10 when going from 3a to 3c.

Figure 4 .
Figure 4. Changes in eigenvalues from original eigenvalues (×), when increasing d () or increasing T D (+) and stability regions of selected integration methods.Systems are simulated stably, if their eigenvalues lie within the plotted contours.

Figure 5 .
Figure 5. Two masses coupled by a spring as implemented by example model in subsection 4.2

Figure 7 .
Figure 7. Simulation results for DPM model of two stiffly coupled masses for different values of the spring stiffness.Plotted are the differences of position between the two masses.The values have been scaled for the stiffer simulation runs by 1 • 10 6 and 1 • 10 12to have all curves in the same order of magnitude.

Table 1 .
Parameterizations of Spring Damper models Two bodies are connected by a stiff spring.A force f of 10 N is applied to m 1 in such a way that it results Figure 6.Simulation results for DPM and MSL model of the system in Figure