Why i am getting this simulation error?

조회 수: 6 (최근 30일)
Sayali Nikam
Sayali Nikam 2021년 6월 15일
답변: sanidhyak 2025년 5월 11일

답변 (1개)

sanidhyak
sanidhyak 2025년 5월 11일
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!

카테고리

Help CenterFile Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by