Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

linprog (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the optimization class.

Syntax

xmin = linprog(c, aineq, bineq)

xmin = linprog(c, aineq, bineq, aeq, beq)

xmin = linprog(c, aineq, bineq, aeq, beq, min, max)

[xmin, fval] = linprog(c, aineq, bineq)

[xmin, fval] = linprog(c, aineq, bineq, aeq, beq)

[xmin, fval] = linprog(c, aineq, bineq, aeq, beq, min, max)

[xmin, fval, lambda] = linprog(c, aineq, bineq)

[xmin, fval, lambda] = linprog(c, aineq, bineq, aeq, beq)

[xmin, fval, lambda] = linprog(c, aineq, bineq, aeq, beq, min, max)

Description

Uses the Simplex method to compute the minimum of a linear function defined by the following expression: c'*x. LabVIEW constrains the computation based on the inputs that you specify.

Examples

Inputs

Name Description
c Specifies the linear function whose minimum you want to compute. c is a real, double-precision vector.
aineq Specifies a matrix for the linear inequality constraints according to the following equation: aineq*xmin <= bineq. aineq can be []. aineq is a real, double-precision matrix.
bineq Specifies a vector for the linear inequality constraints according to the following equation: aineq*xmin <= bineq. bineq must be [] when aineq is []. bineq is a real, double-precision vector.
aeq Specifies a matrix for the linear equality constraints according to the following equation: aeq*xmin = beq. aeq can be []. aeq is a real, double-precision matrix.
beq Specifies a vector for the linear equality constraints according to the following equation: aeq*xmin = beq. beq must be [] when aeq is []. beq is a real, double-precision vector.
min Specifies the lower bound for the solution vector according to the following equation: min <= x <= max. min can be []. min is a real, double-precision vector.
max Specifies the upper bound for the solution vector according to the following equation: min <= x <= max. max can be []. max is a real, double-precision vector.

Outputs

Name Description
xmin Returns the point at which the linear function has the minimum value. xmin is a real, double-precision vector.
fval Returns the value of the linear function evaluated at xmin. fval is a real, double-precision scalar.
lambda Returns the lambda values for the solution vector. lambda is a real, double-precision vector.

Examples

C = [320; 800; 700];
AINEQ = [-3, -4, -2; -1, -3, -4; -2, -2, -3];
BINEQ = [-10; -30; -90];
MIN = [0; 0; 0];
MAX = [30; 30; 30];
linprog(C, AINEQ, BINEQ, [], [], MIN, MAX)

Related Topics

quadprog


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit