Lindo Systems

! This little LINGO program illustrates a general way of
 doing parametric analysis and computing efficient frontiers;
! Keywords: Parametric Analysis, Efficient Frontier;

SUBMODEL parametric:
 ! The Astro/Cosmo product mix model with
  the labor usage of Cosmo as a parameter, Pam;
 MAX = profit;
  profit= 20*astro  + 30*cosmo;
             astro               <= 60;
                         cosmo   <= 50;
             astro + Pam*cosmo   <= 120;
ENDSUBMODEL
CALC:

! Set output level to very terse;
   @SET( "TERSEO", 2); 

! Find profit as a function of the labor usage parameter
 of Cosmo, for parameter = 1, 1.125..., 3;
   @WRITE(' Parameter    Profit     Astro     Cosmo', @NEWLINE(1));
 Pam = 1;
 @WHILE( Pam #LE# 3:
   @SOLVE(parametric);
   @WRITE( @FORMAT(pam,"8.3f") ,'     ',
           @FORMAT(profit,"8.3f"),'  ',
           @FORMAT(astro,"8.3f"),'  ',
           @FORMAT(cosmo,"8.3f"),@NEWLINE(1));
   Pam = Pam + .125;
       );
ENDCALC

! The above produces the output:
 Parameter    Profit     Astro     Cosmo
   1.000     2700.000    60.000    50.000
   1.125     2700.000    60.000    50.000
   1.250     2650.000    57.500    50.000
   1.375     2525.000    51.250    50.000
   1.500     2400.000    45.000    50.000
   1.625     2307.692    60.000    36.923
   1.750     2228.571    60.000    34.286
   1.875     2160.000    60.000    32.000
   2.000     2100.000    60.000    30.000
   2.125     2047.059    60.000    28.235
   2.250     2000.000    60.000    26.667
   2.375     1957.895    60.000    25.263
   2.500     1920.000    60.000    24.000
   2.625     1885.714    60.000    22.857
   2.750     1854.545    60.000    21.818
   2.875     1826.087    60.000    20.870
   3.000     1800.000    60.000    20.000
;