|
Chapter Contents |
Previous |
Next |
| Nonlinear Optimization Examples |
The following example is taken from the user's guide of the GINO program (Liebman, Lasdon, Schrage, and Waren 1986). A simple network of five roads (arcs) can be illustrated by a path diagram.
The five roads connect four intersections illustrated by numbered nodes. Each minute, F vehicles enter and leave the network. The parameter xij refers to the flow from node i to node j. The requirement that traffic that flows into each intersection j must also flow out is described by the linear equality constraint




The three linear equality constraints are linearly dependent. One of them is deleted automatically by the optimization subroutine. The following notation is used in this example:
proc iml;
title 'Maximum Flow Through a Network';
start MAXFLOW(x);
f = x[4] + x[5];
return(f);
finish MAXFLOW;
con = { 0. 0. 0. 0. 0. . . ,
10. 30. 10. 30. 10. . . ,
0. 1. -1. 0. -1. 0. 0. ,
1. 0. 1. -1. 0. 0. 0. ,
1. 1. 0. -1. -1. 0. 0. };
x = j(1,5, 1.);
optn = {1 3};
call nlpcg(xres,rc,"MAXFLOW",x,optn,con);
The optimal solution is shown in the following output.



In the following code, the NLPNRR subroutine is used to solve the minimization problem:
proc iml;
title 'Minimize Total Delay in Network';
start MINDEL(x);
t12 = 5. + .1 * x[1] / (1. - x[1] / 10.);
t13 = x[2] / (1. - x[2] / 30.);
t32 = 1. + x[3] / (1. - x[3] / 10.);
t24 = x[4] / (1. - x[4] / 30.);
t34 = 5. + .1 * x[5] / (1. - x[5] / 10.);
f = t12*x[1] + t13*x[2] + t32*x[3] + t24*x[4] + t34*x[5];
return(f);
finish MINDEL;
con = { 0. 0. 0. 0. 0. . . ,
10. 30. 10. 30. 10. . . ,
0. 1. -1. 0. -1. 0. 0. ,
1. 0. 1. -1. 0. 0. 0. ,
0. 0. 0. 1. 1. 0. 5. };
x = j(1,5, 1.);
optn = {0 3};
call nlpnrr(xres,rc,"MINDEL",x,optn,con);
The optimal solution is shown in the following output.
| |||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.