MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Guide de l'utilisateur Page 38

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 210
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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:
Vue de la page 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 209 210

Commentaires sur ces manuels

Pas de commentaire