Power of GAMS AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl. Improved upon by many previous lab instructors.

Slides:



Advertisements
Similar presentations
Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
Advertisements

IENG442 LINGO LAB3.
Assignment 2 Question 7 Farmer Leary.
What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS-
The Simplex Method The geometric method of solving linear programming problems presented before. The graphical method is useful only for problems involving.
Advanced GAMS 1. Good Modeling Practices 2. Fixing Misbehaving Models 3. Linking GAMS 4. Advanced GAMS Syntax.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Systems of Equations Matrix Methods.
 Econometrics and Programming approaches › Historically these approaches have been at odds, but recent advances have started to close this gap  Advantages.
Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney.
Lecture 7: Linear Programming in Excel AGEC 352 Spring 2011 – February 9, 2011 R. Keeney.
Good modeling practices AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl. Improved upon by many previous lab.
GAMSCHK and GAMS Documentation AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl; Improved upon by many previous.
Conditionals, Subsets and Tuples in GAMS AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by McCarl and Elbakidze; Improved upon.
Comparative Analysis Multiple Submissions vs. Loops AGEC 641 Lab, Fall 2010 Mario Andres Fernandez Based on material written by Gillig and McCarl; Improved.
GAMS/GAMSIDE AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl and improved upon by previous lab instructors.
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.
Examining a model for Flaws AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl. Improved upon by many previous.
Functions.
Lecture 1: Basics of Math and Economics AGEC 352 Spring 2011 – January 12 R. Keeney.
Elasticity of Demand & Supply Chap 18- Extensions of Demand & Supply Analysis – McConnel & Brue Chap 2-The Basics of Demand & Supply – Pindyck Lecture.
What is GAMS?.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Lab Assignment 7 | Web Forms and Manipulating Strings Interactive Features Added In this assignment you will continue the design and implementation of.
GAMS General Algebraic Modeling System Presentation No.2 Instructor: Dr. Abbas Seifi Prepares by: Masoud Barah Applied OR Modeling Course.
FW364 Ecological Problem Solving Lab 4: Blue Whale Population Variation [Ramas Lab]
Introduction to GAMS: Good modeling practices Prof. Boyan Bonev Ivanov, Ph.D. Institute of Chemical Engineering-BAS.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 2 - Welcome Application: Introduction to C++
Lecture 6: Algorithm Approach to LP Soln AGEC 352 Fall 2012 – Sep 12 R. Keeney.
CS 122 Engineering Computation Lab Lab 2 Dan De Sousa and Tim Cheeseman Department of Computer Science Drexel University April 2009 ©By the author. All.
Analytical vs. Numerical Minimization Each experimental data point, l, has an error, ε l, associated with it ‣ Difference between the experimentally measured.
Lecture #9. Review Homework Set #7 Continue Production Economic Theory: product-product case.
3.5 – Solving Systems of Equations in Three Variables.
CSC 3210 Computer Organization and Programming Chapter 1 THE COMPUTER D.M. Rasanjalee Himali.
More Algorithm Design CSIS 1595: Fundamentals of Programming and Problem Solving 1.
CDAE Class 12 Oct. 5 Last class: Quiz 3 3. Linear programming and applications Today: Result of Quiz 3 3. Linear programming and applications Next.
Chapter 19: The Solver Re-Visited Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
CDAE Class 13 Oct. 10 Last class: Result of Quiz 3 3. Linear programming and applications Class exercise 5 Today: 3. Linear programming and applications.
B RIEF C ALC – S EM 1 R EVIEW C H 1 Formulas: Three forms of Linear Equations Standard: Ax + By = C “A” and “ B ” must be a whole numbers “A” must be positive.
Covenant College November 27, Laura Broussard, Ph.D. Professor COS 131: Computing for Engineers Chapter 5: Functions.
Section 7-3 Solving 3 x 3 systems of equations. Solving 3 x 3 Systems  substitution (triangular form)  Gaussian elimination  using an augmented matrix.
Rule of 70 You have to know this for the test – and to compound daily interest on a savings account!
Climate Change Adaptation: Crop Choice. Crop Choice As climate changes, net revenues of plants change – Crops move along their climate response function.
Linear Programming. Graph the following system of inequalities.
GAMS: General Algebraic Modeling System Linear and Nonlinear Programming The full system documentation is provided electronically with the software.
LINEAR PROGRAMMING 3.4 Learning goals represent constraints by equations or inequalities, and by systems of equations and/or inequalities, and interpret.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
SYSTEMS OF EQUATIONS. Unit 2 Systems of Equations A system of equations is two or more equations with the same variables. ex. 3x-2y=8 4x+3y=12 There are.
CEE 321 Structural Analysis And Design Design Project 1 Feedback 1.
JavaScript 101 Lesson 6: Introduction to Functions.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
13-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 13 Solver.out File and CCL Introduction to.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
SYSTEMS OF EQUATIONS.
Chapter 12: Kay and Edwards
Lecture 5 Good modeling Chengcheng Fei 2017 Fall
Lecture 7 GAMS Check Chengcheng Fei 2017 Fall
Lecture 4 Power of GAMS Chengcheng Fei 2017 Fall
Lecture 9 Report writing
The Simplex Method The geometric method of solving linear programming problems presented before. The graphical method is useful only for problems involving.
Solving Equations with variables on each side
Lecture 8 Exam model flaws
Lecture 6 Conditionals, Subsets and Tuples in GAMS
Dynamic Data Structures and Generics
The Simplex Method The geometric method of solving linear programming problems presented before. The graphical method is useful only for problems involving.
Excel Solver IE 469 Fall 2018.
Tonga Institute of Higher Education
Lecture 10 Comparative analysis
Lecture 2 General Problem
Presentation transcript:

