g13 Chapter Contents
g13 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_trans_hessenberg_observer (g13ewc)

## 1  Purpose

nag_trans_hessenberg_observer (g13ewc) reduces the matrix pair $\left(A,C\right)$ to lower or upper observer Hessenberg form using (and optionally accumulating) the unitary state-space transformations.

## 2  Specification

 #include #include
 void nag_trans_hessenberg_observer (Integer n, Integer p, Nag_ObserverForm reduceto, double a[], Integer tda, double c[], Integer tdc, double u[], Integer tdu, NagError *fail)

## 3  Description

nag_trans_hessenberg_observer (g13ewc) computes a unitary state-space transformation U, which reduces the matrix pair $\left(A,C\right)$ to give a compound matrix in one of the following observer Hessenberg forms:
 $n U A UT C UT = * . . . . . . * . . . . . . * . . . . . * . . . * * . . * . . . . * n p$
if ${\mathbf{reduceto}}=\mathrm{Nag_UH_Observer}$, or
 $n C UT U A UT = * . . . . * . . * * . . . * . . . . . * . . . . . . * . . . . . . * p n$
if ${\mathbf{reduceto}}=\mathrm{Nag_LH_Observer}$. If $p>n$, then the matrix $C{U}^{\mathrm{T}}$ is trapezoidal and if $p+1\ge n$, then the matrix $UA{U}^{\mathrm{T}}$ is full.

## 4  References

van Dooren P and Verhaegen M (1985) On the use of unitary state-space transformations. In: Contemporary Mathematics on Linear Algebra and its Role in Systems Theory 47 AMS, Providence

## 5  Arguments

1:     nIntegerInput
On entry: the actual state dimension, $n$, i.e., the order of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 1$.
2:     pIntegerInput
On entry: the actual output dimension, $p$.
Constraint: ${\mathbf{p}}\ge 1$.
3:     reducetoNag_ObserverFormInput
On entry: indicates whether the matrix pair $\left(A,C\right)$ is to be reduced to upper or lower observer Hessenberg form
${\mathbf{reduceto}}=\mathrm{Nag_UH_Observer}$
Upper observer Hessenberg form).
${\mathbf{reduceto}}=\mathrm{Nag_LH_Observer}$
Lower observer Hessenberg form).
Constraint: ${\mathbf{reduceto}}=\mathrm{Nag_UH_Observer}$ or $\mathrm{Nag_LH_Observer}$.
4:     a[${\mathbf{n}}×{\mathbf{tda}}$]doubleInput/Output
Note: the $\left(i,j\right)$th element of the matrix $A$ is stored in ${\mathbf{a}}\left[\left(i-1\right)×{\mathbf{tda}}+j-1\right]$.
On entry: the leading $n$ by $n$ part of this array must contain the state transition matrix $A$ to be transformed.
On exit: the leading $n$ by $n$ part of this array contains the transformed state transition matrix $UA{U}^{\mathrm{T}}$.
5:     tdaIntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: ${\mathbf{tda}}\ge {\mathbf{n}}$.
6:     c[${\mathbf{p}}×{\mathbf{tdc}}$]doubleInput/Output
Note: the $\left(i,j\right)$th element of the matrix $C$ is stored in ${\mathbf{c}}\left[\left(i-1\right)×{\mathbf{tdc}}+j-1\right]$.
On entry: the leading $p$ by $n$ part of this array must contain the output matrix $C$ to be transformed.
On exit: the leading $p$ by $n$ part of this array contains the transformed output matrix $C{U}^{\mathrm{T}}$.
7:     tdcIntegerInput
On entry: the stride separating matrix column elements in the array c.
Constraint: ${\mathbf{tdc}}\ge {\mathbf{n}}$.
8:     u[${\mathbf{n}}×{\mathbf{tdu}}$]doubleInput/Output
Note: the $\left(i,j\right)$th element of the matrix $U$ is stored in ${\mathbf{u}}\left[\left(i-1\right)×{\mathbf{tdu}}+j-1\right]$.
On entry: if u is not NULL, then the leading $n$ by $n$ part of this array must contain either a transformation matrix (e.g., from a previous call to this function) or be initialized as the identity matrix. If this information is not to be input then u must be set to NULL.
On exit: if u is not NULL, then the leading $n$ by $n$ part of this array contains the product of the input matrix $U$ and the state-space transformation matrix which reduces the given pair to observer Hessenberg form.
9:     tduIntegerInput
On entry: the stride separating matrix column elements in the array u.
Constraint: ${\mathbf{tdu}}\ge {\mathbf{n}}$ if u is defined.
10:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, ${\mathbf{tda}}=⟨\mathit{\text{value}}⟩$ while ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$. These arguments must satisfy ${\mathbf{tda}}\ge {\mathbf{n}}$.
On entry ${\mathbf{tdc}}=⟨\mathit{\text{value}}⟩$ while ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$. These arguments must satisfy ${\mathbf{tdc}}\ge {\mathbf{n}}$.
On entry ${\mathbf{tdu}}=⟨\mathit{\text{value}}⟩$ while ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$. These arguments must satisfy ${\mathbf{tdu}}\ge {\mathbf{n}}$.
On entry, argument reduceto had an illegal value.
NE_INT_ARG_LT
On entry, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge 1$.
On entry, ${\mathbf{p}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{p}}\ge 1$.

## 7  Accuracy

The algorithm is backward stable.

## 8  Parallelism and Performance

Not applicable.

The algorithm requires $O\left(\left(n+m\right){n}^{2}\right)$ operations (see van Dooren and Verhaegen (1985)).

## 10  Example

To reduce the matrix pair $\left(A,C\right)$ to upper observer Hessenberg form.

### 10.1  Program Text

Program Text (g13ewce.c)

### 10.2  Program Data

Program Data (g13ewce.d)

### 10.3  Program Results

Program Results (g13ewce.r)