# norm

Norm of linear model

## Syntax

``n = norm(sys)``
``````n = norm(sys,2)``````
``n = norm(sys,Inf)``
``````[n,fpeak] = norm(sys,Inf)``````
``[n,fpeak] = norm(sys,Inf,tol)``

## Description

example

````n = norm(sys)` or ```n = norm(sys,2)``` returns the root-mean-squares of the impulse response of the linear dynamic system model `sys`. This value is equivalent to the H2 norm of `sys`.```
````n = norm(sys,Inf)` returns the L∞ norm of `sys`, which is the peak gain of the frequency response of `sys` across frequencies. For MIMO systems, this quantity is the peak gain over all frequencies and all input directions, which corresponds to the peak value of the largest singular value of `sys`. For stable systems, the L∞ norm is equivalent to the H∞ norm. For more information, see `hinfnorm` (Robust Control Toolbox). ```

example

``````[n,fpeak] = norm(sys,Inf)``` also returns the frequency `fpeak` at which the gain reaches its peak value.```
````[n,fpeak] = norm(sys,Inf,tol)` sets the relative accuracy of the L∞ norm to `tol`. ```

## Examples

collapse all

Compute the ${H}_{2}$ and ${L}_{\infty }$ norms of the following discrete-time transfer function, with sample time 0.1 second.

`$sys\left(z\right)=\frac{{z}^{3}-2.841{z}^{2}+2.875z-1.004}{{z}^{3}-2.417{z}^{2}+2.003z-0.5488}.$`

Compute the ${H}_{2}$ norm of the transfer function. The ${H}_{2}$ norm is the root-mean-square of the impulse response of `sys`.

```sys = tf([1 -2.841 2.875 -1.004],[1 -2.417 2.003 -0.5488],0.1); n2 = norm(sys)```
```n2 = 1.2438 ```

Compute the ${L}_{\infty }$ norm of the transfer function.

`[ninf,fpeak] = norm(sys,Inf)`
```ninf = 2.5721 ```
```fpeak = 3.0178 ```

Because sys is a stable system, `ninf` is the peak gain of the frequency response of `sys`, and `fpeak` is the frequency at which the peak gain occurs. Confirm these values using `getPeakGain`.

`[gpeak,fpeak] = getPeakGain(sys)`
```gpeak = 2.5721 ```
```fpeak = 3.0178 ```

## Input Arguments

collapse all

Input dynamic system, specified as any SISO or MIMO linear dynamic system model or model array. `sys` can be continuous-time or discrete-time.

Relative accuracy of the H norm, specified as a positive real scalar value.

## Output Arguments

collapse all

H2 norm or L norm of `sys`, returned as a scalar or an array.

• If `sys` is a single model, then `n` is a scalar value.

• If `sys` is a model array, then `n` is an array of the same size as `sys`, where ```n(k) = norm(sys(:,:,k))```.

Frequency at which the gain achieves the peak value `gpeak`, returned as a nonnegative real scalar value or an array of nonnegative real values. The frequency is expressed in units of rad/`TimeUnit`, relative to the `TimeUnit` property of `sys`.

• If `sys` is a single model, then `fpeak` is a scalar.

• If `sys` is a model array, then `fpeak` is an array of the same size as `sys`, where `fpeak(k)` is the peak gain frequency of `sys(:,:,k)`.

collapse all

### H2 norm

The H2 norm of a stable system H is the root-mean-square of the impulse response of the system. The H2 norm measures the steady-state covariance (or power) of the output response y = Hw to unit white noise inputs w:

The H2 norm of a continuous-time system with transfer function H(s) is given by:

For a discrete-time system with transfer function H(z), the H2 norm is given by:

`${‖H‖}_{2}=\sqrt{\frac{1}{2\pi }{\int }_{-\pi }^{\pi }\text{Trace}\left[H{\left({e}^{j\omega }\right)}^{H}H\left({e}^{j\omega }\right)\right]d\omega }.$`

The H2 norm is infinite in the following cases:

• `sys` is unstable.

• `sys` is continuous and has a nonzero feedthrough (that is, nonzero gain at the frequency ω = ∞).

Using `norm(sys)` produces the same result as `sqrt(trace(covar(sys,1)))`.

### L-infinity norm

The L norm of a SISO linear system is the peak gain of the frequency response. For a MIMO system, the L norm is the peak gain across all input/output channels.

For a continuous-time system H(s), this definition means:

where σmax(·) denotes the largest singular value of a matrix.

For a discrete-time system H(z), the definition means:

For stable systems, the L norm is equivalent to the H norm. For more information, see `hinfnorm` (Robust Control Toolbox). For a system with unstable poles, the H norm is infinite. For all systems, `norm` returns the L norm, which is the peak gain without regard to system stability.

## Algorithms

After converting `sys` to a state space model, `norm` uses the same algorithm as `covar` for the H2 norm. For the L norm, `norm` uses the algorithm of [1]. `norm` computes the peak gain using the SLICOT library. For more information about the SLICOT library, see http://slicot.org.

## References

[1] Bruisma, N.A. and M. Steinbuch, "A Fast Algorithm to Compute the H-Norm of a Transfer Function Matrix," System Control Letters, 14 (1990), pp. 287-293.