McCormick Relaxations

Author:
Benoit C. Chachuat, Alexander Mitsos & Paul I. Barton
Version:
0.1
Date:
2006
Bug:
No known bugs.
libMC.so.0.1 is a library defining a C++ class for calculating the McCormick relaxation of a nonconvex function on a box, as well as valid subgradients of these relaxations. Any function can be considered, provided it is factorable.

The relaxation is calculated based on the operator overloading and function overloading capabilities of C++. The overloaded operators are: `+', `-', `*', and `/'; the overloaded functions are: `exp', `log', and `pow'. (Trigonometric functions such as `cos', `sin' and `tan' aren't currently supported.)

Future versions of libAD will allow dealing with a wider variety of mathematical functions. In particular, trigonometric functions such as `cos', `sin' and `tan' shall be implemented.

How to Calculate the Value of a McCormick Relaxation?

Suppose one is interested in calculating the value of the McCormick relaxation of the real-valued function $f(x,y)=x(\exp(x)-y)^2$ for $(x,y)\in [-2,1]^2$, at the point $(x,y)=(0,0)$.

First, we shall define the variables $x$ and $y$. This is done as follows:

McCormick X( -2., 1., 0. ); McCormick Y( -2., 1., 0. ); Essentially, the first line means that X is a variable of class McCormick, that it belongs to the interval $[-2,1]$, and that its current value is equal to $0$. The same holds for the McCormick variable Y.

Once $x$ and $y$ have been defined, the McCormick's relaxations of $f(x,y)$ at $(0,0)$ are simply calculated as

McCormick Z = X*pow(exp(X)-Y,2);

The value of the McCormick's convex underestimator and the McCormick's concave overestimator of $f(x,y)$ on $[-2,1]^2$ at $(0,0)$ are obtained as

double Zcvx = Z.cv(); double Zccv = Z.cc();

Likewise, a lower bound and an upper bound for the values of $f(x,y)$ on $[-2,1]^2$ are obtained as

double Zlb = Z.l(); double Zub = Z.u();

How to Calculate a Subgradient of a McCormick Relaxation?

blabla...
Generated on Sun Oct 15 16:39:45 2006 for AD Tools by  doxygen 1.4.6