# makepassive

Enforce passivity of rational fit

## Syntax

``pfit = makepassive(fit,s)``
``pfit = makepassive(fit,s,'Display','on')``

## Description

````pfit = makepassive(fit,s)` produces a passive fit by modifying the input, `fit` while optimally matching the data of S-parameter input, `s`. `makepassive` function does modifies the residues of the `fit` to make it passive.```

example

````pfit = makepassive(fit,s,'Display','on')` solves as above, but turns on the display of iteration information. The default for `'Display'` is `'off'`.```

## Examples

collapse all

Read a file named `passive.s2p` and fit the 2x2 S-parameters.

``` S = sparameters('passive.s2p'); fit = rationalfit(S);```

Plot the passivity of the 2x2 fit, noting the violations.

``` figure passivity(fit)```

Optimize residues to produce a passive fit still close to S.

` pfit = makepassive(fit,S)`
```pfit = 2x2 rfmodel.rational array with properties: A C D Delay Name ```

To display iteration information:

` pfit = makepassive(fit,S,'Display','on' )`
```Iter H-infinity norm Frequency Error (dB) Constraints 0 1+1.79e-02 17.7 GHz -40.4702 1 1+2.69e-04 282 MHz -40.9169 5 2 1+7.35e-05 376 MHz -40.9078 8 3 1+1.00e-06 361 MHz -40.9067 9 4 1-2.55e-06 368 MHz -40.9062 10 ```
```pfit = 2x2 rfmodel.rational array with properties: A C D Delay Name ```

Plot the passivity of the new fit.

``` figure passivity(pfit)```

## Input Arguments

collapse all

Rational fit object, specified as an N-by-N array of a `rational` or `rationalfit` object.

S-parameters, specified as an RF Toolbox™ network parameter object. To create this type of object, use the `sparameters` function.

## Output Arguments

collapse all

`rfmodel.rational` objects, returned as N-by-N array.

## Version History

Introduced in R2019a