Lindo Systems

! Choosing sizes of a series of heat exchangers.
 We want to heat a cold stream through a series
 of heat exchangers, using some available hot
 streams, assigned one to each exchanger;
! Keywords: Process Industry, Petroleum Industry, Heat Exchanger;
SETS:
  HX : AREA, U, TH, TC;
ENDSETS
DATA:
  T0 = 100; ! Temperature of initial cold stream;
  TF = 500; ! Temp required of final output cold stream;
  U = 120  80  40; ! Heat transfer coefficient of exchanger;
  TH= 300 400 600; ! Temperature of hot streams;  
  HFLO = 100000;   ! Heat flow of cold stream in
                     (BTU/degree)/hour;
 ENDDATA

! Decision variables:
    AREA(i) = area of exchanger i,
    TC(i)= temperature of the cold stream upon
            exit of exchanger i (and entry to i+1);

 NX = @SIZE(HX); ! Number of heat exchangers;

! Minimize total area;
   Min = @SUM(HX(i): AREA(i));

! The input and output temperatures of the stream
   being heated are related to the areas by;
  HFLO*(TC(1) - T0) = U(1)*AREA(1)*(TH(1)-TC(1));

  @FOR( HX(i)| i #GT# 1:
     HFLO*(TC(i) - TC(i-1)) = U(i)*AREA(i)*(TH(i)-TC(i));
      );

 ! Must meet final target temp;
    TC(NX) = TF;