El Lago
El Lago

Reputation: 3

How to slow the simulation speed to real time passage by the second?

I am simulating a train. The simulation runs for infinitely long. I give the train a force, and it moves. I want to show a real-time graph of the distance that the train has traveled. The x-axis is going by 1. But the unit is definitely not second. I know this because I set the x-axis to span from 0 to 60, the graph took up the horizontal span in less than 60 seconds. I only want the graph to update every second. How do I do that?

This is my model: enter image description here

I am using Dash Scope: enter image description here

Upvotes: 0

Views: 328

Answers (1)

Phil Goddard
Phil Goddard

Reputation: 10762

The graph is showing seconds - seconds of simulation time, not second of wall-clock time.

If you want to artificially slow it down then you have several options, including making the simulation time steps very small, or adding something to the model to pause it while wall-clock time catches up with simulation time. One way of doing this to write an S-function, such as Real-Time Pacer for Simulink

Upvotes: 1

Related Questions