RE: ConstrainedMin with negative variables
- To: mathgroup at smc.vnet.net
- Subject: [mg35148] RE: [mg35137] ConstrainedMin with negative variables
- From: "DrBob" <majort at cox-internet.com>
- Date: Wed, 26 Jun 2002 01:09:23 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
It's usual to constrain LP variables to be non-negative because it
simplifies the algorithm immensely and reduces the incidence of
unbounded problems. It's not a real limitation, however, as the
following demonstrates. First the result you obtained:
objective = -7/3 x1 - 13/3 x2;
constraints = {x1 + 5 x2 <= 0, -1 <= x1 <= 1, -1 <= x2 <= 1};
vars = Variables[objective];
ConstrainedMin[objective, constraints, vars]
{0, {x1 -> 0, x2 -> 0}}
Here's the substitution that generalizes it for you, and a solution in
terms of the new variables:
substitute = {x1 -> y1 - z1, x2 -> y2 - z2};
newVars = Variables[objective /. substitute];
ConstrainedMin[objective /. substitute, constraints /. substitute,
newVars];
solution = Last[%]
{y1 -> 1, y2 -> 0, z1 -> 0, z2 -> 1/5}
Finally, in terms of the original variables:
vars /. substitute /. solution
{1, -(1/5)}
That's the solution you wanted.
Bobby Treat
-----Original Message-----
From: Markus Kolöchter [mailto:koloechter at web.de]
To: mathgroup at smc.vnet.net
Subject: [mg35148] [mg35137] ConstrainedMin with negative variables
Hello ng,
I'm trying to implement the method of Zoutendijk, which is to solve a
nonlinear programming problem.
Therefor I have to solve linear subproblems with the simplex method.
But the Mathematica function "ConstrainedMin" assumes that all variables
are
non-negative.
For example, I have the following input:
ConstrainedMin[-7/3 x1 - 13/3 x2, {x1 + 5 x2 <= 0, -1 <= x1 <= 1, -1
<=
x2 <= 1}, {x1, x2}]
The Mathematica output is:
{0, {x1 -> 0, x2 -> 0}}
I think the proper result should be {-22/15, {x1 -> 1, x2 -> -1/5}}.
If anyone has an idea, please let me know!
Regards,
Markus Kolöchter