Circle Enclosing Points
{ circle.mpl }
{ GAMS Model Library, http://www.gams.com/modlib/libhtml/circle.htm }
{ Circle Enclosing Points, NLP, Size: 3x10 }
TITLE
Circle;
OPTIONS
ModelType=Nonlinear
ParserType=Extended
INDEX
i := 1..10;
DATA
X[i] := UNIFORM(1,10);
Y[i] := UNIFORM(1,10);
XMin := MIN(X);
YMin := MIN(Y);
XMax := MAX(X);
YMax := MAX(Y);
AStart := (XMin+XMax)/2;
BStart := (YMin+YMax)/2;
RStart := ((AStart-XMin)^2 + (BStart-YMin)^2)^0.5;
VARIABLES
A INITIAL AStart;
B INITIAL BStart;
R INITIAL RStart;
MODEL
MIN R;
SUBJECT TO
E[i]: (X-A)^2 + (Y-B)^2 <= R^2;
BOUNDS
0 <= R <= 10;
0 <= A <= 10;
0 <= B <= 10;
END
Back To Top
|
Maximal Home Page
|
List of Models |
Previous Page
|
Next Page