- Open the ‘Model Configuration Parameters’ from MODELING>Model Settings
- In the Solver section change solver selection type to ‘Fixed-step’ and the solver to ‘discrete’.
- In the Solver details change the value of ‘Fixed-step size(fundamental sample time)’ to 1
How the Delay one step block and stop time ( simulation time) infuence each other on simulink?
1 view (last 30 days)
Show older comments
I want to have a fixed delay on the incoming resources going in the resource pool. For that matter I am using a delay one step block as seen in the attached file. The problem is that, I want to run the simulation let us say for 1000 mins or 10000 mins and the delay in each case be constant but I cannot achieve that. It seems to me there is a connection between the stop time and the delay length in the one step delay block. In the attached file without changing the values inside the blocks and simply by changing the stop time it can be clearly seen in the resource pool scope that this time changes. Any help would be appreciated!
0 Comments
Accepted Answer
Epsilon
on 22 Jan 2025
Edited: Epsilon
on 22 Jan 2025
Hi John,
The ‘Model Stop’ time and the ‘Delay Length’ in the one step delay block are not directly related even though it might appear so. Instead, it can be said that they have an indirect correlation.
‘Model Stop’ time refers to the simulation time. The ‘Delay Length’ in one step delay block refers to the length in terms of ‘Sample Time’. In the attached model the sample time for one step delay block is '-1' i.e. inherited, therefore the sample time is decided by the software based on the model stop time. For better understanding of sample time, please refer to: https://www.mathworks.com/help/simulink/ug/what-is-sample-time.html.
To achieve a fixed delay in the attached model a quick fix would be to change sample time in one step delay to 1 instead of -1.
An alternate is to change the fundamental sample time itself to 1 by defining the step size for the model. To do so please follow the following steps:
For further information on Fixed-step size (fundamental sample time) please refer to: https://www.mathworks.com/help/simulink/gui/fixedstepsizefundamentalsampletime.html
0 Comments
More Answers (1)
Fangjun Jiang
on 14 Jan 2025
Edited: Fangjun Jiang
on 14 Jan 2025
If you don't specify the step size or it is auto, the step size is automatically adjusted, influnced by simulation stop time and other settings.
You can specify the delay time explictly.
0 Comments
See Also
Categories
Find more on Schedule Model Components in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!