tunableGain
Tunable static gain block
Description
Model object for creating tunable static gains. tunableGain
lets you parametrize tunable static gains for parameter studies or for automatic tuning with
tuning commands such as systune
or looptune
.
tunableGain
is part of the Control Design Block family of parametric models. Other
Control Design Blocks include tunablePID
, tunableSS
, and tunableTF
.
Creation
Description
Input Arguments
name
— Name of the block
character vector
Block Name
, specified as a character vector such as
'K'
or 'gain1'
. (See Properties.)
Data Types: char
Ny
— Number of outputs of the parametric static gain block
nonnegative integer
Number of outputs of the parametric static gain block blk
,
specified as nonnegative integer.
Data Types: double
Nu
— Number of inputs of the parametric static gain block
nonnegative integer
Number of inputs of the parametric static gain block blk
,
specified as nonnegative integer.
Data Types: double
G
— Double array of static gain values
array
Initial values of the gain block parameters, specified as a double array. The
number of rows and columns of G
determine the number of inputs
and outputs of blk
.
Data Types: double
Properties
Gain
— Parametrization of the tunable gain
object
blk.Gain
is a param.Continuous
object. For general information about the properties of the param.Continuous
(Simulink Design Optimization) object blk.Gain
, see the param.Continuous
object reference page.
The following fields of blk.Gain
are used when you tune
blk
using hinfstruct
:
Field | Description |
---|---|
Value | Current value of the gain matrix. For a block that has
If
you use the
Default: Array of zero values |
Free | Array of logical values determining whether the gain entries in
Default: Array of 1 ( |
Minimum | Minimum value of the parameter. This property places a lower bound on
the tuned value of the parameter. For example, setting
Default:
|
Maximum | Maximum value of the parameter. This property places an upper bound
on the tuned value of the parameter. For example, setting
Default:
|
Ts
— Sample time
0
(continuous time) (default) | -1
(discrete time) | scalar
Sample time. For continuous-time models, Ts = 0
. For discrete-time
models, Ts
is a positive scalar representing the sampling period.
This value is expressed in the unit specified by the TimeUnit
property of the model. To denote a discrete-time model with unspecified sample time, set
Ts = -1
.
Changing this property does not discretize or resample the model.
TimeUnit
— Time variable units
'seconds'
(default)
Units for the time variable, the sample time Ts
, and any time
delays in the model, specified as one of the following values:
'nanoseconds'
'microseconds'
'milliseconds'
'seconds'
'minutes'
'hours'
'days'
'weeks'
'months'
'years'
Changing this property has no effect on other properties, and therefore changes the
overall system behavior. Use chgTimeUnit
to convert between time
units without modifying system behavior.
InputName
— Input channel names
character vector | cell array of character vectors
Input channel names, specified as one of the following:
Character vector — For single-input models, for example,
'controls'
.Cell array of character vectors — For multi-input models.
Alternatively, use automatic vector expansion to assign input names for multi-input
models. For example, if sys
is a two-input model, enter:
sys.InputName = 'controls';
The input names automatically expand to
{'controls(1)';'controls(2)'}
.
You can use the shorthand notation u
to refer to the
InputName
property. For example, sys.u
is
equivalent to sys.InputName
.
Input channel names have several uses, including:
Identifying channels on model display and plots
Extracting subsystems of MIMO systems
Specifying connection points when interconnecting models
InputUnit
— Input channel units
character vector | cell array of character vectors
Input channel units, specified as one of the following:
Character vector — For single-input models, for example,
'seconds'
.Cell array of character vectors — For multi-input models.
Use InputUnit
to keep track of input signal units.
InputUnit
has no effect on system behavior.
InputGroup
— Input channel groups
structure
Input channel groups for assigning the input channels of MIMO systems, specified as a structure. In this structure, field names are the group names, and field values are the input channels belonging to each group. For example:
sys.InputGroup.controls = [1 2]; sys.InputGroup.noise = [3 5];
creates input groups named controls
and noise
that include input channels 1, 2 and 3, 5, respectively. You can then extract the
subsystem from the controls
inputs to all outputs using:
sys(:,'controls')
OutputName
— Output channel names
character vector | cell array of character vectors
Output channel names, specified as one of the following:
Character vector — For single-output models. For example,
'measurements'
.Cell array of character vectors — For multi-output models.
Alternatively, use automatic vector expansion to assign output names for multi-output
models. For example, if sys
is a two-output model, enter:
sys.OutputName = 'measurements';
The output names automatically expand to
{'measurements(1)';'measurements(2)'}
.
You can use the shorthand notation y
to refer to the
OutputName
property. For example, sys.y
is
equivalent to sys.OutputName
.
Output channel names have several uses, including:
Identifying channels on model display and plots
Extracting subsystems of MIMO systems
Specifying connection points when interconnecting models
OutputUnit
— Output channel units
character vector | cell array of character vectors
Output channel units, specified as one of the following:
Character vector — For single-output models. For example,
'seconds'
.Cell array of character vectors — For multi-output models.
Use OutputUnit
to keep track of output signal units.
OutputUnit
has no effect on system behavior.
OutputGroup
— Output channel groups
struct
(default)
Output channel groups for assigning the output channels of MIMO systems, specified as a structure. In this structure, field names are the group names, and field values are the output channels belonging to each group. For example:
sys.OutputGroup.temperature = [1]; sys.OutputGroup.measurement = [3 5];
creates output groups named temperature
and
measurement
that include output channels 1, and 3, 5,
respectively. You can then extract the subsystem from all inputs to the
measurement
outputs using:
sys('measurement',:)
Name
— System name
character vector
System name, specified as a character vector. For example,
'system_1'
.
Notes
— Any text that you want to associate with the system
string | cell array of character vectors
Any text that you want to associate with the system, stored as a string or a cell
array of character vectors. The property stores whichever data type you provide. For
instance, if sys1
and sys2
are dynamic system
models, you can set their Notes
properties as follows:
sys1.Notes = "sys1 has a string."; sys2.Notes = 'sys2 has a character vector.'; sys1.Notes sys2.Notes
ans = "sys1 has a string." ans = 'sys2 has a character vector.'
UserData
— Any type of data you want to associate with system
any MATLAB® data
Any type of data you want to associate with system, specified as any MATLAB data type.
Examples
Create a 2-by-2 parametric gain block
Create a 2-by-2 parametric gain block of the form
where g1 and g2 are tunable parameters, and the off-diagonal elements are fixed to zero.
blk = tunableGain('gainblock',2,2); % 2 outputs, 2 inputs blk.Gain.Free = [1 0; 0 1]; % fix off-diagonal entries to zero
All entries in blk.Gain.Value
initialize to zero. Initialize the
diagonal values to 1 as follows.
blk.Gain.Value = eye(2); % set diagonals to 1
Initialize all values in a parametric gain block
Create a two-input, three-output parametric gain block and initialize all the parameter values to 1.
To do so, create a matrix to dimension the parametric gain block and initialize the parameter values.
G = ones(3,2);
blk = tunableGain('gainblock',G);
Assign names to the inputs of a 2-by-2 parametric gain block
Create a 2–by-2 parametric gain block and assign names to the inputs.
blk = tunableGain('gainblock',2,2) % 2 outputs, 2 inputs blk.InputName = {'Xerror','Yerror'} % assign input names
Tips
Use the
blk.Gain.Free
field ofblk
to specify additional structure or fix the values of specific entries in the block. To fix the gain value from inputi
to outputj
, setblk.Gain.Free(i,j) = 0
. To allowhinfstruct
to tune this gain value, setblk.Gain.Free(i,j) = 1
.To convert a
tunableGain
parametric model to a numeric (non-tunable) model object, use model commands such astf
,zpk
, orss
.
Version History
Introduced in R2016aR2016a: Name changed from ltiblock.gain
Prior to R2016a, tunableGain
was called
ltiblock.gain
.
See Also
tunablePID
| tunablePID2
| tunableTF
| tunableSS
| systune
| looptune
| genss
| hinfstruct
(Robust Control Toolbox)
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)