«A good model is a judicious trade-off between realism and simplicity.” [Anu Maria, Introduction to modeling and simulation]
This statement perfectly highlights the challenge of choosing the right level of modeling / assumptions when starting a new simulation study. It is particularly true when you want to reach real-time capability for doing virtual sensing, IIOT on edge, model-based system testing or simply want to have your model running faster.
In this blog post, we provide you with some tips on how to make your Simcenter Amesim models run faster.
This can be done through the following best practices:
- Avoid generating implicit variables
- Avoid useless states variables
- Define the best simulation run parameters
- Avoid useless discontinuities
- Save only useful variables
- Condition correctly your maps
Avoid generating implicit variables
Implicit variables are generated by the solver whenever there is an algebraic loop in the system. An algebraic loop occurs when there is no order in which the submodels can be called such that all the inputs of each submodel are known when the submodel is called.
Example: 𝑦 = (𝑥, 𝑦)
The solution to remove an implicit loop can be to include a time constant within the loop (inertia, first order lag, inductor …) or to remove the calculation of the variable generating the algebraic loop.
Avoid useless states variables
The computation time is directly impacted by the number of states N. For a standard problem to solve within Simcenter Amesim, Adams’ method is used where CPU = k*N. When backward differential formulae method is used, CPU=k1*N + k2*N².
The solution to reduce the number of states variables is to group hydraulic volumes, mechanical masses or electric resistances.
The solution is to minimize the tolerance parameter without compromising the simulation results accuracy.
Avoid useless discontinuities
A discontinuity appears when a variable is suddenly jumping from one value to another (switch from laminar to turbulent flow, friction stick-slip, hysteresis…). This causes a restart of the solver to manage the interpolation between the two values.
The solution for avoiding useless discontinuities can be to disable the discontinuity handling of tabulated submodels (when possible) or to add damping.
The solution for reducing the number of saved data is either to save only the required variables or to increase the print interval (for the complete simulation or dynamically during the simulation).
Print out our step-by-step process
Most of the information above are explained in the infographic below, for the particular case of reaching real-time capacity: