/* ---------------------------------------------------------------------------------------------------------- */
/* SmallFarm's with 'normal' variables XiPk = hectares of forest management unit i assigned to prescription k */
/* ------------------------------------------------------------------------------------------------------------ */
Max:  STOCK;
/* ---------- */
/* Subject To */
/* --------------------------------------------------------------------------------------------------------------------------------------- */
/* Area constraints imposing that the sum of areas assigned to each prescriptions in one forest unit must be <= the total area of the unit */
/* --------------------------------------------------------------------------------------------------------------------------------------- */
  X1: X1P66 + X1P67 + X1P68 + X1P76 + X1P77 + X1P78 + X1P86 + X1P87 + X1P88 <= 147.90;
  X2: X2P66 + X2P67 + X2P68 + X2P76 + X2P77 + X2P78 + X2P86 + X2P87 + X2P88 <=  72.23;
  X3: X3P66 + X3P67 + X3P68 + X3P76 + X3P77 + X3P78 + X3P86 + X3P87 + X3P88 <=  54.11;
  X4: X4P66 + X4P67 + X4P68 + X4P76 + X4P77 + X4P78 + X4P86 + X4P87 + X4P88 <=  77.70;
  X5: X5P66 + X5P67 + X5P68 + X5P76 + X5P77 + X5P78 + X5P86 + X5P87 + X5P88 <=  71.96;
  X6: X6P66 + X6P67 + X6P68 + X6P76 + X6P77 + X6P78 + X6P86 + X6P87 + X6P88 <=  71.97;
/* --------------------------------- */
/*     Set Accounting Variables      */
/* -------------------------------------------------------------------------------------------------------------------------------- */
/* The coefficients for TPV (total project value) compute NPV per hectare if prescription k is assigned to forest management unit i */
/* -------------------------------------------------------------------------------------------------------------------------------- */
TPVacc:
     9296.61 X1P66 + 9229.09 X1P67 + 9042.78 X1P68 + 9322.9  X1P76 + 9267.23 X1P77 +
     9068.17 X1P78 + 9254.7  X1P86 + 9199.29 X1P87 + 9008.16 X1P88 + 9798.41 X2P66 +
     9692.53 X2P67 + 9420.77 X2P68 + 9841.57 X2P76 + 9722.94 X2P77 + 9454.24 X2P78 +
     9776.64 X2P86 + 9664.42 X2P87 + 9404.26 X2P88 + 6121.57 X3P66 + 6102.85 X3P67 +
     6013.65 X3P68 + 6151.44 X3P76 + 6133.31 X3P77 + 5929.91 X3P78 + 5932.28 X3P86 +
     5927.24 X3P87 + 5877.21 X3P88 + 4202.39 X4P66 + 4253.65 X4P67 + 4248.71 X4P68 +
     4297.25 X4P76 + 4342.53 X4P77 + 4336.44 X4P78 + 4313.26 X4P86 + 4354.55 X4P87 +
     4348.75 X4P88 + 5899.25 X5P66 + 5853.77 X5P67 + 5714.45 X5P68 + 5890.00 X5P76 +
     5846.37 X5P77 + 5710.43 X5P78 + 5820.09 X5P86 + 5782.18 X5P87 + 5653.15 X5P88 +
     5482.86 X6P66 + 5510.78 X6P67 + 5388.40 X6P68 + 5591.81 X6P76 + 5579.43 X6P77 +
     5454.90 X6P78 + 5597.56 X6P86 + 5585.04 X6P87 + 5462.32 X6P88 - TPV = 0;
