Lesson 21 : Agriculture, a risky activity

This lesson is divided into two parts : the information needed to model risk and how to write in GAMS. Watch the first video and try to write the model in question ON YOUR OWN before you watch the second one.

1) Video 1 : Theory
                                                 video(15 min)
2) Example : Income variability
  • open GAMS
  • open the model primal0_risk_base.gms
  • Add the equations of random income calculation and check the random income values in the output file
State of nature Probability Gross margin of wheat Gross margin of maize
E1 0.2 460 2000
E2 0.2 440 500
E3 0.2 450 300
E4 0.2 430 1400
E5 0.2 470 800
AVERAGE 450 1000

The model is therefore written as follows :

Max Z = 450×1+1000×2
avec  x1+x2 ≤ 50
25×1+50×2 ≤ 2000
460×1+2000×2 = RAL1
440×1+500×2 = RAL2
450×1+300×2 = RAL3
430×1+1400×2 = RAL4
470×1+800×2 = RAL5      x1,x2 ≥ 0

Add 5 calculation constraints such as :

equations
revenuAlea1;
revenuAlea1.. RAL1=e=sum(C, MB(‘E1’,C)*X(C)] ;

Or ass a constraint that is dependent on set E (like in lesson 12 concerning periods)

equations
revenuAlea(E);
revenuAlea(E).. RAL(E)=e=sum(C, MB(E,C)*X(C)];

It is now your turn to write in GAMS !

3) Correction-lesson
video(6 min)

Random income calculation model – primal0_risk.gms