# TuningGoal.WeightedGain

Frequency-weighted gain constraint for control system tuning

## Description

Use `TuningGoal.WeightedGain`

to limit the
weighted gain from specified inputs to outputs. The weighted gain is the maximum across
frequency of the gain from input to output, multiplied by weighting functions that you
specify. You can use the `TuningGoal.WeightedGain`

tuning goal for control system tuning with tuning commands such as
`systune`

or `looptune`

.

After you create a tuning goal, you can configure it further by setting Properties of the object.

## Creation

### Description

creates a tuning goal that specifies that the closed-loop transfer function,
`Req`

=
TuningGoal.WeightedGain(`inputname`

,`outputname`

,`WL,WR`

)*H*(*s*), from the specified input to
output meets the requirement:

||W(_{L}s)H(s)W(_{R}s)||_{∞}
< 1. | (1) |

The notation ||•||_{∞} denotes the maximum gain across frequency (the
*H*_{∞} norm).

### Input Arguments

## Properties

## Examples

## Tips

This tuning goal imposes an implicit stability constraint on the weighted closed-loop transfer function from

`Input`

to`Output`

, evaluated with loops opened at the points identified in`Openings`

. The dynamics affected by this implicit constraint are the*stabilized dynamics*for this tuning goal. The`MinDecay`

and`MaxRadius`

options of`systuneOptions`

control the bounds on these implicitly constrained dynamics. If the optimization fails to meet the default bounds, or if the default bounds conflict with other requirements, use`systuneOptions`

to change these defaults.

## Algorithms

When you tune a control system using a `TuningGoal`

, the software
converts the tuning goal into a normalized scalar value
*f*(*x*). *x* is the vector of
free (tunable) parameters in the control system. The software then adjusts the parameter
values to minimize *f*(*x*) or to drive
*f*(*x*) below 1 if the tuning goal is a hard
constraint.

For `TuningGoal.WeightedGain`

,
*f*(*x*) is given by:

$$f\left(x\right)={\Vert {W}_{L}T\left(s,x\right){W}_{R}\Vert}_{\infty}.$$

*T*(*s*,*x*) is the closed-loop
transfer function from `Input`

to `Output`

. $${\Vert \text{\hspace{0.17em}}\cdot \text{\hspace{0.17em}}\Vert}_{\infty}$$ denotes the *H*_{∞} norm
(see `getPeakGain`

).

## Version History

**Introduced in R2016a**

## See Also

`looptune`

| `systune`

| `looptune (for slTuner)`

(Simulink Control Design) | `systune (for slTuner)`

(Simulink Control Design) | `slTuner`

(Simulink Control Design) | `viewGoal`

| `evalGoal`