Main

Slack Variable Tutorial

Main.SlackVariables History

Hide minor edits - Show changes to output

March 31, 2014, at 03:13 PM by 23.255.228.67 -
Deleted lines 3-4:

!! Slack Variables
March 31, 2014, at 03:10 PM by 23.255.228.67 -
Added lines 1-41:
(:title Slack Variable Tutorial:)
(:keywords slack variables, inequality, slacks, lower bound, transform:)
(:description Slack variables are used to transform an inequality expression into an equality expression:)

!! Slack Variables

Slack variables are defined to transform an inequality expression into an equality expression with an added slack variable.  The slack variable is defined by setting a lower bound of zero (>0).

(:table border=1 width=100% align=left bgcolor=#FFFFFF cellspacing=0:)
(:cellnr:)
Inequality Constraint Form
(:cell:)
x > b
(:cellnr:)
Equality Constraint Form with Slack Variable
(:cell:)
x = b + slack (:html:)<br>(:htmlend:)
slack > 0
(:tableend:)

----

(:html:)
<iframe width="560" height="315" src="http://www.youtube.com/embed/jh6BK0BqqIs?rel=0" frameborder="0" allowfullscreen></iframe>
(:htmlend:)

----

!!! Example Problem

Attach:table50.jpg [[http://apmonitor.com/online/view_pass.php?f=slack.apm | Click to Solve a Slack Variable Optimization Problem]]

Attach:slack_problem.png

Attach:slack_results.png

----

!!! Inequality Constraints in APM

In APMonitor Modeling Language, inequality constraints are automatically translated into equality constraints with slack variables. Slack variables can also be defined by starting a variable name with ''slk''.  When the model is parsed at run-time, any variable beginning with ''slk'' is automatically assigned a lower value of zero.  Alternatively, inequality constraints will be automatically converted to equality constraints with a slack variable.