MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Guida Utente Pagina 38

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 210
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 37
2 Writing S-Functions As M-Files
2-14
Example - Hybrid System S-Functions
Simulink includes a function called mixedm.m, which is an example of a hybrid
system (a combination of continuous and discrete states) modeled in an
S-function. Handling hybrid systems is fairly straightforward; the
flag
parameter forces the calls to the correct S-function subroutine for the
continuousand discrete parts ofthe system. One subtlety of hybrid S-functions
(or any multirate S-function) is that Simulink calls the
mdlUpdate, mdlOutput,
and
mdlGetTimeOfNextVarHit routines at all sample times. Thismeansthatin
these routines you must test to determine which sample hit is being processed
and only perform updates that correspond to that sample hit.
mixed.m models a continuous Integrator followed by a discrete Unit Delay. In
Simulink block diagram form, the model looks like this:
Vedere la pagina 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 209 210

Commenti su questo manuale

Nessun commento