/* ----------------------------------------- */
/*     Accounting for Annual Production      */
/* -------------------------------------------------------------------------------------------------------------------------------- */
 Year01: 324 X1P66 + 324 X1P76 + 324 X1P86 - P01 = 0;
 Year02: 378 X1P67 + 378 X1P77 + 378 X1P87 + 366 X2P66 + 366 X2P76 + 366 X2P86 + 179 X4P66 + 179 X4P67 + 179 X4P68 - P02 = 0;
 Year03: 425 X1P68 + 425 X1P78 + 425 X1P88 + 423 X2P67 + 423 X2P77 + 423 X2P87 + 214 X4P76 + 214 X4P77 + 214 X4P78 + 235 X6P66 +
         235 X6P76 + 235 X6P86 - P03 = 0;
 Year04: 471 X2P68 + 471 X2P78 + 471 X2P88 + 246 X4P86 + 246 X4P87 + 246 X4P88 + 253 X5P66 + 253 X5P76 + 253 X5P86 + 274 X6P67 +
         274 X6P77 + 274 X6P87 - P04 = 0;
 Year05: 295 X5P67 + 295 X5P77 + 295 X5P87 + 306 X6P68 + 306 X6P78 + 306 X6P88 - P05 = 0;
 Year06: 306 X3P66 + 306 X3P67 + 306 X3P68 + 331 X5P68 + 331 X5P78 + 331 X5P88 - P06 = 0;
 Year07: 355 X1P66 + 362 X3P76 + 362 X3P77 + 362 X3P78 - P07 = 0;
 Year08: 355 X1P67 + 422 X1P76 + 380 X2P66 + 410 X3P86 + 410 X3P87 + 410 X3P88 + 163 X4P66 - P08 = 0;
 Year09: 355 X1P68 + 422 X1P77 + 479 X1P86 + 380 X2P67 + 455 X2P76 + 192 X4P67 + 163 X4P76 + 262 X6P66 - P09 = 0;
 Year10: 422 X1P78 + 479 X1P87 + 380 X2P68 + 455 X2P77 + 520 X2P86 + 217 X4P68 + 192 X4P77 + 163 X4P86 + 287 X5P66 + 262 X6P67 +
         319 X6P76 - P10 = 0;
 Year11: 479 X1P88 + 455 X2P78 + 520 X2P87 + 217 X4P78 + 192 X4P87 + 287 X5P67 + 337 X5P76 + 262 X6P68 + 319 X6P77 + 369 X6P86 - P11 = 0;
 Year12: 520 X2P88 + 293 X3P66 + 217 X4P88 + 287 X5P68 + 337 X5P77 + 379 X5P86 + 319 X6P78 + 369 X6P87 - P12 = 0;
 Year13: 324 X1P66 + 338 X3P67 + 293 X3P76 + 337 X5P78 + 379 X5P87 + 369 X6P88 - P13 = 0;
 Year14: 324 X1P76 + 366 X2P66 + 375 X3P68 + 338 X3P77 + 293 X3P86 + 179 X4P66 + 379 X5P88 - P14 = 0;
 Year15: 378 X1P67 + 324 X1P86 + 366 X2P76 + 375 X3P78 + 338 X3P87 + 179 X4P67 + 235 X6P66 - P15 = 0;
 Year16: 378 X1P77 + 423 X2P67 + 366 X2P86 + 375 X3P88 + 179 X4P68 + 214 X4P76 + 253 X5P66 + 235 X6P76 - P16 = 0;
 Year17: 425 X1P68 + 378 X1P87 + 423 X2P77 + 214 X4P77 + 253 X5P76 + 274 X6P67 + 235 X6P86 - P17 = 0;
 Year18: 425 X1P78 + 471 X2P68 + 423 X2P87 + 306 X3P66 + 214 X4P78 + 246 X4P86 + 295 X5P67 + 253 X5P86 + 274 X6P77 - P18 = 0;
 Year19: 355 X1P66 + 425 X1P88 + 471 X2P78 + 306 X3P67 + 246 X4P87 + 295 X5P77 + 306 X6P68 + 274 X6P87 - P19 = 0;
 Year20: 380 X2P66 + 471 X2P88 + 306 X3P68 + 362 X3P76 + 163 X4P66 + 246 X4P88 + 331 X5P68 + 295 X5P87 + 306 X6P78 - P20 = 0;
 Year21: 355 X1P67 + 422 X1P76 + 362 X3P77 + 331 X5P78 + 262 X6P66 + 306 X6P88 - P21 = 0;
