iliary Lie derivative

CALLING SEQUENCE:
   auxlieder(h,f,vars)

PARAMETERS:
   h    - scalar
   f    - vector
   vars - list of names

SYNOPSIS:
- Auxiliary function for computing the Lie derivative of h w.r.t. f
  Called from within lieder (q.v.)

SEE ALSO:  lieder

</HELP>


<HELP NAME=liederlist>
FUNCTION: liederlist - list of n first Lie derivatives

CALLING SEQUENCE:
   liederlist(h,f,n,stvars,invar)

PARAMETERS:
   h      - scalar
   f      - vector
   n      - integer
   stvars - list of names of state variables
   invar  - name of input variable
SYNOPSIS:
-  Computes the n first Lie derivatives of h w.r.t. f

SEE ALSO:  lieder,liehomlist

</HELP>


<HELP NAME=liehom>
FUNCTION: liehom -  Lie homomorphism

CALLING SEQUENCE:
   liehom(h,f)
   liehom(h,f,k)
   liehom(h,f,k,vars,invar)

PARAMETERS:
    h     - scalar
    f     - vector
    k     - integer (optional). Default: 1
    vars  - list of names of state variables
            Default: [x1,...,xn]
    invar - name or list of names (optional). Default: u

SYNOPSIS:
- The call liehom(h,f) returns the Lie homomorphism (my terminology) of h with
  respect to f. This is what you get when you replace xi -> f[i], ui -> u.(i+1)
  in h (if u is the input variable).

- liehom(h,f,k) renders the k:th Lie homorphism of h w.r.t. f

- If parameters vars and invar are given then the homorphism is defined by

         vars[i] -> f[i],  invar.i -> invar.(i+1)

- In the result returned, time shifts of the input are represented by subindices,
  so that e.g. u2=u(t+2) and u(t)=u0.

- liehom is used internally in e.g. ss2iod.

EXAMPLE: 
> liehom(x1*x2,vector([-x1*x2,x2*u]),2);
#`
#`                                   3   2
#`                                 x2  u0  u1 x1
#`
> liehom(p*z1,vector([-z1*z2*v,z2^2]),1,[z1,z2],v);
#`
#`                                  - p z1 z2 v0
#`
SEE ALSO:  lieder,liehomlist

</HELP>



<HELP NAME=liehomlist>
FUNCTION: liehomlist -  list of n first Lie homomorphisms

CALLING SEQUENCE:
   liehomlist(h,f,n,vars,invar)

PARAMETERS:
   h      - scalar
   f      - vector

   n      - integer
   stvars - list of names of state variables
   invar  - name of input variable
SYNOPSIS:

SEE ALSO:  liehom,liederlist
</HELP>

<HELP NAME=uyder>
FUNCTION: uyder - time derivative using subscript notation

CALLING SEQUENCE:
   uyder(p)
   uyder(p,k)
   uyder(p,k,invar,outvar)

PARAMETERS:
   p      - scalar
   k      - integer (optional). Default: 1
   invar  - name of input variable (optional). Default: u
   outvar - name of output variable (optional). Default: y

SYNOPSIS:
- Computes the k:th derivative of p w.r.t. t using the subscript notation
  diff(u0,t$k)=uk, diff(y0,t$k)=yk

- This trivial function is mainly for internal use (in sstrac).

EXAMPLE: 

> uyder(u^2-y*u);
#`                         u1 (2 u0 - y0) - u0 y1
#`
SEE ALSO:  uyhom, lieder
</HELP>


<HELP NAME=uyhom>
FUNCTION: uyhom - time shift using subscript notation

CALLING SEQUENCE:
   uyhom(p)
   uyhom(p,k)
   uyhom(p,k,invar,outvar)

PARAMETERS:
   p      - scalar
   k      - integer (optional). Default: 1
   invar  - name of input variable (optional). Default: u
   outvar - name of output variable (optional). Default: y

SYNOPSIS:
- Computes the k:th shift of p w.r.t. t using the subscript notation
  u(t+i)=ui, y(t+i)=yi. Thus this function only does a simple substitution

                     ui -> u.(i+1), yi -> y.(i+1)

  in p, iterated k times.

- This trivial function is mainly for internal use (in sstrad).

EXAMPLE: 

