# ncfmr

Balanced model truncation for normalized coprime factors

## Syntax

```GRED = ncfmr(G)
GRED = ncfmr(G,order)
[GRED,redinfo] = ncfmr(G,key1,value1,...)
[GRED,redinfo] = ncfmr(G,order,key1,value1,...)
```

## Description

`ncfmr` returns a reduced order model GRED formed by a set of balanced normalized coprime factors and a struct array redinfo containing the left and right coprime factors of G and their coprime Hankel singular values.

Hankel singular values of coprime factors of such a stable system indicate the respective “state energy” of the system. Hence, reduced order can be directly determined by examining the system Hankel SV's.

With only one input argument `G`, the function will show a Hankel singular value plot of the original model and prompt for model order number to reduce.

The left and right normalized coprime factors are defined as 

• Left Coprime Factorization: $G={M}_{l}^{-1}\left(s\right){N}_{l}\left(s\right)$

• Right Coprime Factorization: $G={N}_{r}\left(s\right){M}_{r}^{-1}\left(s\right)$

where there exist stable Ur(s), Vr(s), Ul(s) and Vl(s) such that

`$\begin{array}{l}{U}_{r}{N}_{r}+{V}_{r}{M}_{r}=I\\ {N}_{l}{U}_{l}+{M}_{l}{V}_{l}=I\end{array}$`

The left/right coprime factors are stable, hence implies Mr(s) should contain as RHP-zeros all the RHP-poles of G(s). The coprimeness also implies that there should be no common RHP-zeros in Nr(s) and Mr(s), i.e., when forming $G={N}_{r}\left(s\right){M}_{r}^{-1}\left(s\right)$, there should be no pole-zero cancellations.

This table describes input arguments for `ncmfr`.

Argument

Description

`G`

LTI model to be reduced (without any other inputs will plot its Hankel singular values and prompt for reduced order)

`ORDER`

(Optional) Integer for the desired order of the reduced model, or optionally a vector packed with desired orders for batch runs

A batch run of a serial of different reduced order models can be generated by specifying `order = x:y`, or a vector of integers. By default, all the anti-stable part of a system is kept, because from control stability point of view, getting rid of unstable state(s) is dangerous to model a system. The `ncfmr` method allows the original model to have jω-axis singularities.

`'``MaxError``'` can be specified in the same fashion as an alternative for `'``ORDER``'`. In this case, reduced order will be determined when the sum of the tails of the Hankel singular values reaches the `'``MaxError``'`.

Argument

Value

Description

`'``MaxError``'`

A real number or a vector of different errors

Reduce to achieve H error.

When present, `'``MaxError``'` overrides `ORDER` input.

`'``Display``'`

`'``on``'` or `'``off``'`

Display Hankel singular plots (default `'off'`).

`'``Order``'`

integer, vector or cell array

Order of reduced model. Use only if not specified as 2nd argument.

Weights on the original model input and/or output can make the model reduction algorithm focus on some frequency range of interests. But weights have to be stable, minimum phase, and invertible.

This table describes output arguments.

Argument

Description

`GRED`

LTI reduced order model, that becomes multi-dimensional array when input is a serial of different model order array.

`REDINFO`

A STRUCT array with 3 fields:

• ```REDINFO.GL (left coprime factor)```

• ```REDINFO.GR (right coprime factor)```

• ```REDINFO.hsv (Hankel singular values)```

`G` can be stable or unstable, continuous or discrete.

## Examples

Given a continuous or discrete, stable or unstable system, `G`, the following commands can get a set of reduced order models based on your selections:

```rng(1234,'twister'); G = rss(30,5,4); G.D = zeros(5,4); [g1, redinfo1] = ncfmr(G); % display Hankel SV plot % and prompt for order (try 15:20) [g2, redinfo2] = ncfmr(G,20); [g3, redinfo3] = ncfmr(G,[10:2:18]); [g4, redinfo4] = ncfmr(G,'MaxError',[0.01, 0.05]); for i = 1:4 figure(i) eval(['sigma(G,g' num2str(i) ');']); end ```

## Algorithms

Given a state space (A,B,C,D) of a system and k, the desired reduced order, the following steps will produce a similarity transformation to truncate the original state-space system to the kth order reduced model.

1. Find the normalized coprime factors of G by solving Hamiltonian described in .

`$\begin{array}{l}{G}_{l}=\left[\begin{array}{cc}{N}_{l}& {M}_{l}\end{array}\right]\\ {G}_{r}=\left[\begin{array}{c}{N}_{r}\\ {M}_{r}\end{array}\right]\end{array}$`
2. Perform kth order square root balanced model truncation on Gl (or Gr) .

3. The reduced model `GRED` is:

`$\left[\begin{array}{cc}\stackrel{^}{A}& \stackrel{^}{B}\\ \stackrel{^}{C}& \stackrel{^}{D}\end{array}\right]=\left[\begin{array}{cc}{A}_{c}-{B}_{m}{C}_{l}& {B}_{n}-{B}_{m}{D}_{l}\\ {C}_{l}& {D}_{l}\end{array}\right]$`

where

Nl(:= Ac, Bn, Cc, Dn)

Ml := (Ac, Bm, Cc, Dm)

Cl = (Dm)–1Cc

Dl = (Dm)–1Dn

## References

 M. Vidyasagar. Control System Synthesis - A Factorization Approach. London: The MIT Press, 1985.

 M. G. Safonov and R. Y. Chiang, “A Schur Method for Balanced Model Reduction,” IEEE Trans. on Automat. Contr., vol. AC-2, no. 7, July 1989, pp. 729-733. 