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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 210
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 9
1 Overview of S-Functions
1-4
When to Use an S-Function
The most common use of S-functions i s to create custom Simulink blocks. You
can use S -functions for a variety of applications, including:
Adding new g eneral purpose blocks to Simuli nk
Incorporating existing C code into a simulation
Describing a system as a mathematical set of equations
Using graphical animations (see the inverted pendulum demo,
penddemo)
Anadvantageof usingS-functions isthatyou canbuild ageneral purposeblock
that you can use many times in a model, varying parameters with each
instance of the block.
How S-Functions Work
Each block w ithin a Simulink model has the following general charact erist ics:
a vector of inputs, u, a vector of outputs, y, and a vector of states, x,asshown
by this ill ustration:
The state vector may consist of continuous states, discrete states, o r a
combination of both. The mathematical relationships between the inputs,
outputs, and the states are expressed b y the following equations:
In M-file S-fun ctions, Simulink p artitions the state vector into two parts: the
continuous states and the discrete states. The continuous states occupy the
firstpart of the state vector,and the discrete states occupythe secondpart. For
x
(states)
uy
(input) (output)
(output)
(derivative)
(update)
where xx
c
x
d
+=
yf
0
txu,,()=
x
·
c
f
d
txu,,()=
x
d
k1+
f
u
txu,,()=
Vista de pagina 9
1 2 ... 5 6 7 8 9 10 11 12 13 14 15 ... 209 210

Comentarios a estos manuales

Sin comentarios