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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 210
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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.
Vista de pagina 108
1 2 ... 104 105 106 107 108 109 110 111 112 113 114 ... 209 210

Comentarios a estos manuales

Sin comentarios