User`s guide
Estimating Nonlinear G rey-Box Models
Specifying the Nonlinear Grey-Box Model Structure
You must represent your system as a set of first-order nonlinear difference or
differential equations:
x t F t x t u t par par parN
yt Ht xt ut
†
() (, (), (), , ,..., )
() (, (), (),
=
=
12
ppar par parN e t
xx
12
00
, ,..., ) ( )
()
+
=
where
xt
dx t
dt
†
()
()=
for continuous-time representation and
xt xt T
s
†
() ( )=+
for discrete-time representation with Ts as the sampling int erv al. F and
H are arbitrary linear or nonlinear functions with Nx and Ny components,
respectively. Nx is the number o f states and Ny is the number o f outputs.
After you establish the equations for your sy stem, cre ate an M-file or MEX-file.
MEX-files, which can be created in C or Fortran, are dynam ically linked
subroutines that can be loaded and executed by the MATLAB interpreter. For
more information about MEX-files, see the MA TLAB documentation.
Thepurposeofthemodelfile is to return the state derivatives and model
outputs as a function of tim e, states, inputs, and model parameters, as follows:
[dx,y] = MODFILENAME(t,x,u,p1,p2, ...,pN,FileArgument)
Tip The template file for writing the C MEX-file,
IDNLGREY_MODEL_TEMPLATE.c, is located in matlab/to olbox/ident/nlident.
The output variables are:
•
dx — Represents the rig ht side(s) of the state-space equation(s). A column
vector with Nx entries. For static m odels,
dx=[].
For discrete-time models.
dx is the value of the states at the next time
step
x(t+Ts).
For continuous-time models.
dx is the state derivatives at time t,or
dx
dt
.
5-17