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.

Risposte (1)

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 Commenti

cr
cr il 12 Ott 2013
Modificato: cr il 12 Ott 2013
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.
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'?
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.

Accedi per commentare.

Categorie

Scopri di più su General Applications in Centro assistenza e File Exchange

Prodotti

Richiesto:

cr
il 11 Ott 2013

Commentato:

il 21 Ago 2014

Community Treasure Hunt

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

Start Hunting!

Translated by