A library of examples for GGPLAB

The following is a library of examples for GGPLAB, a Matlab-based toolbox for specifying and solving geometric programs (GPs) and generalized geometric programs (GGPs).

Each example comes with its full Matlab code, and an HTML page that lists the output generated by Matlab when the code is run. You need to download your own copy of GGPLAB distribution in order to run these examples on your system.

Here is a simple code segment to get you introduced to the GGPLAB usage.

gpvar x y z             % create three scalar GP variables
m1 = 3.4*x^-0.33/z      % form a monomial
p1 = z*sqrt(m1)+0.1/m1  % form a posynomial
gp1 = max(1,x+y,p1)     % form a generalized posynomial

% form an array of constraints
constrs = [ m1==x, p1<=m1, 1<=y, gp1+p1<=5/y ]

% solve generalized GP and assign solution to GP variables
[obj_value, solution, status] = gpsolve(x+y+z,constrs)

These examples are public domain. You are free to use them in any way you wish; but when you do, we request that you give appropriate credit to the authors.

Last updated: May 22, 2006

GP examples library:

Back to the GGPLAB home page.