Skip to content
Snippets Groups Projects
Commit d2880d00 authored by Peter Alexander's avatar Peter Alexander
Browse files

Added imports

parent c64eb11b
No related branches found
No related tags found
No related merge requests found
SET all_types crop types including pasture and animal products / cereals, fruits, oilcrops, starchyRoots, treenuts, vegetables, pasture, meat /;
SET crop crop types including pasture / cereals, fruits, oilcrops, starchyRoots, treenuts, vegetables, pasture /;
SET commodities(all_types) crop types including pasture / cereals, fruits, oilcrops, starchyRoots, treenuts, vegetables, meat /;
SET crop(all_types) crop types including pasture / cereals, fruits, oilcrops, starchyRoots, treenuts, vegetables, pasture /;
SET crop_less_pasture(crop) arable crops types includes treenuts but not pasture / cereals, fruits, oilcrops, starchyRoots, treenuts, vegetables /;
SET feed_crop(crop) / cereals, oilcrops /;
SET landuse land use type / cropland, pasture /;
PARAMETER previous_area(landuse) areas for previous timestep in ha;
PARAMETER demand(crop) yield in t per ha;
PARAMETER demand(crop_less_pasture) yield in t per ha;
PARAMETER yield_ref(crop) yield in t per ha;
PARAMETER world_input_energy(crop_less_pasture) average input energy from world exports used to determine if we should import or export;
SCALAR meatDemand;
SCALAR meatEfficency;
SCALAR worldMeatInputEnergy
SCALAR maxLandUseChange;
SCALAR maxIntensity;
$gdxin %gdxincname%
$load previous_area, demand, yield_ref, meatDemand, meatEfficency, maxLandUseChange, maxIntensity
$load previous_area, demand, yield_ref, world_input_energy, meatDemand, meatEfficency, worldMeatInputEnergy, maxLandUseChange, maxIntensity
$gdxin
PARAMETER feedEnergy(crop) energy from feed in MJ per t
/ cereals 1
oilcrops 1.5
pasture 0.4
/ ;
pasture 0.4 / ;
VARIABLES
area(crop) total area for each crop
feedArea(crop) area used for feed for each crop
intensity(crop) intensity for each crop
yield(crop) yield per area for each crop
unit_energy(crop) energy per area for each crop
energy total input energy;
area(crop) total area for each crop - ha
feedArea(crop) area used for feed for each crop - ha
intensity(crop) intensity for each crop - unitless
yield(crop) yield per area for each crop - t per ha
unit_energy(crop) energy per area for each crop - energy
importAmount(crop_less_pasture) import of crop - t
meatImport meat import - t
energy total input energy - energy;
POSITIVE VARIABLE area, intensity, feedArea;
POSITIVE VARIABLE area, intensity, feedArea, importAmount, meatImport;
EQUATIONS
UNIT_ENERGY_EQ(crop) energy per area
......@@ -49,10 +55,10 @@ $gdxin
YIELD_EQ(crop) .. yield(crop) =E= yield_ref(crop) * intensity(crop);
CROP_DEMAND_CONSTRAINT(crop_less_pasture) .. (area(crop_less_pasture) - feedArea(crop_less_pasture)) * yield(crop_less_pasture) =G= demand(crop_less_pasture);
CROP_DEMAND_CONSTRAINT(crop_less_pasture) .. (area(crop_less_pasture) - feedArea(crop_less_pasture)) * yield(crop_less_pasture) =G= demand(crop_less_pasture) - importAmount(crop_less_pasture);
MEAT_DEMAND_CONSTRAINT .. meatEfficency*sum(feed_crop, feedEnergy(feed_crop) * feedArea(feed_crop) * yield(feed_crop)) +
feedEnergy('pasture') * area('pasture') * yield('pasture') =G= meatDemand;
feedEnergy('pasture') * area('pasture') * yield('pasture') =G= meatDemand - meatImport;
MIN_INTENSITY_CONSTRAINT(crop) .. intensity(crop) =G= 1;
......@@ -64,7 +70,7 @@ $gdxin
AGRI_LAND_CHANGE_CONSTRAINT .. abs(sum(crop, area(crop)) / sum(landuse, previous_area(landuse)) - 1) =L= maxLandUseChange;
ENERGY_EQ .. energy =E= SUM(crop, area(crop)*unit_energy(crop));
ENERGY_EQ .. energy =E= SUM(crop, area(crop)*unit_energy(crop)) + sum(crop_less_pasture, importAmount(crop_less_pasture) * world_input_energy(crop_less_pasture) + meatImport * worldMeatInputEnergy);
MODEL LAND_USE /ALL/ ;
SOLVE LAND_USE USING DNLP MINIMIZING energy;
......
......@@ -53,8 +53,17 @@ public class GamsTest {
parm.addRecord("vegetables").setValue(1);
parm.addRecord("pasture").setValue(0.7);
parm = db.addParameter("world_input_energy", 1, "average input energy from world exports used to determine if we should import or export energy per t");
parm.addRecord("cereals").setValue(0.5);
parm.addRecord("fruits").setValue(2.0);
parm.addRecord("oilcrops").setValue(2.0);
parm.addRecord("starchyRoots").setValue(0.3);
parm.addRecord("treenuts").setValue(2.0);
parm.addRecord("vegetables").setValue(2);
db.addParameter("meatDemand", 0, "demand for meat milk and eggs").addRecord().setValue(160);
db.addParameter("meatEfficency", 0, "efficency of converting feed and pasture into animal products").addRecord().setValue(0.1);
db.addParameter("worldMeatInputEnergy", 0, "world average meat export energy").addRecord().setValue(3);
db.addParameter("maxLandUseChange", 0, "max rate of land use change").addRecord().setValue(0.1);
db.addParameter("maxIntensity", 0, "max intensity which will rise over time").addRecord().setValue(3);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment