# dcgain

Low-frequency (DC) gain of LTI system

## Syntax

```k = dcgain(sys) ```

## Description

`k = dcgain(sys) ` computes the DC gain `k` of the LTI model `sys`.

### Continuous Time

The continuous-time DC gain is the transfer function value at the frequency s = 0. For state-space models with matrices (ABCD), this value is

K = D – CA–1B

### Discrete Time

The discrete-time DC gain is the transfer function value at z = 1. For state-space models with matrices (ABCD), this value is

K = D + C(I – A)–1B

## Examples

collapse all

Create the following 2-input 2-output continuous-time transfer function.

`$H\left(s\right)=\left[\begin{array}{cc}1& \frac{s-1}{{s}^{2}+s+3}\\ \frac{1}{s+1}& \frac{s+2}{s-3}\end{array}\right]$`

`H = [1 tf([1 -1],[1 1 3]) ; tf(1,[1 1]) tf([1 2],[1 -3])];`

Compute the DC gain of the transfer function. For continuous-time models, the DC gain is the transfer function value at the frequency `s = 0`.

`K = dcgain(H)`
```K = 2×2 1.0000 -0.3333 1.0000 -0.6667 ```

The DC gain for each input-output pair is returned. `K(i,j)` is the DC gain from input j to output i.

`load iddata1 z1`

`z1` is an `iddata` object containing the input-output estimation data.

Estimate a process model from the data. Specify that the model has one pole and a time delay term.

`sys = procest(z1,'P1D')`
```sys = Process model with transfer function: Kp G(s) = ---------- * exp(-Td*s) 1+Tp1*s Kp = 9.0754 Tp1 = 0.25655 Td = 0.068 Parameterization: {'P1D'} Number of free coefficients: 3 Use "getpvec", "getcov" for parameters and their uncertainties. Status: Estimated using PROCEST on time domain data "z1". Fit to estimation data: 44.85% FPE: 6.02, MSE: 5.901 ```

Compute the DC gain of the model.

`K = dcgain(sys)`
```K = 9.0754 ```

This DC gain value is stored in the `Kp` property of `sys`.

`sys.Kp`
```ans = 9.0754 ```

## Tips

The DC gain is infinite for systems with integrators.

## Version History

Introduced in R2012a