# lftdata

Decompose uncertain objects into fixed certain and normalized uncertain parts

## Syntax

``[M,Delta] = lftdata(A)``
``[M,Delta,BlockStructure] = lftdata(A)``
``[M,Delta,BlockStructure,normunc] = lftdata(A)``
``[___] = lftdata(A,List)``

## Description

````[M,Delta] = lftdata(A)` separates the uncertain object `A` into a certain object `M` and a normalized uncertain matrix `Delta` such that `A` is equal to `lft(Delta,M)`, as shown in the following illustration. ```

example

````[M,Delta,BlockStructure] = lftdata(A)` returns a structure array `BlockStructure`, where `BlockStructure(i)` describes the ith normalized uncertain element. You can use this structure to specify the uncertainty structure for singular value analysis with `mussv`.```
````[M,Delta,BlockStructure,normunc] = lftdata(A)` returns the cell array `normunc` of normalized uncertain elements. Each normalized element has `'Normalized'` appended to its original name. `lft(blkdiag(normunc{:}),M)` is equivalent to `A`. The normalizations for each type of uncertain element are described in Decomposing Uncertain Objects.```
````[___] = lftdata(A,List)` separates `A` into `M` in feedback with `Delta`, such that `Delta` that includes only the uncertain elements of `A` specified in `List`. All other uncertainty in `A` remains in `M`. `lftdata(A,fieldnames(A.Uncertainty))` is the same as `lftdata(A)`. This kind of separation is called partial decomposition. You can use this syntax with any of the output-argument combinations.```

example

## Examples

collapse all

Create an uncertain matrix `A` with 2 uncertain real parameters `v1` and `v2`. The create an uncertain system `G` using `A` as the dynamic matrix, and numeric matrices for the input and output.

```A = [ureal('p1',-3,'perc',40) 1;1 ureal('p2',-2)]; sys = ss(A,[1;0],[0 1],0); sys.InputGroup.ActualIn = 1; sys.OutputGroup.ActualOut = 1; ```

You can decompose `G` into a certain system, `Msys`, and a normalized uncertain matrix, `Delta`. You can see from `Msys` that it is certain, and that the input and output groups have been adjusted.

```[Msys,Delta] = lftdata(sys); Msys ```
```Msys = A = x1 x2 x1 -3 1 x2 1 -2 B = u1 u2 u3 x1 1.095 0 1 x2 0 1 0 C = x1 x2 y1 1.095 0 y2 0 1 y3 0 1 D = u1 u2 u3 y1 0 0 0 y2 0 0 0 y3 0 0 0 Input groups: Name Channels ActualIn 3 Output groups: Name Channels ActualOut 3 Continuous-time state-space model. ```

You can compute the norm on samples of the difference between the original uncertain matrix and the result formed by combining `Msys` and `Delta`.

`norm(usample(sys-lft(Delta,Msys),'p1',4,'p2',3),'inf') `
```ans = 4×3 0 0 0 0 0 0 0 0 0 0 0 0 ```

Create an uncertain matrix `A` with uncertain parameters `p1`, and `p2`. Decompose `A` into its certain part, `M`, and normalized uncertain part, `Delta`.

```p1 = ureal('p1',-3,'perc',40); p2 = ucomplex('p2',2); A = [p1 p1+p2;1 p2]; [M,Delta] = lftdata(A); ```

You can inspect the difference between the original uncertain matrix, `A`, and the result formed by combining the two results from the decomposition.

`simplify(A-lft(Delta,M)) `
```ans = 2×2 0 0 0 0 ```
`M`
```M = 4×4 0 0 1.0954 1.0954 0 0 0 1.0000 1.0954 1.0000 -3.0000 -1.0000 0 1.0000 1.0000 2.0000 ```

You can check the worst-case norm of the uncertain part using `wcnorm`. Compare samples of the uncertain part `A` with the uncertain matrix `A`.

`wcn = wcnorm(Delta) `
```wcn = struct with fields: LowerBound: 0 UpperBound: 1.0012 ```
`usample(Delta,3) `
```ans = ans(:,:,1) = 0.6294 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.8776 - 0.4413i ans(:,:,2) = 0.8116 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.2704 + 0.2907i ans(:,:,3) = -0.7460 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i -0.3382 + 0.9253i ```

Create an uncertain matrix `A` and derive an uncertain matrix `B` using an implicit-to-explicit conversion, `imp2exp`. Note that `B` has 2 uncertain parameters `R` and `K`. You can decompose `B` into certain part, `M`, and normalized uncertain part, `Delta`.

