Main

## Main.SlackVariables History

April 14, 2017, at 08:26 PM by 10.5.113.121 -
Deleted lines 36-37:

Changed lines 39-47 from:

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.

to:

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.

### Logical Conditions in Optimization

Slack variables are also useful for optimization problems with non-smooth or discontinuous functions. The following tutorial demonstrates the use of slack variables in reformulating the ABS() function, IF statements, and others.

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

June 18, 2013, at 06:04 AM by 69.169.131.173 -
Changed line 21 from:

(:html:)<br><br><br>(:htmlend:)

to:

June 18, 2013, at 06:04 AM by 69.169.131.173 -

(:html:)<br><br><br>(:htmlend:)

Deleted line 23:

<br><br>

June 18, 2013, at 06:03 AM by 69.169.131.173 -
Changed line 22 from:

<br>

to:

<br><br>

June 18, 2013, at 06:03 AM by 69.169.131.173 -

<br>

June 18, 2013, at 06:02 AM by 69.169.131.173 -
Changed line 9 from:

(:table border=1 width=80% align=left bgcolor=#FFFFFF cellspacing=0:)

to:

(:table border=1 width=100% align=left bgcolor=#FFFFFF cellspacing=0:)

Deleted lines 20-21:

(:html:)<br><br><br><br><br>(:htmlend:)

Changed lines 31-55 from:

(:table border=1 width=100% align=left bgcolor=#EEEEEE cellspacing=0:) (:cellnr:)

 ! Example model with slack variable
! Solve slack variable problem
!   Minimize     total_cost
!   Subject to   supply < b
Model
Parameters
b = 5
End Parameters

Variables
supply
total_cost
End Variables

Equations
supply < b

total_cost = (supply-2)^2

Minimize  total_cost
End Equations
End Model


(:cellnr:)

to:
Deleted line 33:

(:tableend:)

June 18, 2013, at 05:58 AM by 69.169.131.173 -
Changed lines 27-28 from:

## Example Problem

to:

### Example Problem

Changed lines 61-63 from:

## Inequality Constraints in APM

to:

### Inequality Constraints in APM

June 18, 2013, at 05:58 AM by 69.169.131.173 -
Changed line 31 from:

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

to:

(:table border=1 width=100% align=left bgcolor=#EEEEEE cellspacing=0:)

Deleted lines 57-58:

(:html:)<br>(:htmlend:)

June 18, 2013, at 05:57 AM by 69.169.131.173 -

(:html:)<br>(:htmlend:)

June 18, 2013, at 05:56 AM by 69.169.131.173 -
Changed lines 27-28 from:

to:

## Example Problem

Changed line 59 from:

to:

## Inequality Constraints in APM

June 18, 2013, at 05:55 AM by 69.169.131.173 -

June 18, 2013, at 05:54 AM by 69.169.131.173 -
Deleted lines 22-23:
Click to Solve a Slack Variable Optimization Problem
Deleted lines 26-27:

In APMonitor, 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.

Click to Solve a Slack Variable Optimization Problem
Changed lines 57-59 from:

(:tableend:)

to:

(:tableend:)

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.

June 18, 2013, at 05:52 AM by 69.169.131.173 -
Changed lines 7-8 from:

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).

to:

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).

Changed line 18 from:

slack >= 0

to:

slack > 0

June 16, 2013, at 11:34 PM by 69.169.188.188 -
Changed lines 25-26 from:

In APMonitor, slack variables can 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.

to:

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

In APMonitor, 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.

Changed line 59 from:

(:tableend:)

to:

(:tableend:)

March 16, 2012, at 09:27 PM by 69.169.136.170 -
Changed line 23 from:
Solve Slack Variable Optimization Problems
to:
Click to Solve a Slack Variable Optimization Problem
March 16, 2012, at 09:26 PM by 69.169.136.170 -

(: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:)

Deleted line 55:
January 14, 2012, at 11:30 PM by 69.169.188.228 -
Changed lines 19-20 from:
to:
Solve Slack Variable Optimization Problems
Deleted lines 21-26:

### Solve Slack Variable Problems Online

APMonitor has an online interface for solving optimization problems. The optimization problem shown below as Example Problem can be solved through the web-interface at the following link:

Slack Variable Solution Online
January 14, 2012, at 11:26 PM by 69.169.188.228 -
Changed line 13 from:

x = b + slack

to:

x = b + slack (:html:)<br>(:htmlend:)

January 14, 2012, at 11:24 PM by 69.169.188.228 -
Changed line 13 from:

x = b + slack,

to:

x = b + slack

January 14, 2012, at 11:23 PM by 69.169.188.228 -
Changed line 13 from:

x = b + slack

to:

x = b + slack,

January 14, 2012, at 11:23 PM by 69.169.188.228 -
Changed line 5 from:

(:table border=2 width=50% align=left bgcolor=#FFFFFF cellspacing=0:)

to:

(:table border=1 width=80% align=left bgcolor=#FFFFFF cellspacing=0:)

January 14, 2012, at 11:20 PM by 69.169.188.228 -
Changed line 20 from:

In APMonitor, slack variables can 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.

to:

In APMonitor, slack variables can 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.

January 14, 2012, at 11:20 PM by 69.169.188.228 -
Changed line 20 from:

In APMonitor, slack variables can 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.

to:

In APMonitor, slack variables can 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.

January 14, 2012, at 11:19 PM by 69.169.188.228 -
Changed line 17 from:

(:html:)<br><br><br><br><br><br>(:htmlend:)

to:

(:html:)<br><br><br><br><br>(:htmlend:)

January 14, 2012, at 11:19 PM by 69.169.188.228 -
Changed line 17 from:

(:html:)<br><br><br><br>(:htmlend:)

to:

(:html:)<br><br><br><br><br><br>(:htmlend:)

January 14, 2012, at 11:18 PM by 69.169.188.228 -
Changed line 17 from:

(:html:)<br>(:htmlend:)

to:

(:html:)<br><br><br><br>(:htmlend:)

January 14, 2012, at 11:18 PM by 69.169.188.228 -
Changed line 5 from:

(:table border=1 width=50% align=left bgcolor=#FFFFFF cellspacing=0:)

to:

(:table border=2 width=50% align=left bgcolor=#FFFFFF cellspacing=0:)

January 14, 2012, at 11:18 PM by 69.169.188.228 -
Changed line 5 from:

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

to:

(:table border=1 width=50% align=left bgcolor=#FFFFFF cellspacing=0:)

(:html:)<br>(:htmlend:)

January 14, 2012, at 11:16 PM by 69.169.188.228 -
Changed lines 5-7 from:

Slack variables are defined by starting a variable name with 'slk'. Thus, valid slack variable names would include names such as slk_1, slkr, slkvar[1]. When the model is parsed at run-time, any variable beginning with slk is automatically assigned a lower value of zero.

Equation inequalities are automatically tranformed to equality expressions for solvers that do not support them.

to:

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:) (:cellnr:) Inequality Constraint Form (:cell:) x > b (:cellnr:) Equality Constraint Form with Slack Variable (:cell:) x = b + slack slack >= 0 (:tableend:)

In APMonitor, slack variables can 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.

July 20, 2011, at 10:41 AM by 89.147.0.172 -
Changed line 19 from:
 ! Example model with slack variable declaration

to:
 ! Example model with slack variable

July 20, 2011, at 10:31 AM by 89.147.0.172 -
Changed lines 20-32 from:
 Model example
Parameters
p1 = 5
End Parameters

Variables
slk_variable
v1 < 4
End Variables

Equations
v1 = p1 - slk_variable
End Equations

to:
 ! Solve slack variable problem
!   Minimize     total_cost
!   Subject to   supply < b
Model
Parameters
b = 5
End Parameters

Variables
supply
total_cost
End Variables

Equations
supply < b

total_cost = (supply-2)^2

Minimize  total_cost
End Equations

Changed lines 42-45 from:
 Solution
p1 = 5
slk_variable = 1
v1 = 4

to:
July 20, 2011, at 10:02 AM by 89.147.0.172 -
Changed line 3 from:

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

to:

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).

July 20, 2011, at 08:37 AM by 89.147.0.175 -
Changed lines 11-12 from:

APMonitor has an online interface for solving optimization problems. The optimization problem shown below can be solved through the web-interface at the following link:

to:

APMonitor has an online interface for solving optimization problems. The optimization problem shown below as Example Problem can be solved through the web-interface at the following link:

Changed line 15 from:

to:

### Example Problem

July 20, 2011, at 08:36 AM by 89.147.0.175 -
Changed line 13 from:

Attach: table50.jpg Slack Variable Solution Online

to:
Slack Variable Solution Online
July 20, 2011, at 08:35 AM by 89.147.0.175 -
Changed line 13 from:

Slack Variable Solution Online

to:

Attach: table50.jpg Slack Variable Solution Online

July 20, 2011, at 08:31 AM by 89.147.0.175 -
Changed line 11 from:

APMonitor has an online interface for solving optimization problems. The optimization problem shown below can be solved the web-interface at the following link:

to:

APMonitor has an online interface for solving optimization problems. The optimization problem shown below can be solved through the web-interface at the following link:

July 20, 2011, at 08:29 AM by 89.147.0.175 -

### Solve Slack Variable Problems Online

APMonitor has an online interface for solving optimization problems. The optimization problem shown below can be solved the web-interface at the following link:

Slack Variable Solution Online

July 07, 2009, at 03:10 PM by 158.35.225.228 -
Changed lines 3-5 from:

Slack variables are defined to give slack for infeasibilities. Generally, a slack variable is used to turn off an equation in a region where it does not apply. The slack variable is defined by setting a lower bound of zero (>=0) and including the variable in the objective function.

Slack variables are defined by starting a variable name with 'slk'. Thus, valid slack variable names would include names such as slk_1, slkr, slkvar[1]. When the model is parsed at run-time, any variable beginning with slk is automatically assigned a lower value of zero and included in the objective function.

to:

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

Slack variables are defined by starting a variable name with 'slk'. Thus, valid slack variable names would include names such as slk_1, slkr, slkvar[1]. When the model is parsed at run-time, any variable beginning with slk is automatically assigned a lower value of zero.

Equation inequalities are automatically tranformed to equality expressions for solvers that do not support them.

September 25, 2008, at 07:24 PM by 158.35.225.230 -

## Slack Variables

Slack variables are defined to give slack for infeasibilities. Generally, a slack variable is used to turn off an equation in a region where it does not apply. The slack variable is defined by setting a lower bound of zero (>=0) and including the variable in the objective function.

Slack variables are defined by starting a variable name with 'slk'. Thus, valid slack variable names would include names such as slk_1, slkr, slkvar[1]. When the model is parsed at run-time, any variable beginning with slk is automatically assigned a lower value of zero and included in the objective function.

### Example

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:) (:cellnr:)

 ! Example model with slack variable declaration
Model example
Parameters
p1 = 5
End Parameters

Variables
slk_variable
v1 < 4
End Variables

Equations
v1 = p1 - slk_variable
End Equations
End Model


(:cellnr:)

 Solution
p1 = 5
slk_variable = 1
v1 = 4


(:tableend:)