Simulation time" and Sampling time

21 views (last 30 days)
Maria
Maria on 22 Nov 2014
Commented: hana shakboua on 3 Mar 2018
I am newbie to Matlab and Simulink , I am asking about "simulation time" and "sampling time" in simulink What are they ? What is the relationship between them and also the relationship between them and Real time (in real World). I hear that this simulink is run at simulation time 30 and sampling time 0.01 , What that is mean ?
thanks for all

Accepted Answer

Orion
Orion on 22 Nov 2014
Edited: Orion on 22 Nov 2014
With Simulink, you are modeling some dynamics systems, meaning that your problem is time depending (For a physical modeling, you're gonna have differential equation to solve,...).
To see how a model behave you have to simulate it and see what happens when time increases.
at t = 0, the system is initialized.
then Simulink computes the state of your system at the next sample time 0.01s, then at 0.02, 0.03,...each step beeing updating using the previous values, and so on until the final simulation time you defined (ts = 30s).
The sample time exists, because you are in a numerical environment, not an analytic one. With a sample time too big, your model risk to diverge, and with a too small, your simulation risk to takes a really long time.
The final time is here to say to Simulink when to stop, because usually, you just want to see the evolution of your system for a defined period. But you can put inf as simulation parameter and then simulate until the end of time.
And the calculation is not happening in "real time simulation ". But the results are calculated against the "time", because you are solving a time dependant system. So if your modeling is good, then you will know how your system respond to stimuli in "real life".
  4 Comments
Maria
Maria on 22 Nov 2014
Edited: Maria on 22 Nov 2014
Ok , I understood that and thanks a lot for you .
hana shakboua
hana shakboua on 3 Mar 2018
Hi, what is the use for variable sample time? i want to input different values each value for different duration_ i am working on control systems in wind turbine, i want to enter different values of wind speed, is it right to use step block and variable sample time?

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!