Ask Simulink engine to skip continuous state consistency check

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Fangjun Jiang
Fangjun Jiang il 5 Set 2019
You need to modify the source code of the S-Function.
Mohammad Behtash
Mohammad Behtash il 6 Set 2019
Thanks for your comment. Do you mean that I have to put that code in the S-Function?
Regards,
Mo

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Tag

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by