misc Previous: cacsd Up: Control Theory



Miscellaneous Functions (Not yet properly filed/documented)

axis2dlim (axdata) Function File
Determine axis limits for 2-D data (column vectors); leaves a 10% margin around the plots. Inserts margins of +/- 0.1 if data is one-dimensional (or a single point).

Input

axdata
n by 2 matrix of data [x y].

Output

axvec
Vector of axis limits appropriate for call to axis function.

moddemo (inputs) Function File
Octave Control toolbox demo: Model Manipulations demo.

prompt (str) Function File
Prompt user to continue

Input

str
Input string. Its default value is:
               \n ---- Press a key to  continue ---
               

rldemo (inputs) Function File
Octave Control toolbox demo: Root Locus demo.

[rldata k] = rlocus (sys[, increment, min_k, max_k]) Function File

Displays root locus plot of the specified SISO system.

                 -----   ---     --------
             --->| + |---|k|---->| SISO |----------->
                 -----   ---     --------        |
                 - ^                             |
                   |_____________________________|
          

Inputs

sys
system data structure
min_k
Minimum value of k
max_k
Maximum value of k
increment
The increment used in computing gain values

Outputs

Plots the root locus to the screen.

rldata
Data points plotted: in column 1 real values in column 2 the imaginary values.
k
Gains for real axis break points.

[yy idx] = sortcom (xx[, opt]) Function File
Sort a complex vector.

Inputs

xx
Complex vector
opt
sorting option:
"re"
Real part (default);
"mag"
By magnitude;
"im"
By imaginary part.
if opt is not chosen as "im" then complex conjugate pairs are grouped together, a - jb followed by a + jb.

Outputs

yy
Sorted values
idx
Permutation vector: yy = xx(idx)

[num den] = ss2tf (a, b, c, d) Function File
Conversion from tranfer function to state-space. The state space system:
                .
                x = Ax + Bu
                y = Cx + Du
          

is converted to a transfer function:

          
                          num(s)
                    G(s)=-------
                          den(s)
          

used internally in system data structure format manipulations.

[pol zer, k] = ss2zp (a, b, c, d) Function File
Converts a state space representation to a set of poles and zeros; k is a gain associated with the zeros.

Used internally in system data structure format manipulations.

starp (P K, ny, nu) Function File

Redheffer star product or upper/lower LFT respectively.

          
                         +-------+
               --------->|       |--------->
                         |   P   |
                    +--->|       |---+  ny
                    |    +-------+   |
                    +-------------------+
                                     |  |
                    +----------------+  |
                    |                   |
                    |    +-------+      |
                    +--->|       |------+ nu
                         |   K   |
               --------->|       |--------->
                         +-------+
          
If ny and nu "consume" all inputs and outputs of K then the result is a lower fractional transformation. If ny and nu "consume" all inputs and outputs of P then the result is an upper fractional transformation.

ny and/or nu may be negative (i.e. negative feedback).

[a b, c, d] = tf2ss (num, den) Function File
Conversion from tranfer function to state-space. The state space system:
                .
                x = Ax + Bu
                y = Cx + Du
          
is obtained from a transfer function:
                          num(s)
                    G(s)=-------
                          den(s)
          

The vector den must contain only one row whereas the vector num may contain as many rows as there are outputs y of the system. The state space system matrices obtained from this function will be in controllable canonical form as described in Modern Control Theory (Brogan, 1991).

[zer pol, k] = tf2zp (num, den) Function File
Converts transfer functions to poles-and-zero representations.

Returns the zeros and poles of the SISO system defined by num/den. k is a gain associated with the system zeros.

[a b, c, d] = zp2ss (zer, pol, k) Function File
Conversion from zero / pole to state space.

Inputs

zer
pol
Vectors of (possibly) complex poles and zeros of a transfer function. Complex values must come in conjugate pairs (i.e. x+jy in zer means that x-jy is also in zer). The number of zeros must not exceed the number of poles.
k
Real scalar (leading coefficient).

Outputs

a
b
c
d
The state space system in the form:
                    .
                    x = Ax + Bu
                    y = Cx + Du
               

[num den] = zp2tf (zer, pol, k) Function File
Converts zeros / poles to a transfer function.

Inputs

zer
pol
Vectors of (possibly complex) poles and zeros of a transfer function. Complex values must appear in conjugate pairs.
k
Real scalar (leading coefficient).