From 9:00 AM - 12:00 PM CDT on Saturday, June 6th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

From 9:00 AM - 12:00 PM CDT on Saturday, June 6th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Last Modified: June 25, 2019

Solves a linear programming problem. This node uses arrays to represent the linear function to optimize and the constraints.

To solve the optimization problem, an optimal vector must exist. This node returns an error if an optimal vector does not exist.

Vector describing the linear function to maximize.

Matrix describing the different constraints.

Vector describing the right sides of the constraints inequalities.

Optimization problem this node solves.

Name | Description |
---|---|

Maximize | Solves a maximization problem. |

Minimize | Solves a minimization problem. |

**Default: **Maximize

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

Maximum or minimum value, if it exists, of the solution vector under the constraints.

Solution vector.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

Given that **optimization problem** is set to Maximize, the following equation defines the optimization problem this node solves.

*c**x* = *max*!

with the constraints *x* ≥ 0 and **M***x* ≥ *b*.

where

*c*is**linear function to maximize***x*is**solution****M**is**constraint matrix***b*is**constraint inequalities**

The solution to a linear programming problem is a two-step process. This node completes the following steps to solve a linear programming problem.

- Transforms the original problem into a problem in restricted normal form, essentially without inequalities in the formulation.
- Solves the restricted normal form problem.

This node uses **constraint matrix** and **constraint inequalities** to represent the constraints under which you want to optimize **linear function to maximize**. You must first organize the constraints in terms of formulas, and then convert the formulas to arrays. The following table explains how to convert the formulas to **constraint matrix** and **constraint inequalities**:

Formulas | constraint matrix |
constraint inequalities |
||

-0.53 * t_{1} - 1.07 * t_{2} - 0.4 * t_{3} >= -180 |
-0.53 | -1.07 | -0.4 | -180 |

t_{1} >= 30 |
1 | 0 | 0 | 30 |

t_{2} >= 30 |
0 | 1 | 0 | 30 |

t_{3} >= 30 |
0 | 0 | 1 | 30 |

-t_{1} - t_{2} - t_{3} >= -180 |
-1 | -1 | -1 | -180 |

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application