> uyhom(u^2-y*u1^2,2);
#`                                 2        2
#`                               u2  - y2 u3
#`
SEE ALSO:  uyder, liehom
  K. Forsman 1992-06-15

</HELP>

<HELP NAME=io2ssc>
FUNCTION: io2ssc - state space realization for continuous time control system

CALLING SEQUENCE:
   io2ssc(p,S)
   io2ssc(p,S,stvars)
   io2ssc(p,S,stvars,invar,outvar,ssmod)

PARAMETERS:
   p      - polynomial or polynomial equation in invar, outvar
            and their derivatives
   S      - list of rational functions in invar, outvar and their derivatives
   stvars - list of names (optional)
            Default is [x1,...,xn] where n=length of S
   invar  - name (optional). Default is u
   outvar - name (optional). Default is y
   ssmod  - parameter determining what state space models that
            are allowed (optional). Default is `kalman`.

SYNOPSIS:
- The call io2ssc(p,S) returns a list consisting of the rhs and
  the output map of the state space equation for a continuous time
  polynomial SISO system given in I/O form: p=0.

- The list S should contain expressions for the suggested states, i.e.
  rational functions of the input (and its derivatives) and the output
  (and its derivatives). Thus xi=S[i]. It might well happen that the given
  S is not a legal choice of states. There can be two reasons for this:
     1) It is not possible to express diff(xi,t) in terms of the other states
        and the input
     2) It is not possible to express the output in terms of the states
        and the input
  In both cases a warning message is printed.

- In p and S, time derivatives are to be represented by subindices,
  so that e.g. y2=diff(y(t),t,t) and u(t)=u0.

- The parameter ssmod determines if the state space model should allow
     1) derivatives of the input
     2) implicit state equations
  If ssmod=`kalman` then neither 1 nor 2 are allowed
           `der` then 1 but not 2 is allowed
           `impl` then 2 but not 1 is allowed
           `derimpl` then both 1 and 2 are allowed
  The default is `kalman`.
  If implicit equations are allowed the state equations are given as a list of
  polynomials in d.stvars and stvars. The dynamic equations are then these
  polynomials equated to zero. d.stvars[i] represents the time derivative of
  the i:th state variable.


EXAMPLES: 
> p:=y2*y0-y1^2+y1^2*y0:
> A:=io2ssc(p,[y0,y0/y1]);
#`                                     x1
#`                            A := [[ ----, u0 ], x1]
#`                                     x2
#`
> io2ssc(y2-y1=y0^2,[y0^2,y1-y0]);
#`
#`                 No explicit expression exists for .[dx1, dx2]
#`
#`                      No explicit expression exists for y
#`
#`                                       []
#`
> io2ssc(y2-y1=y0^2,[y0^2,y1-y0],[x1,x2],u,y,impl);
#`
#`                2          2                 2                         2
#`       [[ - 4 x2  x1 + 4 x1  - 4 x1 dx1 + dx1 , - x1 + dx2 ], - x1 + y0 ]
#`
SEE ALSO:  par2ssc, ss2ioc, io2ssd`
</HELP>


   Some warning about stvars <> invar <> outvar

  K. Forsman 1992-06-15

<HELP NAME=io2ssd>
FUNCTION: io2ssd - state space realization for discrete time control system

CALLING SEQUENCE:
   io2ssd(p,S,stvars)
   io2ssd(p,S,stvars,invar,outvar)
   io2ssd(p,S,stvars,invar,outvar,ssmod)

PARAMETERS:
   p      - polynomial or polynomial equation in invar, outvar
            and their time shifts
   S      - list of rational functions in invar, outvar and their time shifts
   stvars - list of names (optional)
            Default is [x1,...,xn] where n=length of S
   invar  - name (optional). Default is u
   outvar - name (optional). Default is y
   ssmod  - parameter determining what state space models that
            are allowed (optional). Default is `kalman`.

SYNOPSIS:
- The call io2ssd(p,S) returns a list consisting of the rhs and
  the output map of the state space equation for a discrete time
  polynomial SISO system given in I/O form: p=0

- In p and S, time shifts are to be represented by subindices,
  so that e.g. y2=y(t+2) and u(t)=u0.

- The parameter ssmod determines if the state space model should allow
     1) non-causality in the input
     2) implicit state equations
  If ssmod=`kalman` then neither 1 nor 2 are allowed
           `nc` then 1 but not 2 is allowed
           `impl` then 2 but not 1 is allowed
           `ncimpl` then both 1 and 2 are allowed
  The default is `kalman`.
  If implicit equations are allowed the state equations are given as a list
  of polynomials in d.stvars and stvars. The dynamic equations are then
  these polynomials equated to zero. d.stvars[i] represents the time shift of
  the i:th state variable.

EXAMPLES: 

> p:=y2-y1*(y-u): S:=[y0,y1/y0]:
> io2ssd(p,S);
#`
#`                           [[ x2 x1, - u0 + x1 ], x1]
#`
SEE ALSO:  ss2iod, io2ssc

