Dummy SMI-Toolbox
This is a description of how to use the Subspace Identification
FORTRAN Mex-files of the
Slicot
library in existing Matlab programs written for the
SMI-Toolbox.
There is also some help aviable
how to install the Slicot
library.
Of course one way to do this would be to change the existing Matlab
routines. But because this is a lot of work I have written a dummy
toolbox, which provides the same command names and interfaces as the
toolbox but uses the (probably faster) Mex-files. But note: It is not
written as a substitution for the original, but as a kind of extension.
It only substitutes the functions related to the PO-MOESP approach. The
library itself contains many more functions. So make sure that the
original SMI-Toolbox is correctly installed on your system.
To use the dummy toolbox you just have to follow these two steps:
- install the files on your system, for example in the directory
"~/smidummy"
- add the path to them to the matlab path (for the above example,
type at the matlab prompt: "addpath ~/smidummy"
The Matlab command "addpath" adds a path to the top of the search path
or if it is already part of it it is moved to the top of the search path.
This is the little trick to make Matlab use those new dummy versions
instead of the original ones.
So here are the files:
Or all of them as gzip compressed tar archive:
Since the interface of
the Matlab routines and that of the Mex-files are completely different, I
had to find a way to make them usable in the same way. As a consequence I
had for example in the file "dmodpo.m" to call the function "order" two
times, because the Matlab version of this returns the singular values and
the R of the QR factorization, but the Mex-function behaves different. It
only returns the singular values when it is told that this was the last or
only block of a sequence. And it returns different types of R-matrices,
depending on whether it is a first/intermediate or a last/only block. This
distinction was not made in the Matlab version, so I chose to give back a
R which includes both types of R-matrices and additional information which
is needed by the interface of the Mex-files. There was a similar problem
with the file "dac2bd.m".
This can cause the dummy toolbox to do the QR factorization
twice as often as the original toolbox would do. Because of this I think
that it is not useable for benchmarks or speed comparisons. But it is
useable for comparisons of accuracy. And it even has a chance to be faster
than the matlab version, because it uses a faster algorithm (Fast QR) for
compressing the data.
But if you really want to speed up your applications it is better to
change them so that they directly use the Mex-functions. (You might be
able to reduce the number of QR factorizations to one fourth compared to
the use of the dummy toolbox.)
I wrote this dummy toolbox so that it uses the Fast QR algorithm, however
this algorithm does not work in every case. If you only run a single batch
job, this doesn't matter because if it fails it automaticly switches back
to the standard QR. But if you run a job with multiple batches it wont
figure out that something goes wrong before the second batch. And at this
point there is no possibility for the routines them self to catch this
error. So in that case it will stop with a error message. If you use the
Mex-functions directly in your own software, you will be able to catch this
error and restart with standart QR.
(see matlab help on topic "try","catch")
Rene Schneider
Last modified: Wed Sep 13 09:08:43 MEST 2000