diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index f73e4f799efe6442804473cac31d1a4922f2cb39..248f57454e04b65fd96fea66158df11135086337 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -48,9 +48,21 @@ $gdxin pasture 1 / ; * pasture yield is done in DM terms + PARAMETER baseCost(crop) cost per ha before intensity values just made up at the moment + / wheat 0.5 + maize 0.5 + rice 1.0 + tropicalCereals 0.5 + oilcrops 0.5 + soybean 0.5 + pulses 0.4 + starchyRoots 1.0 + pasture 0 / ; + + SCALAR fertiliserUnitCost / 0.4 / PARAMETER zeroIntensityYieldFrac(crop) fraction of no fertiliser and irrigiation yield with zero intensity. Most or all arable crops this is 0 but not for pasture - / pasture 0.6 / ; + / pasture 0.3 / ; VARIABLES area(crop, location) total area for each crop - Mha @@ -93,9 +105,10 @@ $gdxin NET_SUPPLY_EQ(crop_less_pasture) calc net supply for crops ENERGY_EQ total energy objective function; - UNIT_ENERGY_EQ(crop, location) .. unitEnergy(crop, location) =E= fertI(crop, location) + - ((1+irrigI(crop, location) ** 2) * irrigCost(location)) -1 + - (1+otherIntensity(crop, location) ** 2) - 1; + UNIT_ENERGY_EQ(crop, location) .. unitEnergy(crop, location) =E= baseCost(crop) + + fertiliserUnitCost* fertI(crop, location) + + (exp(irrigI(crop, location)*2) - 1) * irrigCost(location) + + exp(otherIntensity(crop, location)*2) - 1; YIELD_EQ(crop, location) .. yield(crop, location) =E= ( yieldNone(crop, location) + diff --git a/src/ac/ed/lurg/country/gams/GamsCountryInput.java b/src/ac/ed/lurg/country/gams/GamsCountryInput.java index abe96dd422bc76e3a8fa96afda0b60a1aa677f94..0529ba9f587d1dd21962ac97b69a09e3d440414d 100644 --- a/src/ac/ed/lurg/country/gams/GamsCountryInput.java +++ b/src/ac/ed/lurg/country/gams/GamsCountryInput.java @@ -62,11 +62,11 @@ public class GamsCountryInput { } public double getMaxLandUseChange() { - return 0.95; + return 0; } public double getLandChangeEnergy() { - return 0.001; + return 0.0; } public double getMinFeedRate() { diff --git a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java index 1daa46b61faee818d948c0cfa8a2de7069272829..f42f6cc88cdf067b0ef350c4e6518be70b05728b 100644 --- a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java +++ b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java @@ -183,14 +183,14 @@ public class GamsLocationOptimiser { GAMSVariable varAreas = outDB.getVariable("area"); GAMSVariable varFertIntensities = outDB.getVariable("fertI"); GAMSVariable varIrrigIntensities = outDB.getVariable("irrigI"); - GAMSVariable varOtherIntensities = outDB.getVariable("otherIntensity"); +// GAMSVariable varOtherIntensities = outDB.getVariable("otherIntensity"); GAMSVariable varFeedAmount = outDB.getVariable("feedAmount"); GAMSVariable varNetImports = outDB.getVariable("netImportAmount"); GAMSVariable varYields = outDB.getVariable("yield"); GAMSVariable varUnitEnergies = outDB.getVariable("unitEnergy"); double totalArea = 0; - double area, fertIntensity, irrigIntensity, otherIntensity, feedAmount, netImport, yield, unitEnergy; + double area, fertIntensity, irrigIntensity, otherIntensity = Double.NaN, feedAmount, netImport, yield, unitEnergy; Map<Integer, IntensitiesItem> intensities = new HashMap<Integer, IntensitiesItem>(); Map<Integer, AreasItem> cropAreas = new HashMap<Integer, AreasItem>(); @@ -203,7 +203,7 @@ public class GamsLocationOptimiser { area = rec.getLevel(); fertIntensity = varFertIntensities.findRecord(itemName, locationName).getLevel(); irrigIntensity = varIrrigIntensities.findRecord(itemName, locationName).getLevel(); - otherIntensity = varOtherIntensities.findRecord(itemName, locationName).getLevel(); +// otherIntensity = varOtherIntensities.findRecord(itemName, locationName).getLevel(); yield = varYields.findRecord(itemName, locationName).getLevel(); unitEnergy = varUnitEnergies.findRecord(itemName, locationName).getLevel(); diff --git a/src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java b/src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java index 31096c523521b6ee115871cb6ce3b24ca309aedd..be7e66bc60e337e35f559898c06c47e8e8a5a273 100644 --- a/src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java +++ b/src/ac/ed/lurg/country/gams/GamsRasterOptimiser.java @@ -191,8 +191,8 @@ public class GamsRasterOptimiser { } - int numCerealCats = 2; - int numPastureCats = 2; + int numCerealCats = 1; + int numPastureCats = 1; int thisShouldLookAtCropsOtherThanJustWheat; // need to consider other crops, and perhaps other yieldTypes as well List<Double> wheatlDivisions = getDivisions(yieldRaster, CropType.WHEAT, numCerealCats);