</HELP>



<HELP NAME=io2ss>
HELP FOR: state space realization

See par2ssc, io2ssc (continuous time) or io2ssd (discrete time)
# Some warning about stvars <> invar <> outvar
 K. Forsman 1992-06-15
</HELP>


############################################################

<HELP NAME=loclyap>
FUNCTION: loclyap - critical level for local Lyapunov function

CALLING SEQUENCE:
   loclyap(f,V)
   loclyap(f,V,vars)
   loclyap(f,V,vars,lvar,met)

PARAMETERS:
   f    - vector representing the rhs of the DE
   V    - scalar function (local Lyapunov function) in vars
   vars - list of names (state variables) (optional)
          Default is [x1,...,xn] where n=vectdim(f)
   lvar - level variable (optional). Default is d
   met  - parameter determining method to be used (optional).
          Also determines the form of the output. Default is `pol`

SYNOPSIS:
- The function loclyap(f,V) is used to determine the critical level of
  a given local Lyapunov function V for the continuous time system

                    dx/dt = f(x)

- The components of the vector f should be rational functions in vars,
  as should V.

- The output is either a single polynomial in lvar or a list of polynomials
  in vars and lvar, depending on the parameter met.

- If met=`pol` then a polynomial in lvar is returned, one zero of which
  is the critical level.

  If met=`tot` then a list of polynomials (a Grobner base) in vars and lvar
  is returned. The last element of this list is exactly the polynomial
  obtained for met=`pol`; the other ones can be used to check which root of
  this last element is actually the critical level.

  The reason to use met=`pol` is that it is (generally) far more efficient.

EXAMPLES: 

