u/tennispro9

▲ 3 r/matlab

Fixed Step Solver timing issues in Simulink

I'm pretty new to simulink and I'm trying to get the climate control example running with fixed step timing, so it can be exported and run in another system.

It runs fine out of the box of course. So I change it to fixed step timing and change the function generator's period and pulse width parameters to be a multiple of the fundamental sample time, and it'll build. But when it runs I get the error below. I've tried reducing the step size and changing the solver but getting the same result. Hoping somewhere here could point me in the right direction.

It seems like the Tcabin block is trying to divide by zero but I'm not familiar enough with simulink to work through debugging it.

Error:An error occurred during simulation and the simulation was stopped

Caused by:

Derivative of state '1' in block 'sldemo_auto_climatecontrol_tcdebug/Interior Dynamics/Tcabin' at time 0.1 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

reddit.com
u/tennispro9 — 4 days ago