# getPeakGain

Peak gain of dynamic system frequency response

## Description

example

gpeak = getPeakGain(sys) returns the peak input/output gain in absolute units of the dynamic system model, sys.

• If sys is a SISO model, then the peak gain is the largest value of the frequency response magnitude.

• If sys is a MIMO model, then the peak gain is the largest value of the frequency response 2-norm (the largest singular value across frequency) of sys. This quantity is also called the L norm of sys, and coincides with the H norm for stable systems (see norm).

• If sys is a model that has tunable or uncertain parameters, getPeakGain evaluates the peak gain at the current or nominal value of sys.

• If sys is a model array, getPeakGain returns an array of the same size as sys, where gpeak(k) = getPeakGain(sys(:,:,k)) .

example

gpeak = getPeakGain(sys,tol) returns the peak gain of sys with relative accuracy tol.

example

gpeak = getPeakGain(sys,tol,fband) returns the peak gain in the frequency interval fband.

example

[gpeak,fpeak] = getPeakGain(___) also returns the frequency fpeak at which the gain achieves the peak value gpeak, and can include any of the input arguments in previous syntaxes.

## Examples

collapse all

Compute the peak gain of the resonance in the following transfer function:

$sys=\frac{90}{{s}^{2}+1.5s+90}.$

sys = tf(90,[1,1.5,90]);
gpeak = getPeakGain(sys)
gpeak = 6.3444

The getPeakGain command returns the peak gain in absolute units.

Compute the peak gain of the resonance in the transfer function with a relative accuracy of 0.01%.

$sys=\frac{90}{{s}^{2}+1.5s+90}.$

sys = tf(90,[1,1.5,90]);
gpeak = getPeakGain(sys,0.0001)
gpeak = 6.3444

The second argument specifies a relative accuracy of 0.0001. The getPeakGain command returns a value that is within 0.0001 (0.01%) of the true peak gain of the transfer function. By default, the relative accuracy is 0.01 (1%).

Compute the peak gain of the higher-frequency resonance in the transfer function

$sys=\left(\frac{1}{{s}^{2}+0.2s+1}\right)\left(\frac{100}{{s}^{2}+s+100}\right).$

sys is the product of resonances at 1 rad/s and 10 rad/s.

sys = tf(1,[1,.2,1])*tf(100,[1,1,100]);
fband = [8,12];
gpeak = getPeakGain(sys,0.01,fband);

The fband argument causes getPeakGain to return the local peak gain between 8 and 12 rad/s.

Identify which of the two resonances has higher gain in the transfer function

$sys=\left(\frac{1}{{s}^{2}+0.2s+1}\right)\left(\frac{100}{{s}^{2}+s+100}\right).$

sys is the product of resonances at 1 rad/s and 10 rad/s.

sys = tf(1,[1,.2,1])*tf(100,[1,1,100]);
[gpeak,fpeak] = getPeakGain(sys)
gpeak = 5.0747
fpeak = 0.9902

fpeak is the frequency corresponding to the peak gain gpeak. The peak at 1 rad/s is the overall peak gain of sys.

## Input Arguments

collapse all

Input dynamic system, specified as any dynamic system model or model array. sys can be SISO or MIMO.

Relative accuracy of the peak gain, specified as a positive real scalar value. getPeakGain calculates gpeak such that the fractional difference between gpeak and the true peak gain of sys is no greater than tol. The default value is 0.01, meaning that gpeak is within 1% of the true peak gain.

Frequency interval in which to calculate the peak gain, specified as a 1-by-2 vector of positive real values. Specify fband as a row vector of the form [fmin,fmax].

## Output Arguments

collapse all

Peak gain of the dynamic system model or model array sys, returned as a scalar value or an array.

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

• If sys is a model array, then gpeak is an array of the same size as sys, where gpeak(k) = getPeakGain(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).

## Algorithms

getPeakGain uses the algorithm of [1]. All eigenvalue computations are performed using structure-preserving algorithms from 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.