> with(linalg):
> f:=vector([-x1+2*x1^2*x2,-x2]):  V:=3*x1^2+4*x1*x2+4*x2^2:
> loclyap(f,V);
#`                    2                      2      3
#`                   d  (2048 + 768 d - 147 d  + 4 d )
#`
> fsolve(");
#`
#`                      0, -1.9223, 8.9657, 29.707
#`
> G:=loclyap(vector([-z1+z2^2,-2*z2]),z1^2+z2^2,[z1,z2],q,tot):
> factor(G[nops(G)]);
#`
#`                         2                  2
#`                        q  (- 71 q + 8 + 4 q )
#`
  K. Forsman 1992-06-16
</HELP>

<HELP NAME=newsysc>
FUNCTION: newsysc - state equation for transformed continuous time
                    control system

CALLING SEQUENCE:
   newsysc(f,T)
   newsysc(f,T,ost,nst)
   newsysc(f,T,ost,nst,invar,form)

PARAMETERS:
   f     - vector
   T     - list of rational functions in the variables ost
   ost   - list of names (optional). Default: [x1,...,xn]
   nst   - list of names (optional). Default: [z1,...,zn]
   invar - name (optional). Default: u
   form  - optional parameter determining the type of state equations that are
           allowed. Also affects the form of the output.
           The default is `expl`.

SYNOPSIS:
- newsysc(f,T) returns either a vector or a list of polynomials describing
  the state equations obtained as the continuous time control system

                        dx/dt=f(x,u)
  is transformed into
                        dz/dt=g(z,u)

  in the way described by the list T. See below for a full description of
  the output format.

- The components of the vector f are to be rational functions in ost.

- T is a list of rational functions, so that zi=T[i].

- ost and nst (if given) are lists of names of the old and the new state
  variables, respectively. Thus the transformation is defined by nst[i]=T[i].

- If form=`expl` (default) then the output is the vector g above, if there
  is an explicit state space representation in the new coordinates. If there
  is no such representation a warning message is printed.
  If form=`impl` then the output is a list of n polynomials. The i:th
  element of the list is a polynomial in d.nst[i] and nst, where d.nst[i]
  denotes the time derivative of the i:th new state. The polynomial put
  equal to zero gives the dynamical equation for nst[i].

- There is a lack of symmetry here, since sstrac may produce an implicit
  transformation, whereas this function requires the transformation to be
  explicitly given. This is for theoretical reasons.

EXAMPLE: 

> with(linalg):
> T:=[2*x1-x2^2,3*x2-1]: f:=vector([-x1^2,u-x1*x2]):
> newsysc(f,T);
#`
#`                                2           4          3          2
#` [ - 2/3 u0 z2 - 2/3 u0 - 1/2 z1  + 1/162 z2  + 2/81 z2  + 1/27 z2
#`
#`        + 2/81 z2 + 1/162,
#`                                        3         2
#`     3 u0 - 1/2 z1 z2 - 1/2 z1 - 1/18 z2  - 1/6 z2  - 1/6 z2 - 1/18 ]
#`
SEE ALSO:  sstrac, newsysd
 K. Forsman 1992-06-16
</HELP>



<HELP NAME=newsysd>
FUNCTION: newsysd - state equation for transformed discrete time system

CALLING SEQUENCE:
   newsysd(f,T)
   newsysd(f,T,ost,nst)
   newsysd(f,T,ost,nst,invar,form)

PARAMETERS:
   f     - vector
   T     - list of rational functions in the variables ost
   ost   - list of names (optional). Default: [x1,...,xn]
   nst   - list of names (optional). Default: [z1,...,zn]
   invar - name (optional). Default: u
   form  - optional parameter determining the type of state equations that are
           allowed. Also affects the form of the output.
           The default is `expl`.

SYNOPSIS:
- newsysd(f,T) returns either a vector or a list of polynomials describing
  the state equations obtained as the discrete time control system

                        x(t+1)=f(x(t),u(t))
  is transformed into
                        z(t+1)=g(z(t),u(t))

  in the way described by the list T. See below for a full description of
  the output format.

- The components of the vector f are to be rational functions in ost.

- T is a list of rational functions, so that zi=T[i].

- ost and nst (if given) are lists of names of the old and the new state
  variables, respectively. Thus the transformation is defined by nst[i]=T[i].

- If form=`expl` (default) then the output is the vector g above, if there
  is an explicit state space representation in the new coordinates. If there
  is no such representation a warning message is printed.
  If form=`impl` then the output is a list of n polynomials. The i:th
  element of the list is a polynomial in d.nst[i] and nst, where d.nst[i]
  denotes the time shift of the i:th new state. The polynomial put
  equal to zero gives the dynamical equation for nst[i].

- There is a lack of symmetry here, since sstrad may produce an implicit
  transformation, whereas this function requires the transformation to be
  explicitly given. This is for theoretical reasons.

EXAMPLE: 

> with(linalg):
> T:=[2*x1-1,3*x2+x1^2]: f:=vector([-(1/2)*x1,u*x2]):
> newsysd(f,T);
#`
#`[ - 3/2 - 1/2 z1,
#`
#`                  2                                  2
#`    u0 z2 - 1/4 z1  u0 - 1/2 z1 u0 - 1/4 u0 + 1/16 z1  + 1/8 z1 + 1/16
#`
#`     ]

SEE ALSO:  sstrad, newsysc
</HELP>


<HELP NAME=newsys>
HELP FOR: system equations in new coordinates

See newsysc (continuous time) or newsysd (discrete time)
  K. Forsman 1992-06-16
</HELP>

<HELP NAME=obsvc>
FUNCTION: obsvc - observer relation for continuous time control system

CALLING SEQUENCE:
   obsvc(f,h,obsvar)
   obsvc(f,h,obsvar,stvars)
   obsvc(f,h,obsvar,stvars,invars,outvar,form)

PARAMETERS:
   f      - rhs vector
   h      - output map
   obsvar - variable, relation for which is sought
   stvars - list of names of state variables (optional)
            Default is [x1,...,xn] where n=vectdim(f)
   invars - name or list of names of input variable(s) (optional).
            Default is u.
   outvar - output variable (optional). Default is y.
   form   - optional parameter determining what kinds of relations that are
            allowed. Also affects the shape of the output. Default: `expl`

SYNOPSIS:
- The call obsvc(f,h,obsvar) returns a list consisting of polynomials
  describing how the variable obsvar is related to the inputs and the output
  of a continuous time rational system given in state space form:

                    dx/dt = f(x,u),  y = h(x,u)

  The exact format of the output is described below.

- Time derivatives are represented by subindices, so that e.g. y2 means
  diff(y(t),t,t).

- If form=`expl` (default) then the output is a list of rational expressions
  for obsvar in inputs and output (and their derivatives). If no such expressions
  exist then an error message is printed.
  If form=`impl` then the output is a list of polynomials in inputs
  and output (and their derivatives) and obsvar. These polynomials all equal
  zero.

- If obsvar is not algebraically observable, an error message is printed.

EXAMPLES: 

> with(linalg):
> f:=vector([x1*x2-u,x1^2]):
> S:=obsvc(f,x2,x1);
#`
#`                                u0 y1           y2 - 2 y1 y0
#`                  S := [- 2 ------------, - 1/2 ------------]
#`                            y2 - 2 y1 y0             u0

> T:=obsvc(f,x2,x1,[x1,x2],u,y,impl);
#`
#`                    2
#`     T := [- y1 + x1 , (y2 - 2 y1 y0) x1 + 2 u0 y1, y2 + 2 x1 u0 - 2 y1 y0]
#`
SEE ALSO:  obsvd, ss2ioc
# Some warning about stvars <> invar <> outvar
  K. Forsman 1992-06-16
</HELP>




<HELP NAME=obsvd>
FUNCTION: obsvd - observer relation for discrete time control system

CALLING SEQUENCE:
   obsvd(f,h,obsvar)
   obsvd(f,h,obsvar,stvars)
   obsvd(f,h,obsvar,stvars,invars,outvar,form)

PARAMETERS:
   f      - rhs vector
   h      - output map
   obsvar - variable, relation for which is sought
   stvars - list of names of state variables (optional)
            Default is [x1,...,xn] where n=vectdim(f).
   invars - name or list of names of input variable(s) (optional).
            Default is u.
   outvar - output variable (optional). Default is y.
   form   - optional parameter determining which kinds of relations that are
            allowed. Also affects the shape of the output. Default: `expl`

SYNOPSIS:
- The call obsvd(f,h,obsvar) returns a list consisting of polynomials
  describing how the variable obsvar is related to the inputs and the output
  of a discrete time rational control system given in state space form:

                    x(t+1) = f(x(t),u(t)),  y = h(x,u)

  The exact format of the output is described below.

- Time shifts are represented by subindices, so that e.g. y2 means y(t+2).

- If form=`expl` (default) then the output is a list of rational expressions
  for obsvar in inputs and output (and their shifts). If no such expressions
  exist then an error message is printed.
  If form=`impl` then the output is a list of polynomials in inputs
  and output (and their shifts) and obsvar. These polynomials all equal
  zero.

- If obsvar is not algebraically observable, an error message is printed.

EXAMPLES: 

> with(linalg):
> f:=vector([x1*x2-u,x1^2]):
> S:=obsvd(f,x2,x1);
#`
#`                                                       2        2
#`                            y1 y0 u0            y2 - u0  - y1 y0
#`             S := [- 2 -----------------, - 1/2 -----------------]
#`                              2        2              y0 u0
#`                       y2 - u0  - y1 y0
#`
> obsvd(vector([x^3]),x^2,x,[x]);
#`
#`                      No explicit expression for x found.
#`
SEE ALSO:  obsvc, ss2iod
</HELP>


<HELP NAME=obsv>
HELP FOR: observer relations

See obsvc (continuous time) or obsvd (discrete time)
# K. Forsman 1992-06-16
</HELP>

<HELP NAME=par2ssc>
FUNCTION: par2ssc - state space realisation for continuous time control system

CALLING SEQUENCE:
   par2ssc(H,stvars)

PARAMETERS:
   H      - a list of rational functions in the variables stvars
   stvars - list of names of state variables (optional)
            Default is [x1,...,xn] where n=length of H

SYNOPSIS:
- The call par2ssc(H,stvars) returns the rhs vector of the state equation for
  a continuous time rational SISO system. The functions in H parametrize the
  hypersurface p=0, where p is the I/O-relation, so that y0=H[1], y1=H[2], etc.

  In other words, par2ssc finds the rhs f of an equation

                    dx/dt = f(x,u),  y = h(x,u)

  such that H[i] is the i:th Lie-derivative of h w.r.t. f.

- It is required that H[1], ..., H[n-1] are algebraically independent.

- Time derivatives of the output are represented by subindices, so that
  e.g. y2 means diff(y(t),t,t).

EXAMPLES: 

> par2ssc([x1*x2,x2,x1]);
#`
#`                                2
#`                            - x1  + x2
#`                          [ ----------, x1 ]
#`                                x2
#`
> par2ssc([z^2-1,z+1],[z]);
#`
#`                                   z + 1
#`                             [ 1/2 ----- ]
#`                                     z
#`
SEE ALSO:  io2ssc, ss2ioc
# K. Forsman 1992-08-10
</HELP>


<HELP NAME=polycon>
HELP FOR: The polynomial and rational control systems package

CALLING SEQUENCE:
   <function>(args)
   polycon[<function>](args)

SYNOPSIS:
- This package includes functions for analysis of polynomial and rational
  control systems, i.e. control systems of the type

                    dx/dt=f(x(t),u(t)),  y=h(x,u)
  or
                   x(t+1)=f(x(t),u(t)),  y=h(x,u)

  where h and all components of f are rational functions in x = (x1,...,xn)
  and u. In some functions only polynomial nonlinearities are allowed.

- Most functions are available in a continuous time and a discrete time version;
  the convention is that the names of continuous time functions end in c and
  names of discrete time functions end in d.
  Exceptions are lieder - liehom and the like.

- The package is aimed at questions related to state space realizations:

   * state space to input-output conversion (ss2ioc, ss2iod)
   * realization of input-output relations (par2ssc, io2ssc, io2ssd)
   * observability (obsvc, obsvd)
   * transformation of systems (newsysc, newsysd)
   * finding the transformation between two equivalent systems (sstrac, sstrad)

  There is also a function loclyap for analysis of local Lyapunov functions.

- Some functions available are:

  io2ssc    io2ssd    lieder    liehom
  loclyap   newsysc   newsysd   obsvc
  obsvd     par2ssc   ss2ioc    ss2iod
  sstrac    sstrad    uyder     uyhom

- In the polycon package, time derivatives and time shifts of dependent
  variables are represented by subindices, so that e.g. in continuous time
  y0=y(t), y1=diff(y(t),t), y2=diff(y(t),t$2) etc. while in discrete time
  y0=y(t), y1=y(t+1), y2=y(t+2). This rule holds for input and output variables.

  The user is allowed to write u instead of u0 and y instead of y0 when calling
  a function.

  Derivatives or shifts of state variables do not occur, so state variables are
  still called x1,...,xn by default.

  To differentiate an expression in u and y using this convention the function
  uyder can be applied.

- Some functions use global variables and most functions have default values
  of input parameters that are names. The following default names are used:

     state variables:                        x1,...,xn
     (second state representation):          z1,...,zn
     derivatives/shifts of state variables:  dx1,...,dxn,dz1,...,dzn
     input variable:                         u or u0
     derivatives/shifts of input variable:   u1,u2,...
     output variable:                        y or y0
     derivatives/shifts of output variable:  y1,y2,... 

  In all cases where global names occur, the user is warned if there is a
  conflict.

- The theoretical background, with proofs for the correctness of the algorithms
  is given in the authors PhD-thesis:

   K. Forsman: "Constructive Commutative Algebra in  Nonlinear Control Theory"
   Dept. of EE, Linkoping University, S - 581 83 Linkoping, Sweden, 1991

 K. Forsman 1992-06-16
</HELP>


<HELP NAME=ss2ioc>
FUNCTION: ss2ioc - input-output relation for continuous time control system

CALLING SEQUENCE:
   ss2ioc(f,h)
   ss2ioc(f,h,stvars)
   ss2ioc(f,h,stvars,invars,outvar)

PARAMETERS:
   f      - vector
   h      - rational function of stvars
   stvars - list of names (optional)
            Default is [x1,...,xn] where n=vectdim(f)
   invars - name or list of names (optional). Default is u.
   outvar - name (optional). Default is y.

SYNOPSIS:
- The call ss2ioc(f,h) returns the input-output relation for a continuous
  time control system given in state-space form:

                    dx/dt = f(x,u),  y = h(x,u)

  All nonlinearities in f and h are required to be rational functions
  of x and u.

- In the I/O-relation returned, time derivatives are represented by subindices,
  so that e.g. y2=diff(y(t),t,t) and u(t)=u0.

- The parameter stvars is a list containing the names of the state variables,
  if not [x1,...,xn].

- The parameter invars is the name(s) of the input variable(s), if not u.
  Similarly, outvar is the output variable, if not y.

- If the state-space realization is not minimal a warning message is printed.

- There is an expert version of this function, called xss2iod.

EXAMPLES: 

> with(linalg):
> f:=vector([x1*x2-u,x1^2]):
> ss2ioc(f,x2);
#`
#`                    2   2          2                  2
#`                4 y0  y1  - 4 y1 u0  - 4 y1 y0 y2 + y2
#`
> p:=ss2ioc(vector([v*z2,v*z1]),z2+v*z1,[z1,z2],v,q):
> collect(p,[q2,q1,q0]);
#`
#`              3                      2
#`         (- v0  + v0 + v1) q2 + (3 v0  v1 - v1 - v2) q1
#`
#`                   2        3     5       2             2
#`              + (v0  v2 - v0  + v0  - 3 v0  v1 - 3 v0 v1 ) q0

SEE ALSO:  par2ssc, io2ssc, ss2iod
# Some warning about stvars <> invar <> outvar
 K. Forsman 1992-06-15
</HELP>


<HELP NAME=ss2iod>
FUNCTION: ss2iod - input-output relation for discrete time systems

CALLING SEQUENCE:
   ss2iod(f,h)
   ss2iod(f,h,stvars)
   ss2iod(f,h,stvars,invars,outvar)

PARAMETERS:
   f      - vector
   h      - rational function of stvars
   stvars - list of names (optional)
            Default is [x1,...,xn] where n=vectdim(f)
   invars - name or list of names (optional). Default is u.
   outvar - name (optional). Default is y.

SYNOPSIS:
- The call ss2iod(f,h) returns the input-output relation for a discrete
  time control system given in state-space form:

                    x(t+1) = f(x(t),u(t)),  y = h(x,u)

  All nonlinearities in f and h are required to be rational functions
  of x and u.

- In the I/O-relation returned, time shifts are represented by subindices,
  so that e.g. y2=y(t+2) and u(t)=u0.

- The parameter stvars is a list containing the names of the state variables,
  if not [x1,...,xn].

- The parameter invars is the name(s) of the input variable(s), if not u.
  Similarly, outvar is the output variable, if not y.

- If the state-space realization is not minimal a warning message is printed.

- There is an expert version of this function, called xss2iod.

EXAMPLE: 

> with(linalg):
> ss2iod(vector([-(1/2)*x1*x2,x2^2-u]),x1-u^2):
> collect(",[y2,y1,y0]);
#`
#`      2          2       4           3        2   2
#` (2 y0  + 4 y0 u0  + 2 u0 ) y2 + 4 y1  + 12 y1  u1
#`
#`             2        5        4          3            2        2    2
#`      + (- y0  u0 - u0  + 12 u1  - 2 y0 u0 ) y1 + (2 u2  - u0 u1 ) y0
#`
#`             2   2       3   2         5   2       4   2       6
#`      + (4 u0  u2  - 2 u0  u1 ) y0 - u0  u1  + 2 u0  u2  + 4 u1
#`
SEE ALSO:  ss2ioc, io2ssd

</HELP>


<HELP NAME=ss2io>
HELP FOR: state-space to input-output conversion

See ss2ioc (continuous time) or ss2iod (discrete time)
</HELP> 

<HELP NAME=xss2ioc>
FUNCTION: xss2ioc - input-output relation for continuous time control system:
                    expert version

 This function has exactly the same syntax as ss2ioc (q.v.), but returns
 the entire Grobner base for the ideal defining yi as the i:th Lie-derivative
 of h w.r.t. f.
</HELP>

<HELP NAME=xss2iod>
FUNCTION: xss2iod - input-output relation for discrete time control system:
                    expert version

 This function has exactly the same syntax as ss2iod (q.v.), but returns
 the entire Grobner base for the ideal defining yi as the i:th Lie-derivative
 of h w.r.t. f.

 K. Forsman 1992-06-15
</HELP>

<HELP NAME=sstrac>
FUNCTION: sstrac - find state space transformation between continuous time
                   control systems

CALLING SEQUENCE:
   sstrac(f,a,g,b)
   sstrac(f,a,g,b,ost,nst)
   sstrac(f,a,g,b,ost,nst,oinp,ninp,form)

PARAMETERS:
   f,g       - vectors
   a,b       - polynomials in the variables ost and nst respectively
   ost,nst   - lists of names (optional).
               Defaults: ost=[x1,...,xn], nst=[z1,...,zn]
   oinp,ninp - names of input variables (optional). Default: oinp=ninp=u
   form      - optional parameter determining what kinds of state space
               transformations are allowed. Also affects the shape of output.
               The default is `expl`.

SYNOPSIS:
- sstrac(f,a,g,b) returns a list defining the state space transformation
  between the two continuous time SISO control systems

                      dx/dt=f(x,u), y=a(x,u)
  and
                      dz/dt=g(z,u), y=b(z,u)

  having the same I/O-equation. The components of f and g have to be
  polynomials in the states and the input.

- ost and nst are lists of state variables for the old and the new system.
  Default values are as described above.

- oinp and ninp are the names of the old and the new input respectively.

- If form=`expl` (default) then only explicit transformations are allowed,
  and the output is a list L defining the transformation: nst[i]=L[i].
  If form=`impl` then implicit (algebraic) transformations are allowed,
  and the output-list L is such that L[i] is a polynomial in nst[i] and ost.

EXAMPLES: 

> with(linalg):
> f:=vector([x2,-x1]):
> g:=vector([2*z2-(1/2)*z1^2,z1*z2-(1/2)*z1-1/4*z1^3]):
> Q:=sstrac(f,x2,g,-(1/2)*z1);
#`
#`                                             2
#`                        Q := [- 2 x2, x1 + x2 ]
#`
> f:=vector([x1^2]): a:=x1^2: g:=vector([(1/2)*z1^3]): b:=z1^4:
> sstrac(f,a,g,b);
#`
#`                 No explicit expression for z1 exists.
#`
> sstrac(f,a,g,b,[x1],[z1],u,u,impl);
#`
#`                                 2
#`                              [z1  - x1]
#`
SEE ALSO:  newsysc, sstrad

 K. Forsman 1992-06-15
</HELP>


<HELP NAME=sstrad>
FUNCTION: sstrad - find state space transformation between discrete time
                   control systems

CALLING SEQUENCE:
   sstrad(f,a,g,b)
   sstrad(f,a,g,b,ost,nst)
   sstrad(f,a,g,b,ost,nst,oinp,ninp,form)

PARAMETERS:
   f,g       - vectors
   a,b       - polynomials in the variables ost and nst respectively
   ost,nst   - lists of names (optional).
               Defaults: ost=[x1,...,xn], nst=[z1,...,zn]
   oinp,ninp - names of input variables (optional). Default: oinp=ninp=u
   form      - optional parameter determining what kinds of state space
               transformations are allowed. Also affects the shape of output.
               The default is `expl`.

SYNOPSIS:
- sstrad(f,a,g,b) returns a list defining the state space transformation
  between the two discrete time SISO control systems

                      x(t+1)=f(x(t),u(t)),  y=a(x,u)
  and
                      z(t+1)=g(z(t),u(t)),  y=b(z,u)

  having the same I/O-equation. The components of f and g have to be
  polynomials in the states and the input.

- ost and nst are lists of state variables for the old and the new system.
  Default values are as described above.

- oinp and ninp are the names of the old and the new input respectively.

- If form=`expl` (default) then only explicit transformations are allowed,
  and the output is a list L defining the transformation: nst[i]=L[i].
  If form=`impl` then implicit (algebraic) transformations are allowed,
  and the output-list L is such that L[i] is a polynomial in nst[i] and ost.

EXAMPLE: 

> with(linalg):
> f:=vector([x2*u,-x1]):
> g:=vector([z1^2*u-u*z2,u^2*z2^2-2*z2*z1^2*u^2+z1^4*u^2+z1]):
> sstrad(f,x1,g,-z1);
#`
#`                                         2
#`                           [- x1, x2 + x1 ]

SEE ALSO:  newsysd, sstrac
</HELP>


<HELP NAME=sstra>
HELP FOR: obtaining state space transformations

See sstrac (continuous time) or sstrad (discrete time)
</HELP>
