# freqsep

Slow-fast decomposition

## Syntax

## Description

`[`

computes the decomposition where `G1`

,`G2`

]
= freqsep(`G`

,`[fmin,fmax]`

)`G1`

contains all modes with
natural frequency *f _{min}* ≤

*ω*≤

_{n}*f*and

_{max}`G2`

contains the remaining modes.*(since R2023b)*

## Examples

### Decompose Model into Fast and Slow Dynamics

Load a dynamic system model.

load numdemo Pd bode(Pd)

`Pd`

has four complex poles and one real pole. The Bode plot shows a resonance around 210 rad/s and a higher-frequency resonance below 10,000 rad/s.

Decompose this model around 1000 rad/s to separate these two resonances.

[Gs,Gf] = freqsep(Pd,10^3); bode(Pd,Gs,Gf) legend('original','slow','fast','Location','Southwest')

ans = Legend (original, slow, fast) with properties: String: {'original' 'slow' 'fast'} Location: 'southwest' Orientation: 'vertical' FontSize: 8.1000 Position: [0.1673 0.6060 0.1807 0.1278] Units: 'normalized' Use GET to show all properties

The Bode plot shows that the slow component, `Gs`

, contains only the lower-frequency resonance. This component also matches the DC gain of the original model. The fast component, `Gf`

, contains the higher-frequency resonances and matches the response of the original model at high frequencies. The sum of the two components `Gs+Gf`

yields the original model.

### Separate Nearby Modes by Adjusting Tolerance

Decompose a model into slow and fast components between poles that are closely spaced.

The following system includes a real pole and a complex pair of poles that are all close to *s* = -2.

G = zpk(-.5,[-1.9999 -2+1e-4i -2-1e-4i],10);

Try to decompose the model about 2 rad/s, so that the slow component contains the real pole and the fast component contains the complex pair.

[Gs,Gf] = freqsep(G,2);

Warning: One or more fast modes could not be separated from the slow modes. To force separation, relax the accuracy constraint by increasing the "SepTol" factor (see "freqsepOptions" for details).

These poles are too close together for `freqsep`

to separate. Increase the relative tolerance to allow the separation.

[Gs,Gf] = freqsep(G,2,SepTol=5e10);

Now `freqsep`

successfully separates the dynamics.

slowpole = pole(Gs)

slowpole = -1.9999

fastpole = pole(Gf)

`fastpole = `*2×1 complex*
-2.0000 + 0.0001i
-2.0000 - 0.0001i

### Decompose State-Space Model to Obtain Modes in Frequency Range

This example shows how to decompose a model and retain the modes in a specified frequency range using `freqsep`

.

Load the model `Gms`

and examine its frequency response.

load modeselect Gms bodeplot(Gms)

Use `freqsep`

to retain the dynamics in the frequency range 0.1 rad/s to 50 rad/s.

[G1,G2] = freqsep(Gms,[0.1,50]);

In this decomposition, the output `G1`

contains all poles with natural frequency in the range `[0.1,50]`

and `G2`

contains the remaining poles.

bodeplot(Gms,G1,G2) legend

ans = Legend (Gms, G1, G2) with properties: String: {'Gms' 'G1' 'G2'} Location: 'northeast' Orientation: 'vertical' FontSize: 8.1000 Position: [0.8059 0.8188 0.1486 0.1278] Units: 'normalized' Use GET to show all properties

## Input Arguments

`G`

— Dynamic system to decompose

numeric LTI model

Dynamic system to decompose, specified as a numeric LTI model,
such as a `ss`

or `tf`

model.

`st`

— Accuracy loss factor

10 (default) | nonnegative scalar

*Since R2023b*

Accuracy loss factor for slow-fast decomposition, specified as a
nonnegative scalar value. `freqresp`

ensures that the
frequency responses of the original system, `G`

, and the
sum of the decomposed systems `G1+G2`

, differ by no more
than `SepTol`

times the absolute accuracy of the computed
value of `G(s)`

. Increasing `SepTol`

helps
separate modes straddling the slow/fast boundary at the expense of
accuracy.

## Output Arguments

`info`

— Additional information

structure | `[]`

*Since R2023b*

Additional information about the decomposition, returned as structure with these fields.

Field | Description |
---|---|

`TL` | Left-side matrix of the block-diagonalizing
transformation, returned as a matrix with dimensions
Nx-by-Nx, where
Nx is the number of states in the
model G. |

`TR` | Right-side matrix of the block-diagonalizing
transformation, returned as a matrix with dimensions
Nx-by-Nx, where
Nx is the number of states in the
model G. |

The algorithm transforms the state-space realization
(*A*, *B*, *C*,
*D*) of the model `G`

to

$$\begin{array}{ccc}{T}_{L}A{T}_{R}=\left(\begin{array}{cc}{A}_{1}& 0\\ 0& {A}_{2}\end{array}\right),& {T}_{L}B=\left(\begin{array}{c}{B}_{1}\\ {B}_{2}\end{array}\right),& C{T}_{R}=\left(\begin{array}{cc}{C}_{1}& {C}_{2}\end{array}\right)\end{array}$$

The function returns an empty value `[]`

for this
argument when the input model `G`

is not a state-space
model.

## Version History

**Introduced in R2014a**

### R2023b: New syntax

Use the new syntax `[G1,G2] = freqsep(G,[fmin,fmax])`

to obtain a
decomposition where `G1`

contains all poles with natural
frequency in the range `[fmin,fmax]`

and `G2`

contains the remaining poles.

### R2023b: Use simplified syntax

Starting in R2023b, you can specify the `SepTol`

option
directly as a name-value argument. For example:

[G1,G2] = freqsep(G,2,SepTol=1e9);

As a result of this change, `freqsepOptions`

and the syntax
`[Gs,Gf] = freqsep(G,fcut,options)`

are not recommended.

## Comando de MATLAB

Ha hecho clic en un enlace que corresponde a este comando de MATLAB:

Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)