User-defined constraints

One of the more challenging issues in developing CropOptimiser was designing a mechanism to allow the user to define social and management constraints, and subsequently incorporate them into the LP model. While user-defined constraints may be easy to formulate in words, translating these words into their equivalent algebraic representation required by the LP model is much more complex, given the range of constraint formulations possible and the need to automate this process within the software application.

The key factor in automating this translation is recognizing the underlying patterns accounting for all possible types of constraint formation. Central to this is identifying the effect of the constraint on each of the fundamental seasonal, subarea and cropping elements. This includes:

  • Identifying whether the constraint affects ALL seasons simultaneously or just SELECTED seasons (or each season individually);
  • Identifying whether the constraint affects ALL subareas simultaneously or just SELECTED subareas (or each subarea individually); and
  • Identifying whether the constraint affects ALL crops simultaneously or just SELECTED crops (or each crop individually).

A total of eight patterns were recognized based on all possible combinations of the ‘ALL’ and ‘SELECTED’ element states. They typically involve breaking down the user-defined constraint into many individual algebraic statements. Examples of these patterns are presented in the following sections 3.3.1 to 3.3.8 and are accompanied by their algebraic formulation and sample matrix representation. The ordering of iterations of seasonal, subarea and cropping elements is also presented to simplify the matrix building process when automating the translation process.

 

User-defined constraint affecting SELECTED seasons SELECTED subareas SELECTED crops

This pattern effectively places limits on individual constraint elements. Practical examples include statements such as “Crop Areas (in each season) > 5% of each subareaor “Rice Area (S1,S2) > 10% of MATARAM area”. Mathematically, this is represented by:

Equation11

Matrix-building (Table 1) can be in any order of seasons, subarea, and then crop type.

 

Table 1. Constraint matrix formulation: ‘SELECTED seasons SELECTED subareas SELECTED crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table1 

 

User-defined constraint affecting SELECTED seasons SELECTED subareas ALL crops

 This pattern adjusts total crop production in selected subareas and seasons to an (in)equality. Practical examples include statements such as “Total Cropping Area (S1) < 90% of subarea totalsor “Total Cropping WaterUse (S2,S3) < 80% of MATARAM total”. Mathematically, this is represented by:

 Equation13

Matrix-building (Table 2) should be in the order of seasons, subarea, and then crop type.

 

Table 2. Constraint matrix formulation: ‘SELECTED seasons SELECTED subareas ALL crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table2

 

User-defined constraint affecting SELECTED seasons ALL subareas SELECTED crops

This pattern sets scheme-wide constraints for selected seasons and crops. Practical examples include statements such as “Total Rice Area (S1) > 5000haor “Total Corn Area (S1,S2) < 20% of combined subareas”. Mathematically, this is represented by:

Equation15

Matrix-building (Table 3) should be in the order of seasons, crops, and then subareas.

 

Table 3. Constraint matrix formulation: ‘SELECTED seasons ALL subareas SELECTED crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table3

 

 User-defined constraint affecting ALL seasons SELECTED subareas SELECTED crops

This pattern places annual constraints on selected subareas and crops. Practical examples include statements such as “Rice Area (Annual) <80% of MATARAM totalsor “Corn Area (Annual) >20% of subarea totals”. Mathematically, this is represented by:

Equation17

Matrix-building (Table 4) should be in the order of subareas, crops, and then seasons.

 

Table 4. Constraint matrix formulation: ‘ALL seasons SELECTED subareas SELECTED crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table4

 

 User-defined constraint affecting SELECTED seasons ALL subareas ALL crops

This pattern constrains scheme-wide total crop production around an (in)equality for selected seasons. Practical examples include statements such as “Total Cropping Area (S1) <90% of combined subareaor “Total Cropping Area (S2,S2) >50% of combined subarea”. Mathematically, this is represented by:

Equation19

Matrix-building (Table 5) should be in the order of seasons, subareas, and then crop type.

 

Table 5. Constraint matrix formulation: ‘SELECTED seasons ALL subareas ALL crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table5

 

 

User-defined constraint affecting ALL seasons SELECTED subareas ALL crops

This pattern constrains annual total crop production around an (in)equality for selected subareas. Practical examples include statements such as “Total Cropping Area (Annual) <95% of MATARAM totalor “Total Cropping WaterUse (Annual) >50% of MATARAM total”. Mathematically, this is represented by:

Equation21

Matrix-building (Table 6) should be in the order of subareas, seasons, and then crop type.

 

Table 6. Constraint matrix formulation: ‘ALL seasons SELECTED subareas ALL crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table6

 

 

 User-defined constraint affecting ALL seasons ALL subareas SELECTED crops

This pattern constrains annual scheme-wide production of selected crops around an (in)equality. Practical examples include statements such as “Total Corn Area (Annual) > 10% of combined subareasor “Total Rice Aare (Annual) < 9000ha”. Mathematically, this is represented by:

Equation23

Matrix-building (Table 7) should be in the order of crops, seasons, and then subareas.

 

Table 7. Constraint matrix formulation: ‘ALL seasons ALL subareas SELECTED crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table7

 

 

User-defined constraint affecting ALL seasons ALL subarea ALL crops

This pattern constrains the annual, scheme-wide, total crop production around an (in)equality.  Practical examples include statements such as “Total Cropping Area (Annual) <12000haor “Total Cropping WaterUse (Annual) >50% total available”. Mathematically, this is represented by a single equation:

Equation25

Matrix-building (Table 8) can be undertaken in any order of seasons, subareas, and crop type.

 

Table 8. Constraint matrix formulation: ‘ALL seasons ALL subareas ALL crops’ for the test case of 2 seasons, 2 subareas and 2 crops.

Table8