What is the relationship between the simulation time tf in simulink and the actual running time of the system? If my system needs to run 800s before it can be stable, then tf

10 views (last 30 days)
What is the relationship between the simulation time tf in simulink and the actual running time of the system? If my system needs to run 800s before it can be stable, then tf in simulink must also be 800s, or I just need 800 steps, then the simulation time tf can be 80s, and the sampling time ts can be 0.1s, is that right? I don't understand, because if I set the simulation time tf to 800s, it will take me a very long time to train with reinforcement learning.

Answers (1)

Shlok
Shlok on 4 Mar 2025 at 10:49
Hi,
Simulation time (“tf”) and the actual running time of the system are different. In Simulink, simulation time represents the total duration over which the simulation is executed, while the actual running time is how long the simulation takes to compute on your machine, which depends on factors like model complexity and computational resources.
In the above-mentioned case, if your system requires 800 seconds to reach stability, then “tf” should be set to 800 seconds if you're modeling in real-time seconds. Alternatively, you can set “tf” to 80 seconds with a sampling time (“ts”) of 0.1 seconds to simulate 800 steps, provided your model's logic supports this scaling without compromising accuracy.
To know more about the difference between simulation time and sampling time, refer to the following MATLAB Answer:

Categories

Find more on Simulink in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!