How can i reduce solver exceptions in my simulation

21 visualizaciones (últimos 30 días)
Raphael Gabor
Raphael Gabor el 18 de Ag. de 2022
Respondida: Arun el 6 de En. de 2024
When i simulate my model i get many solver exceptions (especially Newton Iteration), wich is sometimes causing Simscape to skip certain time steps in the result explorer.
I do understand that these Newton Iteration exceptions result from states changing quickly but i don't know how to prevent them from happening this often. I already used the Solver Profiler to examine the states causing these exceptions and noticed that most of them occure inside the Thermal Liquid Domain. Because of that i added pipes to make the simulation more robust, which had some beneficial effects but did not resolve all exceptions.
What can i do to make the simulation more robust?
A screeenshot of the Solver Profiler:
Fore a quick look a picture of the model:

Respuestas (1)

Arun
Arun el 6 de En. de 2024
Hey Raphael,
I understand that you wish to reduce solver exceptions for your Simulink simulation model.
You typically need to adjust various solver settings to relax the requirements that the solver imposes on the simulation. Here are some steps you can follow to reduce solver exceptions in Simulink:
1. Open the Model Configuration Parameters: Open Simulink model window>Model Settings (Ctrl + E).
2. Select the Solver Tab from the configuration parameters dialog.
3. Choose a Different Solver Type:
  • If you are using a fixed-step solver, consider switching to a variable-step solver, which can adjust the step size during the simulation to meet the error tolerances.
  • If you are already using a variable-step solver, you can try a different solver algorithm that might be more suitable for your model.
4. Adjust Error Tolerances:
  • Increase the Relative tolerance and Absolute tolerance values. Higher tolerance values will make the solver less strict about the accuracy of the solution, which can help prevent solver errors.
  • Be cautious when adjusting tolerances, as setting them too high can lead to inaccurate results.
5. Modify Step Sizes:
  • If using a fixed-step solver, increase the Fixed step size. A larger step size will reduce the computational burden but can also reduce accuracy.
  • For variable-step solvers, adjust the Max step size to allow the solver to take larger steps when possible.
6. Solver Options:
  • Look for other solver-specific options that can be adjusted to reduce exceptions. For example, enabling the Use local solver option in some blocks can allow for different solver settings within a subsystem.
7. Algebraic Loop Solver:
  • If your model contains algebraic loops, consider changing the Algebraic loop solver to a less strict option if you are experiencing convergence issues.
8. Apply the updated settings and save your model.
9. Test the Simulation to see if the changes have improved the solver’s performance without significantly compromising the accuracy of the results.
Keep in mind that reducing solver exception can lead to faster simulation times and fewer solver errors, but it can also decrease the accuracy and fidelity of your simulation results. Always verify that the simulation results are still valid for your specific application after making any changes to the solver settings.
For more information on how to choose a solver please refer the shared MATLAB documentation link:
I hope this helps.

Categorías

Más información sobre Manual Performance Optimization en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by