What is the difference between Step size and Sample Time ?

141 views (last 30 days)
I have a basic doubt in simulink solver setting , that What is the difference between Step size and Sample Time ?

Accepted Answer

Askic V
Askic V on 7 Mar 2023
According to Matlab's documentation,
The sample time of a block is a parameter that indicates when, during simulation, the block produces outputs and if appropriate, updates its internal state.
This is not the same as step size that is used in numerical calculations (for example when specifying solver). If the model specifies one or more periodic sample times, Simulink chooses a step size equal to the greatest common divisor of the specified sample times. This step size, known as the fundamental sample time of the model, ensures that the solver will take a step at every sample time defined by the model.

More Answers (1)

Sarvesh Kale
Sarvesh Kale on 7 Mar 2023
What is Step size ?
This option specifies the time increments at which the model will be simulated, generally solvers are kept variable step so that simulink chooses the step size automatically which is gcd of all sample times in Simulink model, doing this will ensure that sample time of each blocks in the model is hit, more information is found in the following link fixed step size.
What is Sample time ?
This is the time during the simulation at which the internal states of the block and output are updated and not before that , a model can have blocks with different sample times, if the model has two blocks with 0.4 and 0.5 as sample time and variable step solver then the time steps would be 0, 0.4, 0.5, 0.8, 1.0, 1.2,.. and so on. More information can be found in the following links Sample times in system, What is sample time ? .
I hope this information helps.
Thank you

Categories

Find more on General Applications in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!