Engee documentation

optimize

Page in progress.

Solves the optimization problem.

Library

EngeeDesignOptimization

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,prob) — solves the optimization problem prob, 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 GradFcn the object OptimizeOptions meaning true. The second output argument should be a dictionary, which should provide the key "F" derivatives of the objective function in terms of parameters p That is , dF(p)/dp.

Типы данных

Function

# p — design parameters

+ vector of objects

Details

Configurable design parameters set as a vector of objects EngeeDesignOptimization.Continuous.

Типы данных

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.

Типы данных

EngeeDesignOptimization.OptimizeOptions

# prob — optimization problem

+ object

Details

An optimization problem defined as an object EngeeDesignOptimization.OptimizeProblem with the following properties:

Типы данных

EngeeDesignOptimization.OptimizeProblem

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.

Типы данных

EngeeDesignOptimization.Continuous

# 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 description lsqnonlin.

  • 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.

Типы данных

Dict