Simulation time in Simulink

조회 수: 83 (최근 30일)
Pablo Panitta
Pablo Panitta 2018년 6월 22일
편집: Siddharth Kamila 2022년 6월 8일
I need to run a simulation from x sec to y sec in Simulink enviroment. I go to Solver --> set Start time=x Stop Time=y and run simulation. But this doesn´t work because simulation keep starting @ 0 sec. Does anybody knows how to do it?

채택된 답변

Jingfang Qu
Jingfang Qu 2018년 6월 22일
Hi,
I understand you had some issue when you tried to set the simulation time for the Simulink model. You are in the right direction:
1. Configuration Parameters->Solver->Simulation time
2. Set start time=x, Stop Time=y;
3. Click Apply, then click OK.
4. Simulate the model, it should start with x and stop at y.
To see the start time, you can click on Step Forward instead of run, then you will see T=x at bottom right.
Thanks
  댓글 수: 4
Pablo Panitta
Pablo Panitta 2018년 6월 22일
Yes and actually appears the T=Tstart x sec, but simulation always start running from 0 sec. Really weird...
Siddharth Kamila
Siddharth Kamila 2022년 6월 8일
편집: Siddharth Kamila 2022년 6월 8일
In simulink model, how will we give a simulation time interval in between, while the simulation is running from 0 to 5 sec. Is there any code syntax for this ?
For e.g. :- Let's say, when we start the simulation from 0 sec to 5 sec, the data is processed (input data is given to a system and output data is generated) from 0 sec to 0.05 sec time, then there is an interval from 0.05 sec to 0.06 sec (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), and again the data processing goes on (input data is given to a system and output data is generated) from 0.06 sec to 0.11 sec, then again there is interval at 0.11 sec to 0.12 sec (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), again from 0.12 sec to 0.17 sec the data processing goes on (input data is given to a system and output data is generated), from 0.17 sec to 0.18 sec, there is an interval (no processing of data will take place in this interval, no input will be sent to the system and thus no output is generated), and like that, this process goes on till 5 sec simulation time.
So, is there any code syntax for providing this time interval ? Atleast give me some suggestion. I am not asking for an exact answer.

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

추가 답변 (2개)

Ankita Bansal
Ankita Bansal 2018년 6월 25일
편집: Ankita Bansal 2018년 6월 25일
Hi, can you see time offset(=4) at bottom right of your figure window?
The time offset is actually the start time you have given. The simulation runs from T=4 sec to T=12 sec only. It's just that the graph is shifted by 4 secs (x secs ).
You can also export the data to workspace and check for the min and max values of tout.
  댓글 수: 2
Pablo Panitta
Pablo Panitta 2018년 6월 25일
편집: Pablo Panitta 2018년 6월 25일
Hi Ankita
Thanks for you comment. I think this is exactly what I´m doing, but for some reason doesn´t work. As you can see in the video stored in GDrive, simulation actually last 8 sec, but doesn´t start @ 4sec but 0 sec. Let me know if you see something wrong in the setup.
Thanks Pablo
Ankita Bansal
Ankita Bansal 2018년 6월 25일
"simulation actually last 8 sec"
Hi Pablo, simulation is running for 4 to 12 secs (for 8 secs duration). And the graph you are getting is also for 4 to 12 secs, it's just shifted by 4 secs. (4->0 and 12 ->8)
So (x,y) point in the graph actually corresponds to (x+4,y).

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


Pablo Panitta
Pablo Panitta 2018년 6월 27일
Hi Ankita, first thank for keep helping me in this. Unfortunatelly I don´t see the same what you´re seeing.
Picture 1: Complete simulation time Tstart=0, Tstop=12
Picture 2 : Partial simulation time Tstart=4 , Tsopt=12.
The only difference I see is the time finish, but partial simulation is not starting at 4 sec, but 0 sec, which is what I try to avoid.
Thanks Pablo

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by