I have a model which calls a library for thermodynamic properties computation (CoolProp) from an S-Function. This library raises an error and suddenly stops the simulation if its inputs are not meaningful, which sometimes happens when Simulink perturbs the states, and especially when a Step
block is present in the model, even if its output is floating! I think this is an attempt to foresee system state changes, and I noticed that reducing the step size reduces the problem, but I can't run a simulation of 20'000 s at 10 us (yes, microseconds!) time steps when it already takes 15 minutes with 5 s step size!
Is there a way to catch that error (raised by a call to error()
, I suppose) and tell Simulink "Ehy, the step size you're using is too big"?
EDIT: I'm using ode45
solver, but nothing changes even with ode23tb
or ode15s
, apart from simulation time which increases dramatically.