/* ------------------------------------------ */
/*  Accounting for standing volume at year 21 */
/* ------------------------------------------ */
 STOCK21:
+  59.51 X1P66+ 198.66 X1P68+ 279.19 X1P77+ 119.57 X1P78+ 354.60 X1P86+ 198.66 X1P87
+  52.43 X1P88+  17.40 X2P66+ 296.62 X2P67+ 124.62 X2P68+ 379.81 X2P76+ 209.16 X2P77
+  54.03 X2P78+ 296.62 X2P86+ 124.62 X2P87+  10.58 X2P88+ 116.94 X3P66+  57.27 X3P67
+  13.87 X3P68+  13.87 X3P76+ 305.86 X3P78+ 362.42 X3P86+ 305.86 X3P87+ 241.52 X3P88
+   8.43 X4P66+ 163.03 X4P67+ 131.27 X4P68+ 131.27 X4P76+  97.45 X4P77+  63.37 X4P78
+  63.37 X4P86+  32.18 X4P87+   8.84 X4P88+ 230.05 X5P66+ 106.35 X5P67+  11.85 X5P68
+ 168.59 X5P76+  50.57 X5P77+ 106.35 X5P86+  11.85 X5P87+ 294.91 X5P88+ 138.58 X6P67
+  33.20 X6P68+ 201.17 X6P76+  80.05 X6P77+   6.02 X6P78+ 138.58 X6P86+  33.20 X6P87 - STOCK = 0;
/* ---------------------------------------------- */
/*  Accounting for area per age class at year 21  */
/* ---------------------------------------------- */
CLASS0: + X1P67+ X1P76+ X3P77+ X5P78+ X6P66+ X6P88- AC0 = 0;
CLASS1: + X2P66+ X2P88+ X3P68+ X3P76+ X4P66+ X4P88+ X5P68+ X5P87+ X6P78- AC1 = 0;
CLASS2: + X1P66+ X1P88+ X2P78+ X3P67+ X4P87+ X5P77+ X6P68+ X6P87- AC2 = 0;
CLASS3: + X1P78+ X2P68+ X2P87+ X3P66+ X4P78+ X4P86+ X5P67+ X5P86+ X6P77- AC3 = 0;
CLASS4: + X1P68+ X1P87+ X2P77+ X4P77+ X5P76+ X6P67+ X6P86- AC4 = 0;
CLASS5: + X1P77+ X2P67+ X2P86+ X3P88+ X4P68+ X4P76+ X5P66+ X6P76- AC5 = 0;
CLASS6: + X1P86+ X2P76+ X3P78+ X3P87+ X4P67- AC6 = 0;
CLASS7: + X3P86+ X5P88- AC7 = 0;
/* ------------------------------ */
/*  Impose minimum annual volume  */
/* ------------------------------ */
Y01: P01 >= 20000;
Y02: P02 >= 20000;
Y03: P03 >= 20000;
Y04: P04 >= 20000;
Y05: P05 >= 20000;
Y06: P06 >= 20000;
Y07: P07 >= 20000;
Y08: P08 >= 20000;
Y09: P09 >= 20000;
Y10: P10 >= 20000;
Y11: P11 >= 20000;
Y12: P12 >= 20000;
Y13: P13 >= 20000;
Y14: P14 >= 20000;
Y15: P15 >= 20000;
Y16: P16 >= 20000;
Y17: P17 >= 20000;
Y18: P18 >= 20000;
Y19: P19 >= 20000;
Y20: P20 >= 20000;
Y21: P21 >= 20000;
/* ---------------------------------- */
/*  Balance area between age classes  */
/* ---------------------------------- */
BAL_1: AC1 - AC0 >= 0;
BAL_2: AC2 - AC1 >= 0;
BAL_3: AC3 - AC2 >= 0;
BAL_4: AC4 - AC3 >= 0;
BAL_5: AC5 - AC4 >= 0;
BAL_6: AC6 - AC5 >= 0;
BAL_7: AC7 - AC6 >= 0;