Ask Simulink engine to skip continuous state consistency check

1 回表示 (過去 30 日間)
Mohammad Behtash
Mohammad Behtash 2019 年 9 月 5 日
コメント済み: Mohammad Behtash 2019 年 9 月 6 日
Hi,
I am running a simulation file with simulink and I am getting the following warning:
Warning: Simulink detected that S-function 'sim_EG/SeriesHybridVehicle/S-Function' changed the value of one or more elements of its continuous
state vector without resetting the ODE solver at time 66.0. Continuous states should only be changed in a major time step and the S-function
should request a solver reset using 'ssSetSolverNeedsReset' macro. Changing states without resetting the solver can lead to unexpected results,
especially in accelerated simulation modes. Use 'ssSetSkipContStatesConsistencyCheck(S,1)' in mdlInitializeSizes method to disable this check
once you have fixed your S-function.
I am kinda pretty sure that my S-function for the simulation is correct and I just wanted to get rid of this warning. MATLAB help says that I have to use ssSetSkipContStatesConsistencyCheck(S,1) in the mdlInitializeSizes method but I really do not know how use it. Should I use the code in MATLAB editor or somewhere else.
I would really apprecitate it if someone could help me with that.
Thanks
Mo
  2 件のコメント
Fangjun Jiang
Fangjun Jiang 2019 年 9 月 5 日
You need to modify the source code of the S-Function.
Mohammad Behtash
Mohammad Behtash 2019 年 9 月 6 日
Thanks for your comment. Do you mean that I have to put that code in the S-Function?
Regards,
Mo

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by