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

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 210
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 108
Examples of C MEX-File S-Function Blocks
3-65
Example - Hybrid System S-Functions
The S-function, matlabroot/simulink/src/mixedm.c,isanexampleofa
hybrid (a combination of continuous and discrete states) system.
mixedm.c
combines elements of csfunc.c and dsfunc.c. If you have a hybrid system,
place your continuous equationsin
mdlDerivative andyourdiscreteequations
in
mdlUpdate. In addition, you need to check for sample hits to determine at
what point your S-function is being called.
In Simulink block diagram form, the S-function,
mixedm.c looks like
which implements a continuous integrator followed by a discrete unit delay.
Since there are no tasks to completeat termination,
mdlTerminate is an empty
function.
mdlDerivatives calculatesthe derivativesofthe continuousstatesof
the state vector
x,andmdlUpdate contains the equations used to update the
discrete state vector,
x.
Vedere la pagina 108
1 2 ... 104 105 106 107 108 109 110 111 112 113 114 ... 209 210

Commenti su questo manuale

Nessun commento