AmesimKnowledge

Community Knowledge > Best Practices

Making Amesim Models Real-Time Compatible: Practical Optimization Techniques

Siemens' own Simcenter blog (not the formal user guide) lays out a practitioner-oriented checklist for getting an Amesim model to run fast enough for real-time / HIL use, or just faster in general. These are concrete, actionable techniques rather than generic advice.

1. Eliminate algebraic loops

Algebraic loops occur when there's no valid calculation order for submodels — i.e., no sequence exists where every submodel's inputs are already known when it's evaluated. The blog reiterates the standard fix also seen in community Q&A: introduce a time constant into the loop (an inertia, a first-order lag, an inductor) or remove/restructure the calculation that creates the loop.

This matters for more than just "does it solve" — algebraic loops fundamentally change solver behavior. With no implicit state variables, the Amesim solver may be forced to take small, bounded time steps (e.g., capped around 0.1 s in one described case). With implicit state variables present, discontinuities can sometimes pass through without affecting the state, and the solver may miss them — a subtle correctness/robustness trade-off, not just a speed one.

Source (algebraic loop mechanics): Algebraic loops in Amesim (electrics) discussion referenced via search

2. Reduce the number of state variables

Computation time scales roughly linearly with the number of states N for methods like Adams' method (CPU ≈ k·N). Practical way to reduce N: lump/group hydraulic volumes, mechanical masses, or electrical resistances/capacitances that don't need to be individually resolved for the questions the model is answering. Fewer, larger lumped elements directly cut solver cost.

3. Tune solver tolerance deliberately

Higher integrator tolerance settings increase simulation time (tighter tolerance = smaller steps = slower). The practical guidance: treat tolerance as a dial to minimize while still preserving the accuracy you actually need for the study — don't leave it at an overly conservative default if the model doesn't require that precision.

4. Minimize discontinuities

Discontinuities — stick-slip friction transitions, laminar-to-turbulent flow regime changes, lookup table breakpoints — force the solver to restart/re-evaluate, which is expensive. Suggested mitigations:

  • Disable discontinuity handling in lookup tables where the discontinuity isn't physically essential to the study.
  • Add damping where physically justifiable to smooth transitions.

5. Reduce data logging overhead

By default, Amesim saves all submodel variables at every step, which adds I/O overhead that competes with real-time budgets. Practical fix: only save the variables you actually need for post-processing, and/or increase the print interval.

6. Clean up imported experimental data/maps before use

Imported experimental maps/curves often carry measurement noise or artificial discontinuities that the solver then has to work around. Recommended treatment: disable discontinuity handling on the map, use appropriate sampling density, or pre-filter noisy signals before importing them as a lookup table — rather than letting the raw noisy data drive the solver's step-size logic.

Guiding principle

The blog frames the whole exercise with a line worth keeping visible on any model-building checklist: "A good model is a judicious trade-off between realism and simplicity." Every added state, every unsmoothed nonlinearity, and every unnecessarily tight tolerance is a cost that should be justified by what the study actually needs to answer.

Source: https://blogs.sw.siemens.com/simcenter/make-your-simcenter-amesim-model-real-time-compatible/ · retrieved 2026-07-08