0
votes

I intend to run a Matlab Simulink model (of 400 ODEs i.e. 400 ODE models) with a fixed step size of 200e-06 and a simulation/stop time of 52 hours. As per my understanding, the Simulink stop time unit is in seconds. Does it mean that I need to run the simulation for (52*3600) 187200 seconds?? Further, I realized that running the Simulink model with a simulation time of 187200 seconds will take a very large time (maybe a couple of months which is not a feasible option), irrespective, of high computer configuration or vectorized/parallelized model structure.

Can someone please let me know the relationship between stepsize and simulation/stop time??

Thank you for you time.

Regards

1

1 Answers

2
votes

Step size and simulation duration are independent parameters.
For a fixed step simulation, you have the following relation :

NumberSteps = Duration / StepSize

The designer of the model should decide what is the time unit and design it accordingly.
It can be anything, seconds, hours, weeks,..., you only have to make sure that the calculations in the model are consistent with the unit you chose.
For example, you can model speed in m/s, km/h, miles/h, ... and make the same 1 s calculations either with 1 (s) step or 1/3600 (h) step.
The question is to know in which time unit the model you use was designed?
If the model uses a 1 second logic, then :

NumberSteps = 52 * 3600 / (200e-6) = 936e6

This is an unusual high number of steps and explains the too long run time.
I would question the need to have such a small step size for such a long duration.

It's also possible to model the same system with a 1 hour logic.
In this case :

NumberSteps = 52 / (200e-6) = 260e3
Stepsize = 200e-6 h = 0.72 s

This becomes an usual number of steps for a simulation and should run in a few seconds or minutes depending on model complexity