2.3._calibration_of_the_supply_module
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
2.3._calibration_of_the_supply_module [2022/09/19 15:42] – [Additional Reading] stepanyan | 2.3._calibration_of_the_supply_module [2024/09/20 11:29] (current) – [Downloads] stepanyan | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== Downloads ===== | ===== Downloads ===== | ||
- | Download presentation: | + | Slides: [[https://cloud.capri-model.org/ |
- | Download | + | Excel exercise: |
- | Download | + | Excel exercise solution {{ :: |
- | Download | + | GAMS exercise: |
===== Lecture ===== | ===== Lecture ===== | ||
Line 23: | Line 24: | ||
- | <code lang=gams> | ||
- | |||
- | *XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX* | ||
- | $ontext | ||
- | |||
- | * Exercise (3): MY FARM Model with sets and sum | ||
- | |||
- | *### The objective of the exercise: | ||
- | 1) Getting acquainted with the GAMS programming language. | ||
- | |||
- | *### The problem: | ||
- | A farmer wants to maximize his profit using 200 ha of land and 10000 hours of | ||
- | labor available. He has the option of cultivating three types of crops: wheat, | ||
- | barley, rapeseed and sugarbeet. The profit received and labor hours required for producing one | ||
- | ha of each crop are presented in the table below. How much of each crop does he | ||
- | need to cultivate in order to maximize his profit? | ||
- | |||
- | |||
- | Item Wheat Barley Rapeseed Sugarbeet | ||
- | Profit in €/ | ||
- | Required labor hours/ | ||
- | |||
- | |||
- | *XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX* | ||
- | $offtext | ||
- | |||
- | |||
- | sets | ||
- | crops / | ||
- | wheat | ||
- | barley | ||
- | rapeseed | ||
- | sugarbeet | ||
- | / | ||
- | ; | ||
- | |||
- | Parameters | ||
- | | ||
- | | ||
- | ; | ||
- | |||
- | gm(" | ||
- | gm(" | ||
- | gm(" | ||
- | gm(" | ||
- | |||
- | lab(" | ||
- | lab(" | ||
- | lab(" | ||
- | lab(" | ||
- | |||
- | |||
- | Variables | ||
- | Z objective function value | ||
- | ; | ||
- | |||
- | Positive variable | ||
- | X(crops) | ||
- | ; | ||
- | |||
- | |||
- | Equations | ||
- | land land constraint | ||
- | labour labour constraint | ||
- | obj objective function | ||
- | ; | ||
- | |||
- | obj .. Z =E= sum (crops, X(crops)*gm(crops)); | ||
- | |||
- | land .. sum (crops, X(crops)) =L= 200; | ||
- | |||
- | labour .. sum (crops, lab(crops)*X(crops)) =L= 10000; | ||
- | |||
- | Model myfarm /all/; | ||
- | |||
- | Solve myfarm using lp maximizing Z; | ||
- | |||
- | |||
- | </ |
2.3._calibration_of_the_supply_module.1663602133.txt · Last modified: 2022/11/07 10:23 (external edit)