I'm a recent user of Simulink. I would like to know whether the simulation stop time 24 is correct to simulate 24 hours (and so the signal in input has to be referred to a day of measurations with time = 24) or I have to indicate 3600s*24 = 86'400 as a simulation stop time (and so the input daily signal has to be created upon 86400s). Thank you for your precious help.

 Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 12 Mär. 2012

1 Stimme

The simulation time is specified in seconds, so you would need to use 86400 to set a day's duration. (Note however that this doesn't mean the simulation will run for 24hrs in real-time, just that the data you provide is used as if provided for a 24hr period)

4 Kommentare

Doug Eastman
Doug Eastman am 12 Mär. 2012
I would say this is generally the convention, but really for base Simulink the time value is unitless. So if you want you could make the time unit hours and 24 would simulate one day. You just need to be consistent in all your blocks, for example the frequency parameter in the Sine Wave block would then correspond to cycles/hour.
Valentina
Valentina am 12 Mär. 2012
So, if I have 24 temperature's values, one for each hour in a day, and I would like to use the simulation time equal to 86400s, i have to create a signal of temperature with 3600 values identical in each hour, isn't it?
Doug Eastman
Doug Eastman am 12 Mär. 2012
No, when you specify input to Simulink you need to use a time vector and a data vector. So the vector only needs points where you want. For example, if you are using seconds as the time unit you might use the following as the data in a From Workspace block:
[0 T1;60*60 T2; 60*60*2 T3; 60*60*3 T4; 60*60*4 T5; ...]
The first column (0, 60*60, ..) corresponds to the times and the second column (T1, T2, ...) corresponds to the temperatures at those times.
You can choose whether you want to interpolate between the temperature values or hold them until the next reading.
Valentina
Valentina am 16 Mär. 2012
Thank you very much Doug.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

mehdi azari
mehdi azari am 25 Feb. 2021

1 Stimme

I want to change the simulation time from seconds to minutes and hours. How should I do this?

2 Kommentare

Nasifah Zailan
Nasifah Zailan am 27 Feb. 2021
please let me know if you got the answer. thank you.
Basant Ale
Basant Ale am 14 Dez. 2022
Did anyone get the answer?

Melden Sie sich an, um zu kommentieren.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by