```R = ureal('R',1,'Percentage',[-10 40]); K = ureal('K',2e-3,'Percentage',[-30 30]); A = [1 -R 0 -K;0 -K 1 0]; Yidx = [1 3]; Uidx = [4 2]; B = imp2exp(A,Yidx,Uidx); [M,Delta] = lftdata(B); ```

The same operation can be performed by defining the uncertain parameters, `K` and `R`, to be extracted.

```[MK,DeltaR] = lftdata(B,'R'); MK ```
```Uncertain matrix with 3 rows and 3 columns. The uncertainty consists of the following blocks: K: Uncertain real, nominal = 0.002, variability = [-30,30]%, 2 occurrences Type "MK.NominalValue" to see the nominal value and "MK.Uncertainty" to interact with the uncertain elements. ```
```[MR,DeltaK] = lftdata(B,'K'); MR ```
```Uncertain matrix with 4 rows and 4 columns. The uncertainty consists of the following blocks: R: Uncertain real, nominal = 1, variability = [-10,40]%, 1 occurrences Type "MR.NominalValue" to see the nominal value and "MR.Uncertainty" to interact with the uncertain elements. ```
`simplify(B-lft(Delta,M)) `
```ans = 2×2 0 0 0 0 ```
`simplify(B-lft(DeltaR,MK)) `
```ans = 2×2 0 0 0 0 ```
`simplify(B-lft(DeltaK,MR)) `
```ans = 2×2 0 0 0 0 ```

Examine the result formed by combining the two results from the decomposition.

```[Mall,Deltaall] = lftdata(B,{'K';'R'}); Mall-M```
```ans = 5×5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ```

## Input Arguments

collapse all

Uncertain system or matrix to decompose, specified as a `uss` model, a `ufrd` model, or a `umat` object.

Uncertain elements to extract, specified as a string array or cell array of character vectors. The entries in `List` specify the names of the uncertain elements of `A` that `lftdata` separates into `Delta`. Other elements are returned in `M`.

Example: `{'p1','p3'}`

Example: `["p1","p3"]`

## Output Arguments

collapse all

Portion of decomposed `A` in feedback with the extracted uncertainty `Delta`, returned as follows:

• If `List` is omitted or specifies all uncertain elements of `A`, then:

• If `A` is a `uss` model, then `M` is an `ss` model.

• If `A` is a `ufrd` model, then `M` is an `frd` model.

• If `A` is a `umat`, then `M` is a numeric matrix.

• If `List` specifies a subset of the uncertain elements of `A`, then `M` is of the same type as `A`.

`M` is such that `A = lft(M,Delta)`

Extracted uncertainty, returned as a `umat` uncertain matrix. The uncertain elements of `Delta` are the same as the uncertain elements of `A` (or the subset specified in `List`). For more information about the structure of `Delta` see Decomposing Uncertain Objects.

Description of uncertain elements in `Delta`, returned as an N-by-1 structure array, where N is the number of uncertain elements in `Delta`. The structure `BlockStructure(i)` contains information about the ith uncertain element of `Delta`. The fields of the structure are:

• `Name` — Name of uncertain element, returned as a character vector.

• `Size` — Dimensions of element, returned as a vector.

• `Type` — Element type, returned as a character vector, such as `'ureal'`, `umat`, or `ucomplex`.

• `Occurrences` — Number of instances of the element in `Delta`, returned as an integer.

• `Simplify` — Autosimplify setting of the element, returned as an integer that encodes the value of the `AutoSimplify` property of the element as follows:

• 2 — `basic`

• 3 — `full`

• 0 — `off`

Normalized uncertainty, returned as a cell array in which each entry is the normalized version of the corresponding block of `Delta`. Normalization transforms the uncertain blocks to standard nominal values and uncertainty ranges as follows:

• `ureal` objects have nominal value of 0, and range from –1 to 1.

• `ultidyn` objects are norm bounded, with norm bound of 1.

• `umargin` objects are converted to norm-bounded `ultidyn` objects with norm bound of 1.

• `ucomplex` objects have nominal value of 0, and radius 1.

• `ucomplexm` objects have nominal value of 0, and identity matrices for each of the `WL` and `WR` weights.

The normalized uncertainties are such that `lft(blkdiag(normunc{:}),M)` is equivalent to `A`. Each normalized element in `normunc` has `'Normalized'` appended to its original name to avoid confusion. For instance, if `Delta` contains an uncertain element with name `'p1'`, the corresponding entry in `normunc` has name `'p1Normalized'`.

## Version History

Introduced before R2006a