Global Optimization VI
- Updated2025-07-30
- 8 minute(s) read
Solves a global optimization equation with boundary constraints, nonlinear equality constraints, and nonlinear inequality constraints using the differential evolution (DE) method.

Inputs/Outputs
function data
—
function data contains static data that the user-defined function needs at run time.
objective and constraint function
—
objective and constraint function is a reference to the VI that implements the nonlinear function, the nonlinear equality constraints function, and the nonlinear inequality constraints function as separate outputs. In the referenced VI, the objective function output must not be empty, but the constraint functions are optional. Therefore, the equality constraints output, the inequality constraints output, or both can be empty. Create this VI by starting from the VI template located in labview\vi.lib\gmath\GlobalOptimization.llb\Global Optimization_Objective Function.vit.
Init Parameters
—
Init Parameters are the initial parameters at which the optimization process starts. LabVIEW uses Init Parameters when Beginning State is empty. Each row of Init Parameters is one set of parameters. The number of columns in Init Parameters must equal the length of Min and Max in Bounds. If the number of rows in Init Parameters is less than population size, LabVIEW initializes the remaining sets of parameters. If the number of rows in Init Parameters is larger than population size, LabVIEW ignores the additional sets of parameters.
Bounds
—
Bounds is a cluster that contains the upper and lower numeric limits for the parameters being optimized.
Beginning State
—
Beginning State contains the initial values of the populations and Pareto indexes. Beginning State is typically the ending state of a previous optimization and allows a warm start of the optimization. If Beginning State has values, LabVIEW ignores Init Parameters.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
DE settings
—
DE Settings contains additional settings that are specific to the differential evolution (DE) method.
stopping criteria
—
stopping criteria is the collection of conditions that terminate the optimization process.
number of function calls
—
number of function calls is the number of times the objective function calls in the optimization process. If max function calls is -1, number of function calls equals population size * (max iterations + 1).
Minimum
—
Minimum is the determined global minimum among all minimum possibilities.
F(Minimum)
—
F(Minimum) is the function value of the objective function at Minimum.
Ending State
—
Ending State contains the final values of the populations and Pareto indexes at the end of the optimization process.
error out
—
error out contains error information. This output provides standard error out functionality. |
This VI solves a global optimization equation by finding x to minimize f(x), which is subject to the following constraints:
| Boundary constraints | min ≤ x ≤ max |
| Equality constraints | g(x) = 0 |
| Inequality constraints | h(x) ≤ 0 |
x is the set of parameters to optimize. f(x) is the set of objective functions to minimize. The equality and inequality constraints are optional in this problem.
Differential evolution (DE) is one method used to solve the global optimization problem. It approximates the actual global optimum by iteratively mutating and improving the candidate parameters from the initial ones.
If object function evaluation takes long time, the DE method needs to call the object function several times, depending on population size, during each loop iteration in the optimization process. This VI enables parallel loop iterations on the For Loop to call the object function so that LabVIEW can take advantage of multiple processors. In order to utilize the parallel loop iterations, you need to do the following:
- Change the VI that implements the objective function to a reentrant VI that shares clones.
- Open a reference to a VI with a 0x40 option, as the following shown in the following image.
The following illustration shows how the VI solves a global optimization equation.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Mathematics\Optimization\Find Global Min on Surface.vi
- labview\examples\Mathematics\Optimization\Two Circles Optimization.vi
function data
—
objective and constraint function
—
Init Parameters
—
Bounds
—
Min
—
Population
—
Pareto Indexes
—
error in (no error)
—
DE settings
—
population size
—
scale factor
—
bound mapping method
—
number of function calls
—
Minimum
—
Ending State
—
Population
—
Pareto Indexes
—
error out
—