optimize
|
Page in progress. |
Solves the optimization problem.
| Library |
|
Description
Function optimize solves the optimization problem in order to find the values of the design variables that meet the specified requirements.
Syntax
Function call
-
optimParam,optimInfo = optimize(fcn,p)— uses an optimization methodlsqnonlin, used by default, to search for parameter valuesoptimParamsatisfying the requirements specified in the objective functionfcn.
-
optimParam,optimInfo = optimize(fcn,p,opt)— solves the optimization problem with the parameters specified in the argumentopt. To set the argumentoptuse the functionOptimizeOptions.
-
optimParam,optimInfo = optimize(fcn,prob)— solves the optimization problemprob, which contains the minimized function, design variables, and optimization settings.
Arguments
Input arguments
# fcn — objective function for minimizing
+
function
Details
The objective function for minimizing. The optimization algorithm calls this function during the optimization process.
The following requirements apply to the function:
-
one input argument is a vector of configurable parameters represented by objects
EngeeDesignOptimization.Continuous. To pass additional input arguments, use an anonymous function. For example:new_fcn = (p) → fcn(p,arg1,arg2,). -
one output argument is a dictionary, which must provide a key.
"F"the vector or scalar value of the objective function. For example:Dict("F"⇒0.1). -
The gradient of the objective function is calculated by numerical perturbation. If you want to specify a method for calculating the gradient, then add a second output argument and set the property
GradFcnthe objectOptimizeOptionsmeaningtrue. The second output argument should be a dictionary, which should provide the key"F"derivatives of the objective function in terms of parameterspThat is ,dF(p)/dp.
| Типы данных |
|
# p — design parameters
+
vector of objects
Details
Configurable design parameters set as a vector of objects EngeeDesignOptimization.Continuous.
| Типы данных |
|
# opt — optimization settings
+
object
Details
Optimization settings set as an object EngeeDesignOptimization.OptimizeOptions.
The settings allow you to specify:
-
the number of restarts of the optimization algorithm;
-
maximum number of iterations;
-
the tolerances.
| Типы данных |
|
# prob — optimization problem
+
object
Details
An optimization problem defined as an object EngeeDesignOptimization.OptimizeProblem with the following properties:
-
OptFcn— the objective function to be minimized. The requirements for the input and output arguments of this function can be found in the descriptionfcn. -
Parameters— design parameters for optimization, set as a vector of objectsEngeeDesignOptimization.Continuous. -
Options— optimization settings set as an objectEngeeDesignOptimization.OptimizeOptions.
| Типы данных |
|
Output arguments
# optimParam — optimized design parameters
+
object
Details
Optimized design parameters returned as a vector of objects EngeeDesignOptimization.Continuous. The composition of the vector and the dimension of the parameters correspond to p. Optimized values are stored in the property value the corresponding returned parameter object.
| Типы данных |
|
# optimInfo — optimization information
+
dictionary
Details
Optimization information returned as a dictionary containing one or more of the following keys:
-
F— the value of the objective function at the optimal point. -
Jacobian— the Jacobi matrix of the objective function at the optimal point. -
exitflag— an integer indicating the reason for the shutdown of the optimization method. The list of values and their corresponding termination reasons is given in the description of the optimization method.lsqnonlin. -
iterations— an integer number of iterations. -
SolverOutput— a dictionary containing the parameters of the optimization method. The list of output parameters of the optimization method and their description are given in the descriptionlsqnonlin. -
Stats— a structure containing statistics collected during the optimization process, such as the start and end times, the number of function calculations, and the number of restarts.
| Типы данных |
|