0
votes

I have a Simulink model with master clock value of 4410 Hz. I know for a fact that computation time of some algorithms (e.g. cubic spline interpolation on a 4410 sample frame being accumulated in real-time) is much longer than the master time period (i.e. computation time of spline is cca 0.7 seconds). I would expect Simulink to output frame elements AFTER initial 1 second + propagation time delay (like in hardware languages, e.g. VHDL), but it actually starts outputting the elements of the frame just after one seconds (which is the length of frame, 4410/4410 seconds). This wouldn't be a problem if my output values weren't unexpected/wrong.

How does Simulink build the simulation in this case? It would appear that it stops the simulation for larger computation times, then continues it afterwards.

1
Simulink is not a real-time simulator, and wall clock time has no bearing on the simulation time. It is not unusual for models that have small sample rates such as you have to take a long (wall clock) time to simulate.Phil Goddard

1 Answers

1
votes

A simulink simulation assumes infinite computation capacity, it does not simulate computation times. It does not stop the simulation, it does not use a real clock at all. While simulink is a bit more complicated with the different solvers, you can take a look at discrete event simulation which should give a simple example of isolating the simulation clock form your real clock.