Index of /skoge/publications/2001/te-files/Hovland/Diplom/Matlab

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[   ]basetilstand.m2010-07-15 10:58 1.3K 
[   ]datatil.m2010-07-15 10:58 2.3K 
[   ]evg.m2010-07-15 10:58 600  
[TXT]README.txt2010-07-15 10:58 4.7K 
[   ]plott.m2010-07-15 10:58 1.1K 
[   ]poler.m2010-07-15 10:58 793  
[   ]regss.m2010-07-15 10:58 1.0K 
[   ]regss4.m2010-07-15 10:58 937  
[   ]sammenligninavpoler.m2010-07-15 10:58 2.2K 
[   ]Skal_U.m2010-07-15 10:58 119  
[   ]sjekk.mat2010-07-15 10:58 9.8M 
[   ]Skal_Y.m2010-07-15 10:58 240  
[   ]ssfors.mdl2010-07-15 10:58 19K 
[   ]stabmol.m2010-07-15 10:58 818  
[   ]te_test.mdl2010-07-15 10:58 4.0K 
[TXT]temex.c2010-07-15 10:58 57K 
[   ]TEplot.m2010-07-15 10:58 3.0K 
[   ]temex.mex2010-07-15 10:58 26K 
[   ]temex.mexsol2010-07-15 10:58 56K 
[   ]temex_ol.mdl2010-07-15 10:58 4.7K 
[TXT]teprob.h2010-07-15 10:58 6.5K 
[   ]poler3+.m2010-07-15 10:58 819  
[   ]poler4pluss.m2010-07-15 10:58 819  
[   ]pretn.m2010-07-15 10:58 789  
[   ]rickerss.m2010-07-15 10:58 1.0K 
[   ]stepplot.m2010-07-15 10:58 114  
[   ]trimm.m2010-07-15 10:58 454  
[   ]SkalUstep.m2010-07-15 10:58 243  
[   ]poler3pluss.m2010-07-15 10:58 819  
[   ]rga0.m2010-07-15 10:58 335  
[   ]ricker.mdl2010-07-15 10:58 43K 
[   ]skalstep.m2010-07-15 10:58 785  
[   ]SkalYstep.m2010-07-15 10:58 166  
[   ]Skal_rga.m2010-07-15 10:58 199  
[   ]skal5step.m2010-07-15 10:58 722  
[   ]stasjgain.m2010-07-15 10:58 410  
[   ]truls.mdl2010-07-15 10:58 41K 
[TXT]README.html2010-07-15 10:58 4.7K 
[   ]test.mdl2010-07-15 10:58 39K 
[   ]trulspiss.m2010-07-15 10:58 1.0K 
[   ]trulsss.m2010-07-15 10:58 1.0K 



Contents of this Zip archive:

temex.c         C source code for compiling TEMEX mex file.
temex.h         C header file needed when compiling.
temex.dll       Mex file ready for use on a Windows machine.  It was compiled
                and built using MS Visual C++ and tested in MATLAB release 11.
temex.mex       Mex file ready for use on a PowerMac.  It was built using
                the MPW MrC compiler and tested in MATLAB 5.2.1.
te_test.mdl	Simulink model illustrating use of the TE challenge process
                simulation.
teplot.m        Script that plots the results at the end of a simulation.

System Requirements:

Matlab Version 5.2 or higher, with Simulink version 2 or higher.

Installation:

1) Unzip the archive into a new directory.  If you are on a Windows computer, you may
delete temex.mex.  If you are on a PowerMac you may delete temex.dll.  Otherwise
you may delete both the .mex and .dll files.

2) Start MATLAB and make the new directory the default.

3) If you are using a system other than Windows or PowerMac, you must now compile
and build the code.  You will need a C compiler (probably already installed if 
you're using a Unix machine).  If you have one, type the following
in the MATLAB command window:

mex temex.c

If all goes well, after a short delay the compiled-and-built mex file will be
in the default directory (verify this). You may see a couple of warning messages 
during the compile step, but you can ignore them (unless they are errors 
rather than warnings).

If you have trouble with the compile & build, make sure you have a C compiler approved 
for use with MATLAB c-mex files, and that it is set up properly.  See MATLAB's 
"Application Program Interface Guide" (available on-line in PDF format) for more details.

Testing the code:

4) In the MATLAB command window type "te_test" to bring up a Simulink window 
containing the example.  (This assumes that the directory created in step 1 is 
still the MATLAB default).

5) Start the simulation.  The initial condition is the base case defined in
the Downs and Vogel paper. Since the TE challenge process is open-loop unstable,
however, and the steady state is inexact (due to model complexity) the plant will 
eventually exhibit a transient.  After approximately 2 hours (simulated time) the
reactor pressure will exceed the upper bound of 3000 kPa and the plant will shut
down.  You should see a message to that effect in the MATLAB command window.  The
variables will be plotted (the format of this depends on whether or not you
have the MPC Tools).

Using the code:

The code is a standard Simulink s-function.  It's easiest to run as a block in 
a graphical diagram -- as in the example.  You can also run it from the MATLAB
command line, however.  See the Simulink documentation for general information
on s-functions and their use.

The block requires the following input data:

A) Parameters

The s-function requires two parameters (double-click on the example temex block to
see how these were defined):

1)  Initial states of the TE process.  Must be a vector, length 50.  If empty
(as in the example), the Downs and Vogel base case values are used.

2)  Disturbance codes.  Must be a vector, length 20.  These are the 
20 disturbances IDV(1) ... IDV(20) defined by Downs and Vogel.  If a 
disturbance code is zero, that disturbance is turned off.  Otherwise it is on.
(All were off in the example).  You may change these during a simulation if
you wish.  Either pause the simulation and change them manually or set up a
MATLAB script to do so at pre-defined times.

B) Input signals.  These are the 12 manipulated variables (MVs) defined by Downs 
and Vogel.  The example has the base-case values in a vector.  It adds another
vector which is defined as zero but could be used to introduce a step in one
or more MVs.

The block outputs are the 41 measured variables defined by Downs and Vogel.  Note
that the first 22 are measured continuously, and the rest are sampled composition
analyses from chromatographs.  The latter will exhibit discrete steps as
a new sample becomes available (at intervals of 0.1 or 0.25 hours, depending
on the signal).

In the example the outputs are being logged to the MATLAB workspace so they can
be plotted when the simulation ends (on a 266 Mh Pentium-II the 2-hour simulation 
requires about 6 seconds of computing time).  In general you could feed back some
or all of the measurements to MV adjustments.  A number of control strategies
have been proposed in the literature.

If you have difficulty with the installation or the mex code doesn't seem to 
give correct answers, please send a note to N L Ricker with full details:

ricker@u.washington.edu