Power of GAMS 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

Power of GAMS Algebraic Modeling  Context Changes  Expandability of Models  Adding Conditionals Adding Report Writing/Self Documenting Nature Small to Large Model Development Model Library Use by Others

Context Changes The same algebraic model can be used in multiple contexts often with the same or very similar structure. SETS Process Production process /CornCorn production WheatWheat production Cotton Cotton production / ResourceResource item used /LandLand used by process Labor Labor used by process/; SETS Process Production process /MakeChair Chair production MakeTable Table production MakeLamp Lamp production / ResourceResource item used /PlantCap Production Capacity Labor Labor used by process/;

Context Changes One has to revise data and their set elements for consistency; yet, other structures remain TABLE ResourceUse(Resource,Process) Resource used CornWheatCotton Land Labor ; PARAMETERS Revenue(Process) Revenues from process / Corn 109, Wheat 90, Cotton 115 / ResourceAvailable(Resource) Resource availability / Land 100, Labor 500 / ; TABLE ResourceUse(Resource,Process) Resource used MakeChair MakeTable MakeLamp PlantCap Labor ; PARAMETERS Revenue(Process) Revenues from process / MakeChair 11, MakeTable 10, MakeLamp 12/ ResourceAvailable(Resource) Resource availability / PlantCap 12, Labor 5 / ;

Crop production problem

SETS ProcessProduction process /CornCorn production WheatWheat production CottonCotton production Soybeans Soybeans production / ResourceResource item used /LandLand used by process LaborLabor used by process/ ; Instead of growing 3 crops, now a farmer also wants to grow soybeans. One needs only to modify an element in PROCESS set, resource usage data, and revenues. Expand the Scope

Other data and the model structure remains the same TABLE ResourceUse(Resource,Process) Resource used Corn Wheat Cotton Soybeans Land Labor ; PARAMETERS Revenue(Process) Revenues from process production / Corn 109 Wheat 90 Cotton 115 Soybeans 95 / ResourceAvailable(Resource) Resource availability / Land 100 Labor 500 / ; Expand the Scope (cont)

PARAMETERS Revenue(Process) Revenues from process production / Corn 109 Wheat 90 Cotton 115 Soybeans 95 / ResourceAvailable(Resource) Resource availability / Land 100 Labor 500 / MinLand(Process) Minimum land requirement / Corn 0 Wheat 10 Cotton 0 Soybeans 0 / ; If wheat is used for farmer consumption, it must be grown in at least 10 units (acres). Modification includes adding data on minimum land use, and equation specification on minimum land use. Augmenting Existing Models

EQUATIONS Objective Maximize farm income ResourceEq(Resource) Resource constraint MinLandReq(Process) Minimum land requirement; MinLandReq(Process).. ResourceUse(“Land”, Process)*Production(Process) =G= MinLand(Process); Other data and the model structure remains the same Augmenting Existing Models (cont)

Self-Documenting Nature Can you figure out what context the example below is from?

Self-Documenting Nature One can include comments in the code by Using * in the first character position. The remaining characters in the line to be ignored but printed on the output file. Setting off by $ONTEXT and $OFFTEXT.

Small to Large Modeling GAMS expandability allows the same model structure, calculations, and report writing to be used with SETS with few elements vs. SETS with many items. Using a small data set allows up to examine the model structure and function easier and better. To expand, one uses SmallStocks(Stocks) = YES;

Model Library Modelers can find a number of sources of models from which they can expand or take insights.

Use By Others Create a “t” folder under the project directory When finished running data.gms, GAMS will save all the information in \t\a1 To solve the model, GAMS retrieves information saved in \t\a1. When finished solving mymodel.gms, GAMS will save all information including solutions in \t\a2 where it is ready to be used later

Set declarations Parameter declarations Variable declarations Equation declarations Specifying algebraic structure Model specifications Solve specifications SOLVE Ex USING LP MAXIMIZING Z; SOLVE Ex USING MIP MAXIMIZING Z; SOLVE Ex USING NLP MAXIMIZING Z; Data Model Non-linear and Other Problem Forms

Hands On 3 Fix errors in Handson3error.gms and send an electronic copy of the correct *.gms file. Hand in a hard copy of *.lst file (from “Solution Report” to the end).