Solves a general nonlinear optimization problem with nonlinear equality constraint and nonlinear inequality constraint bounds using a sequential quadratic programming method.


icon

Inputs/Outputs

  • cfxdt.png function data

    function data contains static data that the user-defined function needs at run time.

  • csvrn.png objective and constraint function

    objective and constraint function is a reference to the VI that implements the nonlinear function to minimize, the nonlinear equality constraints function, and the nonlinear inequality constraints function as separate outputs. The objective function output must not be empty. 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\NumericalOptimization\cno_objective function template.vit.

  • c1ddbl.png start

    start are the points in n dimension at which the optimization process starts.

  • ccclst.png bounds

    bounds is a cluster that contains the upper and lower numeric limits for the parameters being optimized and the inequality constraints.

  • c1ddbl.png X minimum

    X minimum contains the lowest allowed value of the parameters being optimized. The length of this array must match the length of X maximum and can be 0 or the same as the length of the start array. The array does not accept exceptional values, such as Inf, –Inf, or NaN.

  • c1ddbl.png X maximum

    X maximum contains the highest allowed value of the parameters being optimized. The length of this array must match the length of X minimum and can be 0 or the same as the length of the start array. The array does not accept exceptional values, such as Inf, –Inf, or NaN.

  • c1ddbl.png inequality constraint minimum

    inequality constraint minimum contains the lowest allowed value of the inequality constraints. The length of this array must match the length of the inequality constraints returned from the objective and constraint function. This array does not accept exceptional values, such as Inf, –Inf, or NaN.

  • c1ddbl.png inequality constraint maximum

    inequality constraint maximum contains the highest allowed value of the inequality constraints. The length of this array must match the length of the inequality constraints returned from the objective and constraint function. This array does not accept exceptional values, such as Inf, –Inf, or NaN.

  • ccclst.png beginning state

    beginning state contains the initial values of the inequality constraint function, the Lagrangian multipliers, and the Hessian. beginning state is typically the ending state of a previous optimization and allows a warm start of the optimization.

  • c1ddbl.png inequality constraints

    inequality constraints contains the value of the inequality constraint functions, typically from a previous call to the Constrained Nonlinear Optimization VI.

  • c1ddbl.png lagrangian multipliers

    lagrangian multipliers contains the value of the Lagrangian multipliers, typically from a previous call to the Constrained Nonlinear Optimization VI.

  • c2ddbl.png hessian

    hessian contains an estimate of the Hessian, typically from a previous call to the Constrained Nonlinear Optimization VI.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • cnclst.png cno settings

    cno settings contains additional tolerance and termination settings that are specific to this algorithm.

  • cdbl.png constraint weight

    constraint weight is a relative weighting of the constraints as compared to the objective function and controls the distance that the optimization search travels outside the feasible range to seek an optimal solution. A value greater than 1 forces the search to stay close to the known feasible range, and a smaller value allows a broader range of searching.

  • ci32.png maximum minor iterations

    maximum minor iterations is an upper bound on the number of iterations allowed to solve the quadratic problem. If the constraint functions are highly nonlinear, the linearized constraints used in the quadratic problem might not be very accurate. In this case, it might be sensible to limit the number of minor iterations, forcing the linear approximation to be updated more often.

  • cnclst.png stopping criteria

    stopping criteria is the collection of conditions that terminate the optimization. If (function tolerance AND parameter tolerance AND gradient tolerance) OR max iterations OR max function calls then optimization terminates.

  • cdbl.png function tolerance

    function tolerance is the relative change in function value and is defined as abs(current f – prev f)/(abs(curr f)+machine eps). If the relative change in the function value falls below function tolerance, the optimization terminates.

  • cdbl.png parameter tolerance

    parameter tolerance is the relative change in parameter values and is defined as abs(current p – prev p)/(abs(curr p)+machine eps). If the relative change of all the parameter values falls below parameters tolerance, the optimization terminates.

  • ci32.png max iterations

    max iterations is the largest number of iterations of the major loop of the optimization. If the number of major loop iterations exceeds max iterations, the optimization terminates.

  • ci32.png max function calls

    max function calls is the largest number of objective function calls allowed before terminating the optimization process.

  • cdbl.png gradient tolerance

    gradient tolerance is the 2–norm of the gradient. If the 2–norm of the gradient falls below gradient tolerance, the optimization terminates.

  • cdbl.png max time (sec)

    max time (sec) is the maximum amount of time LabVIEW allows between the start and the end of the optimization process. The default is –1. –1 indicates never to time out.

  • ii32.png number of function calls

    number of function calls is the number of times the objective function calls in the optimization process.

  • i1ddbl.png minimum

    minimum is the determined local minimum in n dimension.

  • idbl.png f(minimum)

    f(minimum) is the function value of objective function at the determined minimum.

  • icclst.png ending state

    ending state contains the final values of the inequality constraint function, the Lagrange multipliers, and the Hessian.

  • i1ddbl.png inequality constraints

    inequality constraints contains the value of the inequality constraint functions at the end of the optimization.

  • i1ddbl.png lagrangian multipliers

    lagrangian multipliers contains the value of the Lagrangian multipliers at the end of the optimization.

  • i2ddbl.png hessian

    hessian contains an estimate of the Hessian at the end of the optimization.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Mathematics\Fitting\Nonlinear Spring Constant fit.vi