1 / 17

Formulation of a General Problem AGEC 641 Lab, Fall 2011 Mario Andres Fernandez

Formulation of a General Problem AGEC 641 Lab, Fall 2011 Mario Andres Fernandez. Based on material written by Gillig and McCarl ; Improved upon by many previous lab instructors. Special thanks to Yuquan “Wolfgang” Zhang. Simple Problem. Variable Specification Equation Specification

edythe
Download Presentation

Formulation of a General Problem AGEC 641 Lab, Fall 2011 Mario Andres Fernandez

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Formulation of a General ProblemAGEC 641 Lab, Fall 2011Mario Andres Fernandez Based on material written by Gillig and McCarl; Improved upon by many previous lab instructors. Special thanks to Yuquan “Wolfgang” Zhang

  2. Simple Problem Variable Specification Equation Specification Model Statement Solve Statement

  3. What if we had much more data?

  4. GAMS and Algebra • Suppose xi is defined with three elements • Algebra: • GAMS: z=SUM(i,x(i)); • i: set in GAMS • Z: a scalar or variable • X(i): parameter or variable defined over i • The sum automatically treats all cases of i

  5. STEPS • SET definitions • Data Entry • Variable Specification • Equation Specification a) Declaration b) Algebraic structure 5. Model Statement 6. Solve Statement

  6. SET Definition Algebra: subscripts GAMS: sets SET ItemNameoptional explanatory text / element1optional explanatory text element2 optional explanatory text /;

  7. SET Definition SETS ItemName optional explanatory text for item / Element1optional text, Element2optional text /;

  8. Data Entry Scalar Parameters Tables

  9. SCALAR For items that are not set dependent SCALAR ItemNameoptional text /value/; SCALAR LandAvailableTotal Land /100/; SCALAR S LandAvailable /100/ Pricecorn1992 price per bushel /2.2/;

  10. PARAMETER Basic format PARAMETER ItemName(setdependency) / element1associated value, element2 associated value /;

  11. TABLE Basic format TABLE ItemName(set1, set2) optional text set2elem1 set2elem2 set1elem1 value11 value21 set1elem2value21 value22 ;

  12. Direct Assignment Basic format PARAMETER ItemName(set1, set2) optional text; PARAMETER ItemName(set1, set2) = expression; Parameter CalcRevenue(crop) calculate revenues by crop ; CalcRevenue(crop) = Revenue(crop)*Production.L(crop) ;

  13. Parameter TotalRevenue calculate total revenue;TotalRevenue=sum(crop, revenue(crop)*Production(crop)) ; Summation

  14. Variable Declarations Basic format VARIABLE VarName1(set-dependency)optional text VarName2(set-dependency)optional text ;

  15. Equation Declarations Basic format EQUATION EquName1(set-dependency)optional text EquName2(set-dependency)optional text ;

  16. Equation Declarations General Structure: EquationName(Set-Dependency).. LHSEquationRelationType ( =e=, =l=, =g= ) RHS

  17. Solution Reports Shadow price: marginal values of resources. Reduced costs: marginal cost if a non-basic variable is forced to enter the solutions.

More Related