Find minimum of function using genetic algorithm
finds a local unconstrained minimum, x
= ga(fun
,nvars
)x
, to the objective
function, fun
. nvars
is the dimension (number
of design variables) of fun
.
Passing Extra Parameters (Optimization Toolbox) explains how to pass extra parameters to the objective function and nonlinear constraint functions, if necessary.
subjects the minimization to the constraints defined in x
= ga(fun
,nvars
,A
,b
,Aeq
,beq
,lb
,ub
,nonlcon
)nonlcon
.
The function nonlcon
accepts x
and returns
vectors C
and Ceq
, representing the nonlinear
inequalities and equalities respectively. ga
minimizes the
fun
such that
C(x)
≤ 0
and
Ceq(x) = 0
. (Set lb=[]
and
ub=[]
if no bounds exist.)
or
x
= ga(fun
,nvars
,A
,b
,[],[],lb
,ub
,nonlcon
,IntCon
)
requires that the variables listed in x
= ga(fun
,nvars
,A
,b
,[],[],lb
,ub
,nonlcon
,IntCon
,options
)IntCon
take integer
values.
When there are integer constraints, ga
does not
accept linear or nonlinear equality constraints, only inequality
constraints.
ga
The ps_example.m
file ships with your software. Plot the function.
xi = linspace(-6,2,300); yi = linspace(-4,4,300); [X,Y] = meshgrid(xi,yi); Z = ps_example([X(:),Y(:)]); Z = reshape(Z,size(X)); surf(X,Y,Z,'MeshStyle','none') colormap 'jet' view(-26,43) xlabel('x(1)') ylabel('x(2)') title('ps\_example(x)')
Find the minimum of this function using ga
.
rng default % For reproducibility x = ga(@ps_example,2)
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
x = 1×2
-4.6793 -0.0860
Use the genetic algorithm to minimize the ps_example
function on the region x(1) + x(2) >= 1
and x(2) <= 5 + x(1)
.
First, convert the two inequality constraints to the matrix form A*x <= b
. In other words, get the x
variables on the left-hand side of the inequality, and make both inequalities less than or equal:
-x(1) -x(2) <= -1
-x(1) + x(2) <= 5
A = [-1,-1; -1,1]; b = [-1;5];
Solve the constrained problem using ga
.
rng default % For reproducibility fun = @ps_example; x = ga(fun,2,A,b)
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
x = 1×2
0.9992 -0.0000
The constraints are satisfied to within the default value of the constraint tolerance, 1e-3
. To see this, compute A*x' - b
, which should have negative components.
disp(A*x' - b)
0.0008 -5.9992
Use the genetic algorithm to minimize the ps_example
function on the region x(1) + x(2) >= 1
and x(2) == 5 + x(1)
.
First, convert the two constraints to the matrix form A*x <= b
and Aeq*x = beq
. In other words, get the x
variables on the left-hand side of the expressions, and make the inequality into less than or equal form:
-x(1) -x(2) <= -1
-x(1) + x(2) == 5
A = [-1 -1]; b = -1; Aeq = [-1 1]; beq = 5;
Solve the constrained problem using ga
.
rng default % For reproducibility fun = @ps_example; x = ga(fun,2,A,b,Aeq,beq)
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
x = 1×2
-2.0000 2.9990
Check that the constraints are satisfied to within the default value of ConstraintTolerance
, 1e-3
.
disp(A*x' - b)
1.0000e-03
disp(Aeq*x' - beq)
-9.9997e-04
Use the genetic algorithm to minimize the ps_example
function on the region x(1) + x(2) >= 1
and x(2) == 5 + x(1)
. In addition, set bounds 1 <= x(1) <= 6
and -3 <= x(2) <= 8
.
First, convert the two linear constraints to the matrix form A*x <= b
and Aeq*x = beq
. In other words, get the x
variables on the left-hand side of the expressions, and make the inequality into less than or equal form:
-x(1) -x(2) <= -1
-x(1) + x(2) == 5
A = [-1 -1]; b = -1; Aeq = [-1 1]; beq = 5;
Set bounds lb
and ub
.
lb = [1 -3]; ub = [6 8];
Solve the constrained problem using ga
.
rng default % For reproducibility fun = @ps_example; x = ga(fun,2,A,b,Aeq,beq,lb,ub)
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
x = 1×2
1.0000 5.9991
Check that the linear constraints are satisfied to within the default value of ConstraintTolerance
, 1e-3
.
disp(A*x' - b)
-5.9991
disp(Aeq*x' - beq)
-9.4115e-04
ga
Use the genetic algorithm to minimize the ps_example
function on the region and .
To do so, first write a function ellipsecons.m
that returns the inequality constraint in the first output, c
, and the equality constraint in the second output, ceq
. Save the file ellipsecons.m
to a folder on your MATLAB® path.
type ellipsecons
function [c,ceq] = ellipsecons(x) c = 2*x(1)^2 + x(2)^2 - 3; ceq = (x(1)+1)^2 - (x(2)/2)^4;
Include a function handle to ellipsecons
as the nonlcon
argument.
nonlcon = @ellipsecons; fun = @ps_example; rng default % For reproducibility x = ga(fun,2,[],[],[],[],[],[],nonlcon)
Optimization terminated: average change in the fitness value less than options.FunctionTolerance and constraint violation is less than options.ConstraintTolerance.
x = 1×2
-0.9766 0.0362
Check that the nonlinear constraints are satisfied at x
. The constraints are satisfied when c
≤ 0 and ceq
= 0 to within the default value of ConstraintTolerance
, 1e-3
.
[c,ceq] = nonlcon(x)
c = -1.0911
ceq = 5.4645e-04
Use the genetic algorithm to minimize the ps_example
function on the region x(1) + x(2) >= 1
and x(2) == 5 + x(1)
using a constraint tolerance that is smaller than the default.
First, convert the two constraints to the matrix form A*x <= b
and Aeq*x = beq
. In other words, get the x
variables on the left-hand side of the expressions, and make the inequality into less than or equal form:
-x(1) -x(2) <= -1
-x(1) + x(2) == 5
A = [-1 -1]; b = -1; Aeq = [-1 1]; beq = 5;
To obtain a more accurate solution, set a constraint tolerance of 1e-6
. And to monitor the solver progress, set a plot function.
options = optimoptions('ga','ConstraintTolerance',1e-6,'PlotFcn', @gaplotbestf);
Solve the minimization problem.
rng default % For reproducibility fun = @ps_example; x = ga(fun,2,A,b,Aeq,beq,[],[],[],options)
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
x = 1×2
-2.0000 3.0000
Check that the linear constraints are satisfied to within 1e-6
.
disp(A*x' - b)
9.9957e-07
disp(Aeq*x' - beq)
-9.8576e-07
Use the genetic algorithm to minimize the ps_example
function subject to the constraint that x(1)
is an integer.
IntCon = 1; rng default % For reproducibility fun = @ps_example; A = []; b = []; Aeq = []; beq = []; lb = []; ub = []; nonlcon = []; x = ga(fun,2,A,b,Aeq,beq,lb,ub,nonlcon,IntCon)
Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance and constraint violation is less than options.ConstraintTolerance.
x = 1×2
-5.0000 -0.0000
Use to genetic algorithm to minimize an integer-constrained nonlinear problem. Obtain both the location of the minimum and the minimum function value.
IntCon = 1; rng default % For reproducibility fun = @ps_example; A = []; b = []; Aeq = []; beq = []; lb = []; ub = []; nonlcon = []; [x,fval] = ga(fun,2,A,b,Aeq,beq,lb,ub,nonlcon,IntCon)
Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance and constraint violation is less than options.ConstraintTolerance.
x = 1×2
-5.0000 -0.0000
fval = -1.9178
Compare this result to the solution of the problem with no constraints.
[x,fval] = ga(fun,2)
Optimization terminated: maximum number of generations exceeded.
x = 1×2
-4.7121 0.0051
fval = -1.9949
Use the genetic algorithm to minimize the ps_example
function constrained to have x(1)
integer-valued. To understand the reason the solver stopped and how ga
searched for a minimum, obtain the exitflag
and output
results. Also, plot the minimum observed objective function value as the solver progresses.
IntCon = 1; rng default % For reproducibility fun = @ps_example; A = []; b = []; Aeq = []; beq = []; lb = []; ub = []; nonlcon = []; options = optimoptions('ga','PlotFcn', @gaplotbestf); [x,fval,exitflag,output] = ga(fun,2,A,b,Aeq,beq,lb,ub,nonlcon,IntCon,options)
Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance and constraint violation is less than options.ConstraintTolerance.
x = 1×2
-5.0000 -0.0000
fval = -1.9178
exitflag = 1
output = struct with fields:
problemtype: 'integerconstraints'
rngstate: [1x1 struct]
generations: 96
funccount: 3691
message: 'Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance...'
maxconstraint: 0
Use the genetic algorithm to minimize the ps_example
function constrained to have x(1)
integer-valued. Obtain all outputs, including the final population and vector of scores.
IntCon = 1; rng default % For reproducibility fun = @ps_example; A = []; b = []; Aeq = []; beq = []; lb = []; ub = []; nonlcon = []; [x,fval,exitflag,output,population,scores] = ga(fun,2,A,b,Aeq,beq,lb,ub,nonlcon,IntCon);
Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance and constraint violation is less than options.ConstraintTolerance.
Examine the first 10 members of the final population and their corresponding scores. Notice that x(1)
is integer-valued for all these population members. The integer ga
algorithm generates only integer-feasible populations.
disp(population(1:10,:))
-5.0000 -0.0000 -5.0000 -0.0000 -5.0000 0.0014 -6.0000 0.0008 -13.0000 -0.0124 -10.0000 0.0011 -4.0000 -0.0010 0 0.0072 -4.0000 0.0010 -5.0000 -0.0000
disp(scores(1:10))
-1.9178 -1.9178 -1.9165 1.0008 64.0124 25.0011 -1.5126 2.5072 -1.5126 -1.9178
fun
— Objective functionObjective function, specified as a function handle or function name. Write the objective
function to accept a row vector of length
nvars
and return a scalar
value.
When the 'UseVectorized'
option is true
, write
fun
to accept a
pop
-by-nvars
matrix, where pop
is the current
population size. In this case,
fun
returns a vector the same
length as pop
containing the
fitness function values. Ensure that
fun
does not assume any
particular size for pop
, since
ga
can pass a single
member of a population even in a vectorized
calculation.
Example: fun = @(x)(x-[4,2]).^2
Data Types: char
| function_handle
| string
nvars
— Number of variablesNumber of variables, specified as a positive integer. The solver passes row vectors of length
nvars
to fun
.
Example: 4
Data Types: double
A
— Linear inequality constraintsLinear inequality constraints, specified as a real matrix. A
is an M
-by-nvars
matrix, where M
is the number of inequalities.
A
encodes the M
linear inequalities
A*x <= b
,
where x
is the column vector of nvars
variables x(:)
, and b
is a column vector with M
elements.
For example, to specify
x1 + 2x2 ≤ 10
3x1 + 4x2 ≤ 20
5x1 + 6x2 ≤ 30,
give these constraints:
A = [1,2;3,4;5,6]; b = [10;20;30];
Example: To specify that the control variables sum to 1 or less, give the constraints
A = ones(1,N)
and b = 1
.
Data Types: double
b
— Linear inequality constraintsLinear inequality constraints, specified as a real vector. b
is an M
-element vector related to the A
matrix. If you pass b
as a row vector, solvers internally convert b
to the column vector b(:)
.
b
encodes the M
linear inequalities
A*x <= b
,
where x
is the column vector of N
variables x(:)
, and A
is a matrix of size M
-by-N
.
For example, to specify
x1 + 2x2 ≤ 10
3x1 + 4x2 ≤ 20
5x1 + 6x2 ≤ 30,
give these constraints:
A = [1,2;3,4;5,6]; b = [10;20;30];
Example: To specify that the control variables sum to 1 or less, give the constraints
A = ones(1,N)
and b = 1
.
Data Types: double
Aeq
— Linear equality constraintsLinear equality constraints, specified as a real matrix. Aeq
is an Me
-by-nvars
matrix, where Me
is the number of equalities.
Aeq
encodes the Me
linear equalities
Aeq*x = beq
,
where x
is the column vector of N
variables x(:)
, and beq
is a column vector with Me
elements.
For example, to specify
x1
+ 2x2 +
3x3 =
10
2x1
+ 4x2 +
x3 =
20,
give these constraints:
Aeq = [1,2,3;2,4,1]; beq = [10;20];
Example: To specify that the control variables sum to 1, give the constraints Aeq =
ones(1,N)
and beq = 1
.
Data Types: double
beq
— Linear equality constraintsLinear equality constraints, specified as a real vector. beq
is an Me
-element vector related to the Aeq
matrix. If you pass beq
as a row vector, solvers internally convert beq
to the column vector beq(:)
.
beq
encodes the Me
linear equalities
Aeq*x = beq
,
where x
is the column vector of N
variables x(:)
, and Aeq
is a matrix of size Meq
-by-N
.
For example, to specify
x1
+ 2x2 +
3x3 =
10
2x1
+ 4x2 +
x3 =
20,
give these constraints:
Aeq = [1,2,3;2,4,1]; beq = [10;20];
Example: To specify that the control variables sum to 1, give the constraints Aeq =
ones(1,N)
and beq = 1
.
Data Types: double
lb
— Lower bounds[]
(default) | real vector or arrayLower bounds, specified as a real vector or array of doubles. lb
represents
the lower bounds element-wise in
lb
≤ x
≤ ub
.
Internally, ga
converts an array lb
to the
vector lb(:)
.
Example: lb = [0;-Inf;4]
means x(1) ≥ 0
, x(3) ≥ 4
.
Data Types: double
ub
— Upper bounds[]
(default) | real vector or arrayUpper bounds, specified as a real vector or array of doubles. ub
represents
the upper bounds element-wise in
lb
≤ x
≤ ub
.
Internally, ga
converts an array ub
to the
vector ub(:)
.
Example: ub = [Inf;4;10]
means x(2) ≤ 4
, x(3) ≤ 10
.
Data Types: double
nonlcon
— Nonlinear constraintsNonlinear constraints, specified as a function handle or function name.
nonlcon
is a function that accepts a vector or array
x
and returns two arrays, c(x)
and
ceq(x)
.
c(x)
is the array of nonlinear inequality
constraints at x
. ga
attempts to satisfy
c(x) <= 0
for all entries of c
.
ceq(x)
is the array of nonlinear equality
constraints at x
. ga
attempts to satisfy
ceq(x) = 0
for all entries of ceq
.
For example,
x = ga(@myfun,4,A,b,Aeq,beq,lb,ub,@mycon)
where mycon
is a MATLAB® function such
as
function [c,ceq] = mycon(x) c = ... % Compute nonlinear inequalities at x. ceq = ... % Compute nonlinear equalities at x.
To learn how to use vectorized constraints, see Vectorized Constraints.
ga
does not enforce nonlinear constraints to be
satisfied when the PopulationType
option is set to
'bitString'
or
'custom'
.
If IntCon
is not empty, the second output of
nonlcon
(ceq
) must be an empty
entry ([]
).
For information on how ga
uses
nonlcon
, see Nonlinear Constraint Solver Algorithms.
Data Types: char
| function_handle
| string
options
— Optimization optionsoptimoptions
| structureOptimization options, specified as the output of
optimoptions
or a structure.
Create options
by using optimoptions
(recommended) or
by exporting options from the Optimization app. For details, see Importing and Exporting Your Work (Optimization Toolbox).
optimoptions
hides the options listed in
italics. See Options that optimoptions Hides.
Values in {}
denote the default value.
{}*
represents the default when there are
linear constraints, and for MutationFcn
also when
there are bounds.
I* indicates that
ga
handles options for integer constraints
differently; this notation does not apply to
gamultiobj
.
NM indicates that the option does
not apply to gamultiobj
.
Options for ga
, Integer ga
,
and gamultiobj
Option | Description | Values |
---|---|---|
ConstraintTolerance | Determines the feasibility with respect to nonlinear constraints. Also,
For an options
structure, use | Positive scalar | |
| I* Function that creates the initial population. Specify as a name of a built-in creation function or a function handle. See Population Options. |
|
| I* Function that the algorithm uses to create crossover children. Specify as a name of a built-in crossover function or a function handle. See Crossover Options. |
|
| The fraction of the population at the next generation, not including elite children, that the crossover function creates. | Positive scalar | |
| Level of display. |
|
| Function that computes distance measure of individuals. Specify as a name of a built-in
distance measure function or a function handle. The value applies to
decision variable or design space (genotype) or to function space
(phenotype). The default For an options structure, use a function handle, not a name. |
|
| NM Positive integer
specifying how many individuals in the current generation are guaranteed
to survive to the next generation. Not used in | Positive integer | |
| NM If the fitness function
attains the value of | Scalar | |
| Function that scales the values of the fitness function. Specify as a name of a
built-in scaling function or a function handle. Option unavailable for
|
|
FunctionTolerance | The algorithm stops if the average relative change in the best fitness function value
over For
For an options structure, use
| Positive scalar | |
| I* Function that continues the optimization after
Alternatively, a cell array specifying the hybrid function and its options. See ga Hybrid Function. For | Function name or handle | or 1-by-2 cell array
| |
InitialPenalty | NM I* Initial value of penalty parameter | Positive scalar | |
| Initial population used to seed the genetic algorithm. Has up to
For an options structure, use
| Matrix | |
| Matrix or vector specifying the range of the individuals in the initial population.
Applies to For an options structure, use
| Matrix or vector | |
| I* Initial scores used to determine fitness. Has up to
For an
options structure, use | Column vector for single objective | matrix for multiobjective
| |
| Maximum number of iterations before the algorithm halts. For an options
structure, use | Positive integer | |
| The algorithm stops if the average relative change in the best fitness function value
over For
For an options structure, use
| Positive integer | |
| NM The algorithm stops if there is no improvement in
the objective function for For an
options structure, use | Positive scalar |
| The algorithm stops after running after For an options structure,
use | Positive scalar | |
MigrationDirection | Direction of migration. See Migration Options |
|
MigrationFraction | Scalar from 0 through 1 specifying the fraction of individuals in each subpopulation that migrates to a different subpopulation. See Migration Options | Scalar | |
MigrationInterval | Positive integer specifying the number of generations that take place between migrations of individuals between subpopulations. See Migration Options. | Positive integer | |
| I* Function that produces mutation children. Specify as a name of a built-in mutation function or a function handle. See Mutation Options. |
|
| Nonlinear constraint algorithm. See Nonlinear Constraint Solver Algorithms. Option unchangeable for
For an options structure,
use |
|
| Functions that For an options structure,
use | Function handle or cell array of function handles |
|
| Scalar from 0 through 1 specifying the fraction of individuals to keep on the first
Pareto front while the solver selects individuals from higher fronts, for
| Scalar | |
PenaltyFactor | NM I* Penalty update parameter. | Positive scalar | |
| Function that plots data computed by the algorithm. Specify as a name of a built-in plot function, a function handle, or a cell array of built-in names or function handles. See Plot Options. For an options
structure, use |
|
PlotInterval | Positive integer specifying the number of generations between consecutive calls to the plot functions. | Positive integer | |
| Size of the population. | Positive integer | |
| Data type of the population. Must be |
|
| I* Function that selects parents of crossover and mutation children. Specify as a name of a built-in selection function or a function handle.
|
|
StallTest | NM Stopping test type. |
|
UseParallel | Compute fitness and nonlinear constraint functions in parallel. See Vectorize and Parallel Options (User Function Evaluation) and How to Use Parallel Processing in Global Optimization Toolbox. |
|
| Specifies whether functions are vectorized. See Vectorize and Parallel Options (User Function Evaluation) and Vectorize the Fitness Function. For an options structure, use |
|
Example: optimoptions('ga','PlotFcn',@gaplotbestf)
IntCon
— Integer variablesInteger variables, specified as a vector of positive integers taking
values from 1
to nvars
. Each value
in IntCon
represents an x
component
that is integer-valued.
When IntCon
is nonempty, Aeq
and beq
must be an empty entry
([]
), and nonlcon
must
return empty for ceq
. For more information on integer
programming, see Mixed Integer Optimization.
Example: To specify that the even entries in x
are
integer-valued, set IntCon
to
2:2:nvars
Data Types: double
problem
— Problem descriptionProblem description, specified as a structure containing these fields.
fitnessfcn | Fitness functions |
nvars | Number of design variables |
Aineq |
|
Bineq |
|
Aeq |
|
Beq |
|
lb | Lower bound on |
ub | Upper bound on |
nonlcon | Nonlinear constraint function |
rngstate | Optional field to reset the state of the random number generator |
solver |
|
options | Options created using |
Create problem
by exporting a problem from the Optimization app, as described in Importing and Exporting Your Work (Optimization Toolbox).
Data Types: struct
x
— SolutionSolution, returned as a real vector. x
is the best
point that ga
located during its iterations.
fval
— Objective function value at the solutionObjective function value at the solution, returned as a real number. Generally, fval
= fun(x)
.
exitflag
— Reason ga
stoppedReason that ga
stopped, returned as an integer.
Exit Flag | Meaning |
---|---|
1 |
Without nonlinear
constraints — Average cumulative
change in value of the fitness function over
|
With nonlinear
constraints — Magnitude of the
complementarity measure (see Complementarity Measure) is less than
| |
3 |
Value of the fitness function did not change in
|
4 |
Magnitude of step smaller than machine precision and
the constraint violation is less than
|
5 |
Minimum fitness limit |
0 |
Maximum number of generations
|
-1 |
Optimization terminated by an output function or plot function. |
-2 |
No feasible point found. |
-4 |
Stall time limit |
-5 |
Time limit |
When there are integer constraints, ga
uses the
penalty fitness value instead of the fitness value for stopping
criteria.
output
— Information about the optimization processInformation about the optimization process, returned as a structure with these fields:
problemtype
— Problem type, one
of:
'unconstrained'
'boundconstraints'
'linearconstraints'
'nonlinearconstr'
'integerconstraints'
rngstate
— State of the MATLAB random number generator, just before the algorithm
started. You can use the values in rngstate
to
reproduce the output of ga
. See Reproduce Results.
generations
— Number of generations
computed.
funccount
— Number of evaluations of the
fitness function.
message
— Reason the algorithm
terminated.
maxconstraint
— Maximum constraint
violation, if any.
population
— Final populationFinal population, returned as a
PopulationSize
-by-nvars
matrix.
The rows of population
are the individuals.
scores
— Final scoresFinal scores, returned as a column vector.
For non-integer problems, the final scores are the fitness
function values of the rows of
population
.
For integer problems, the final scores are the penalty fitness values of the population members. See Integer ga Algorithm.
In the Augmented Lagrangian nonlinear constraint solver, the complementarity measure is the norm of the vector whose elements are ciλi, where ci is the nonlinear inequality constraint violation, and λi is the corresponding Lagrange multiplier. See Augmented Lagrangian Genetic Algorithm.
To write a function with additional parameters to the independent variables
that can be called by ga
, see Passing Extra Parameters (Optimization Toolbox).
For problems that use the population type Double Vector
(the default), ga
does not accept functions whose inputs are
of type complex
. To solve problems involving complex data,
write your functions so that they accept real vectors, by separating the real
and imaginary parts.
For a description of the genetic algorithm, see How the Genetic Algorithm Works.
For a description of the mixed integer programming algorithm, see Integer ga Algorithm.
For a description of the nonlinear constraint algorithms, see Nonlinear Constraint Solver Algorithms.
Behavior changed in R2019b
When the fitness function is deterministic, ga
does not
reevaluate the fitness function on elite (current best) individuals. You can control
this behavior by accessing the new state.EvalElites
field and
modifying it in a custom output function or custom plot function. Similarly, when
the initial population has duplicate members, ga
evaluates each
unique member only once. You can control this behavior in a custom output function
or custom plot function by accessing and modifying the new
state.HaveDuplicates
field. For details, see Custom Output Function for Genetic Algorithm
or Custom Plot Function.
For details about the two new fields, see The State Structure.
[1] Goldberg, David E., Genetic Algorithms in Search, Optimization & Machine Learning, Addison-Wesley, 1989.
[2] A. R. Conn, N. I. M. Gould, and Ph. L. Toint. “A Globally Convergent Augmented Lagrangian Algorithm for Optimization with General Constraints and Simple Bounds”, SIAM Journal on Numerical Analysis, Volume 28, Number 2, pages 545–572, 1991.
[3] A. R. Conn, N. I. M. Gould, and Ph. L. Toint. “A Globally Convergent Augmented Lagrangian Barrier Algorithm for Optimization with General Inequality Constraints and Simple Bounds”, Mathematics of Computation, Volume 66, Number 217, pages 261–288, 1997.
To run in parallel, set the 'UseParallel'
option to true
.
options = optimoptions('
solvername
','UseParallel',true)
For more information, see How to Use Parallel Processing in Global Optimization Toolbox.
A modified version of this example exists on your system. Do you want to open this version instead?
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.
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: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.