Why i am getting this simulation error?

4 vues (au cours des 30 derniers jours)
Sayali Nikam
Sayali Nikam le 15 Juin 2021

Réponses (1)

sanidhyak
sanidhyak le 11 Mai 2025
I understand that you are encountering an error while running your Simulink model, specifically due to a nonlinear iteration not converging and the stiffness check failing because the number of continuous states exceeds the default threshold. This issue typically arises in large or stiff models where the auto solver is not suitable.
This can be resolved by updating solver settings and increasing the stiffness threshold. Kindly refer to the following corrected steps:
% Set a higher threshold for stiffness check
set_param('li_ion_model', 'NumStatesForStiffnessChecking', '10000')
% Use a solver suitable for stiff systems
set_param('li_ion_model', 'Solver', 'ode15s')
% Relax solver constraints
set_param('li_ion_model', 'MinStep', '1e-6') % Increase minimum step size
set_param('li_ion_model', 'RelTol', '1e-3') % Loosen relative tolerance
These commands address both the solver limitations and the step size convergence issues seen at time 2.54467. The solver ode15s is recommended for stiff systems like this, and increasing the allowed number of continuous states avoids the initial check failure.
For further reference on configuring solvers in Simulink, kindly refer to:
I hope this helps!

Catégories

En savoir plus sur Continuous Wavelet Transforms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by