Force Update a Block Output at Minor Time Steps

I just realised that the output of some blocks (e.g.source blocks like ramp and constant) are updated only at the beginning of a major time step. Is it possible to force update output signal of a block to update at the end of minor time steps too during a simulation?
Thanks.
P.s. I resubmitted this modifying the wordings of a Q I submitted earlier.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 10월 11일

0 개 추천

As far as I know, these blocks are internally configured to be Fixed in Minor Step, since it is a known fact that their output is not affected by the minor step. Perhaps you can explain more about why you'd like to force them to run in minor steps? It just seems inefficient.

댓글 수: 3

cr
cr 2013년 10월 12일
편집: cr 2013년 10월 12일
Well, for a constant block you are right. But for a ramp, the output does (or rather should) change even during minor time steps.
The reason I ask this is, I made two implementations of a problem (Lorenz attractor). One is direct math and integrator while the other is with a state-space (SS) block. Theoretically, the outputs from both implementations should match but they differ when simulated (in the same model, with same ICs). I can infer that the SS block implementation is the one thats off. The Lorenz attractor is a nonlinear model, but can be visualised as a time-varying linear system. To do that I'm using a simple s-function wherein I'm using update and output routines to change the A matrix of SS block as new outputs are computed. After quite a bit of investigation, I'm of conclusion that the outputs differ because the SS-block doesn't use its new A matrix during minor timesteps. Updation in A matrix is reflected only during major time step. Theres got to be some way to force update the output of a block.
I thought the experiment seems too complicated than it actually is and hence didn't mention it in the reposted question. I have now attached a simplified model that highlights the issue. In the mdl file, 'Difference' display blk should read zero, because the two integrators do the same job of integrating exp(x) from 0 to 1. It can be noticed that the smaller the time step, the smaller is the difference between the two outputs.
cr
cr 2013년 10월 14일
Also, a choice of [0,0] sample time for a constant of ramp block seems to make no difference compared to [0 1]. Does the latter guarantee 'fixed in minor step'? Doesn't the former guarantee not 'fixed in minor step'?
Viren
Viren 2014년 8월 21일
It's a pity you never got a proper answer for this question. The minor time steps in Simulink is a particularly dense concept with not much information available out there to help newcomers.

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

카테고리

도움말 센터File Exchange에서 General Applications에 대해 자세히 알아보기

제품

질문:

cr
2013년 10월 11일

댓글:

2014년 8월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by