In Simulink, how do I set the time step for simulations? I want it to be 0.1 seconds long. I've got it set to run 20 seconds.

조회 수: 7 (최근 30일)
I need to know how (and where) to set the time step for Simulink simulations. I've got it set to 20 seconds. I want to set it to use a 0.1 second time step, so there will be 20 points produced per variable. I need to know where to look for "time step". I've got the time span set already.

답변 (1개)

Jayanti
Jayanti 2024년 10월 10일
Hi @DJ V,
To set time step for Simulink simulation you need to make changes to solver settings. Kindly follow the below steps to achieve this:-
  1. Right click on your Simulink model -> Go to Model Configuration Parameters-> Solver category on left pane
  2. Under solver selection set type as Fixed-step. Now in solver details under fixed-step size enter 0.1 seconds.
Hope this helps.
  댓글 수: 2
DJ V
DJ V 2024년 10월 10일
This produces an error message when I try to run Simulink. It gives two types of error messages:
Invalid setting for fixed-step size (0.1) in model 'SimIntegrator'. All sample times in your model must be an integer multiple of the fixed-step size.
Component:Simulink | Category:Model error
The sample time period (0.01) of 'SimIntegrator/To File6' is not an integer multiple of the fixed step size (0.1) specified for model.
Component:Simulink | Category:Model error
Jayanti
Jayanti 2024년 10월 11일
Can you please share your Simulink file so that I can assist better?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by