Evaluate a gain surface with two scheduling variables over a grid of values of those variables.

When you create a gain surface using `tunableSurface`

, you specify design points at which the gain coefficients are tuned. These points are the typically the scheduling-variable values at which you have sampled or linearized the plant. However, you might want to implement the gain surface as a lookup table with breakpoints that are different from the specified design points. In this example, you create a gain surface with a set of design points and then evaluate the surface using a different set of scheduling-variable values.

Create a scalar-valued gain surface that is a bilinear function of two independent variables, $$\alpha $$ and *V*.

Typically, you would tune the coefficients as part of a control system. For this example, instead of tuning, manually set the coefficients to non-zero values.

Evaluate the gain at selected values of $$\alpha $$ and *V*.

The breakpoints at which you evaluate the gain surface need not fall within the range specified by `domain`

. However, if you attempt to evaluate the gain too far outside the range used for tuning, the software issues a warning.

The breakpoints also need not be regularly spaced. `evalSurf`

evaluates the gain surface over the grid formed by `ndgrid(alpha_vec,V_vec)`

. Examine the dimensions of the resulting array.

By default, the grid dimensions `N1-by-N2`

are first in the array, followed by the gain dimensions. `GS`

is scalar-valued gain, so the dimensions of `GV`

are [7,10,1,1], or equivalently [7,10].

The value in each location of `GV`

is the gain evaluated at the corresponding `(alpha_vec,V_vec)`

pair in the grid. For example, `GV(2,3)`

is the gain evaluated at `(alpha_vec(2),V_vec(3))`

or `(8,450)`

.