MATLAB SIMULINK 7 - DEVELOPING S-FUNCTIONS Guía de usuario Pagina 38

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 210
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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:
Vista de pagina 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 209 210

Comentarios a estos manuales

Sin comentarios