Activity 7A : « Wheat/maize » model – Displaying results

Length : around 15 minutes

First part :

Based on the following programme excerpt :

*---------- DECLARATIONS ----------*
sets C crops /wheat,maize/ ;

*---------- DATA ----------*
scalar
LAND_A land availability in hectares /50/
LABOUR_A labour availability in hours /2000/ ;

parameter
LN(C) labour needs per hectare and per crop (hours)
/wheat 25
maize 50/
YLD (C) yield per crop in tonnes per hectare
/ wheat 5
maize 10/
PC (C) selling price per crop in euros
/ wheat 150
maize 150/
COST (C) cost per crop in euros per ha
/ wheat 300
maize 500/
;
parameter
GM(C) gross margin per crop in euros ;
GM(C) = YLD(C)*PC(C)-COST(C);

*---------- MODEL ----------*
variables Z total fram income (euros) ;
positive variables X area per crop (hectares) ;

equations
OBJECTIVE objective function
LAND land equation
LABOUR labour equation
;

OBJECTIVE.. sum(c, GM(c)*X(c)) =E= Z ;
LAND.. sum(c, X(c)) =l= LAND_A ;
LABOUR.. sum(c, LN(c)*X(c)) =L= LABOUR_A ;

model example first example /all/;

*---------- SOLUTION ----------*
solve example using LP maximizing Z;

display X.m ;
display C;

What will the DISPLAY c command show ?

What will the DISPLAY x.m command show ?

Click on « Start quiz » to see the questions

Second part :

Download the  primal1.zip  file and unzip it to your GAMS project folder (if you have not already done it), then open it in GAMS. Add the necessary lines to the model in order to display :

  • The marginal value of the labour equation
  • The optimum value of areas
  • The minimum value of the soil equation
  • The gross margin parameter

Then verify :                  solution