hinfstructOptions
Options for hinfstruct
Description
Use hinfstructOptions to define algorithm, display, and parallel
options for the hinfstruct command.
Creation
Description
returns the
default option set for the options = hinfstructOptionshinfstruct command.
specifies options by setting properties using one or more name-value pair arguments.options = hinfstructOptions(Name,Value)
Properties
Amount of information to display during hinfstruct optimization
runs, specified as one of the following values:
'final'— Display a one-line summary at the end of each optimization run. The display includes the minimized value of the closed-loop H∞ norm and the number of iterations for each run.'iter'— Display optimization progress after each iteration. The display includes the value of the closed-loop H∞ norm after each iteration. The display also includes aProgressvalue indicating the percent change in the H∞ norm from the previous iteration.'off'—hinfstructruns in silent mode, displaying no information during or after the run.
Maximum number of iterations in each optimization run, specified as a positive integer. The optimization run terminates after this number of iterations, regardless of whether the run has converged.
Number of additional optimizations starting from random values of the free parameters in the controller, specified as a nonnegative integer.
If RandomStart = 0, hinfstruct
performs a single optimization run starting from the initial values of the tunable
parameters. Setting RandomStart = N > 0 runs
N additional optimizations starting from N
randomly generated parameter values.
hinfstruct finds a local minimum of the gain minimization
problem. To increase the likelihood of finding parameter values that meet your design
requirements, set RandomStart > 0. You can then use the
best design that results from the multiple optimization runs.
Use with UseParallel set to "auto" or
"on" to distribute independent optimization runs among MATLAB® workers (requires Parallel Computing Toolbox™ software).
Option to perform computation in parallel using a parallel pool of workers, specified as one of these values:
"off"— Run in serial on the MATLAB client. Enabling parallel computing may result in improved optimization performance. However, even withUseParallelset to"off", the algorithm can use built-in multithreading to make best use of the local resources. For more information, see MATLAB Multicore."auto"— Use a parallel pool if one is open or if MATLAB can automatically create one. If a parallel pool is not available, run in serial on the MATLAB client."on"— Use a parallel pool if one is open or if MATLAB can automatically create one. If a parallel pool is not available, throw an error.
When you use the RandomStart option to run multiple randomized
optimization starts when tuning a structured controller, you can also use parallel
computing to distribute the optimization runs among workers in a parallel pool.
If you do not have a parallel pool open and automatic pool creation is enabled, MATLAB opens a pool using the default cluster profile. To use a parallel pool to run computations in MATLAB, you must have Parallel Computing Toolbox. For more information, see Run MATLAB Functions with Automatic Parallel Support (Parallel Computing Toolbox).
Before R2026a: To run in parallel , set
UseParallel to true
(1).
Target H∞ norm, specified as a
scalar value or Inf. The hinfstruct optimization
stops when the H∞ norm (peak
closed-loop gain) falls below the specified TargetGain value.
Set TargetGain = 0 to optimize controller performance
by minimizing the peak closed-loop gain. Set
TargetGain = Inf to just stabilize the closed-loop
system.
Relative tolerance for termination specified as a positive scalar value. The
optimization terminates when the H∞
norm decreases by less than TolGain over 10 consecutive iterations.
Increasing TolGain speeds up termination, and decreasing
TolGain yields tighter final values.
Maximum closed-loop natural frequency, specified as a positive scalar value. Setting
MaxFrequency constrains the closed-loop poles to satisfy
|p| < MaxFrequency.
To let hinfstruct choose the closed-loop poles automatically
based upon the system's open-loop dynamics, set
MaxFrequency = Inf. To prevent unwanted fast dynamics or
high-gain control, set MaxFrequency to a finite value.
Specify MaxFrequency in units of 1/TimeUnit,
relative to the TimeUnit property of the system you are tuning.
Minimum decay rate for closed-loop poles, specified as a positive scalar value.
Constrains the closed-loop poles to satisfy
Re(p) < -MinDecay. Increase this value to improve the
stability of closed-loop poles that do not affect the closed-loop gain due to pole/zero
cancellations.
Specify MinDecay in units of 1/TimeUnit,
relative to the TimeUnit property of the system you are tuning.
Examples
Create an options set for a hinfstruct run using three random restarts and a stability offset of 0.001. Also, configure the hinfstruct run to stop as soon as the closed-loop gain is smaller than 1.
options = hinfstructOptions('TargetGain',1,... 'RandomStart',3,'StableOffset',1e-3);
Alternatively, use dot notation to set the values of options.
options = hinfstructOptions; options.TargetGain = 1; options.RandomStart = 3; options.StableOffset = 1e-3;
When you use the RandomStart option to run
multiple randomized optimization starts, you can also use parallel computing to speed up
tuning by distributing the optimization runs among workers. (Using parallel computing
requires a Parallel Computing Toolbox license.) For this example, configure an option set for
hinfstruct with 20 independent optimization restarts, executed
concurrently on multiple workers in a parallel pool.
If Automatically create a parallel pool is not selected in your
Parallel Computing Toolbox preferences (Parallel Computing Toolbox), manually start a parallel pool using parpool (Parallel Computing Toolbox).
parpool;
If Automatically create a parallel pool is selected in your preferences, you do not need to manually start a pool.
Create an hinfstructOptions set that specifies 20 random restarts
to run in parallel.
options = hinfstructOptions(RandomStart=20,UseParallel="on");Setting UseParallel to "auto" or
"on" enables parallel processing by distributing the randomized
starts among available workers in the parallel pool. For more information, see Run MATLAB Functions with Automatic Parallel Support (Parallel Computing Toolbox).
Use the hinfstructOptions set when you call
hinfstruct. For example, suppose you have already created a tunable
closed loop model CL0. In this case, the following command uses
parallel computing to tune CL0.
[CL,gamma,info] = hinfstruct(CL0,options);
Version History
Introduced in R2010bThe UseParallel name-value argument now accepts
"off", "auto", or "on" values
instead of true or false. This change gives you more
control over when to use a parallel pool for parallel execution.
Specifying the UseParallel name-value argument as
true or false is not recommended.
This table shows how to update your code depending on your goal.
| Goal | Not recommended | Recommended |
|---|---|---|
| Write code that runs on the MATLAB client and uses built-in multithreading to make best use of the local resources. | opt = hinfstructOptions(UseParallel=false) | opt = hinfstructOptions(UseParallel="off") (default) |
| Write portable code that runs on a parallel pool and, if a pool is not available, runs on the MATLAB client. | opt = hinfstructOptions(UseParallel=true) | opt = hinfstructOptions(UseParallel="auto") |
| Write code that runs on a parallel pool and errors if a pool is not available. | N/A | opt = hinfstructOptions(UseParallel="on") |
There are no plans to remove support for the true or
false values.
See Also
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)