GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.]...

111
GAMS Development Corp. GAMS Software GmbH www.gams.com GAMS – An Introduction Hands-on Tutorial on Optimization Frederik Proske & Lutz Westermann GAMS Software GmbH

Transcript of GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.]...

Page 1: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

GAMS Development Corp. GAMS Software GmbH www.gams.com

GAMS – An Introduction

Hands-on Tutorial on Optimization

Frederik Proske & Lutz WestermannGAMS Software GmbH

Page 2: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

2

Agenda

GAMS at a Glance

GAMS – Hands On Examples

Outlook

• A Model is a Model is a Model

• Parallelization on HPC Systems

• Deployment of GAMS Models

• …

Page 3: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

GAMS at a Glance

Page 4: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

4

1976 - A World Bank Slides

The

Vision

GAMS came into being!

Page 5: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

5

The aim of this system is to provide one representation of a model which is easily understood by both humans and machines.[J. Bischopp, A. Meeraus, On the Development of a General Algebraic Modeling System in a Strategic Planning Environment. Mathematical Programming Study 20 (1982) 1–29.]

Self-documenting model. A GAMS model is a machine-executable documentation of an optimization problem.[M. Bussieck & A. Meeraus, Algebraic Modeling for IP and MIP (GAMS), Annals of Operations Research 149(1): History of Integer Programming: Distinguished Personal Notes and Reminiscences, Guest Editors: Kurt Spielberg and Monique Guignard-Spielberg, February, 2007, pp. 49-56 ]

Page 6: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

6

What did this give us?

Simplified model development & maintenance

Increased productivity tremendously

Made mathematical optimization available to a broader audience (domain experts)

➢2012 INFORMS Impact Prize

Page 7: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

7

➢Roots: World Bank, 1976

➢Went commercial in 1987

➢Locations➢GAMS Development Corporation (USA)➢GAMS Software GmbH (Germany)

➢Product➢The General Algebraic Modeling System

Company

Page 8: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

8

Broad User Community and Network

30+ YearsGAMS Development

14,000+ licenses

Users: 50% academic, 50% commercial

GAMS used in more than 120 countries

Uniform interface to ~40 solvers

Page 9: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

9

Broad Range of Application Areas

Agricultural Economics Applied General Equilibrium

Chemical Engineering Economic Development

Econometrics Energy

Environmental Economics Engineering

Finance Forestry

International Trade Logistics

Macro Economics Military

Management Science/OR Mathematics

Micro Economics Physics

Page 10: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

10

Foundation of GAMS

Powerful algebraic modeling language

Open architecture and interfaces to other systems, independent layers

Page 11: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

11

Declarative and Procedural Language Elements

Declarative elements

• Similar to mathematical notation

• Easy to learn - few basic language elements: sets, parameters, variables, equations, models

• Model is executable (algebraic) description of the problem

Procedural elements

• Control Flow Statements (e.g. loops, for, if,…),

• Build complex problem algorithms within GAMS

• Simplified interaction with other systems • Data exchange• APIs

Page 12: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

12

Independence of Model and Operating System

Platforms supported by GAMS:

Models can be moved between platforms with ease!

Page 13: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

13

Cross Platform GUI – GAMS Studio

➢ Open source Qt project (Mac/Linux/Win)➢ Published on GitHub under GPL

➢ Released in beta status➢ Group Explorer➢ Editor / Syntax coloring / Spell checks

➢ Tree view / Syntax-error navigation➢ Option Editor➢ Integrated Help➢ Model Debugging & Profiling➢ Solver selection & setup➢ Data viewer ➢ GAMS Processes Control

Page 14: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

14

Independence of Model and Solver

All major commercial LP/MIP solver

Open Source Solver (COIN) Also solver for NLP, MINLP,

global, and stochastic optimization

One environment for a wide range of model types and solvers

Switching between solvers with one line of code!

Page 15: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

15

Independence of Model and Data

• Declarative Modeling• ASCII: Initial model development

• GDX: Data layer (“contract”) between GAMS and applications– Platform independent– No license required– Direct GDX interfaces and

general API– …

GDX

GAMS

SOLVER

csv

Page 16: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

16

Independence of Model and User Interface

API’s

• Low Level• Object Oriented: .Net, Java,

Python, C++• No modeling capability:

Model is written in GAMS• Wrapper class that

encapsulates a GAMS model

Page 17: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

18

Free Model Libraries

➢ More than 1400 models!

Page 18: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

19

• Experience of 30+ years • Broad user community from different areas• Lots of model templates• Strong development interface

• Consistent implementation of design principles• Simple, but powerful modeling language• Independent layers• Open architecture: Designed to interact with other

applications

• Open for new developments• Protecting investments of users

Why GAMS?

Page 19: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

GAMS –Building blocks

Page 20: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

21

Sets

• Basic elements of a model

• Syntax:set[s]

set_name ["text"] [/element [text] {,element [text]} /]{,set_name ["text"] [/element [text] {,element [text]} /] } ;

• Elements have up to 63 characters, start letter or digit or are quoted

• Elements have no value (!), that is, ‘1986’ does not have the numerical value 1986 and ‘01’ ≠ ‘1’

• Text has up to 254 characters, all in one line

• Example:

Page 21: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

22

Data

• Data in GAMS consists always of real numbers (no strings)

• Uninitialized data has the default value 0

• 3 forms to declare data:• Scalar: a single (scalar) number• Parameter: list oriented data• Table: table oriented data (at least 2 dimensions)

• Scalar Data:• Syntax:

• Example:

Page 22: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

23

Data: Parameters

• Can be indexed over one or several sets

• Syntax:

• Example:

• Example:

Page 23: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

24

Data: Table

• Syntax:

• Example:

• No “free form”: position of elements is of importance

• tables with more than 2 dimensions are also possible

Page 24: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

25

Data: Assignments

• Scalar Assignment:

• Indexed Assignment:

Page 25: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

26

Data: Expressions (I)

Expression: an arbitrarily complex calculation instruction

Arithmetic operators: +, -, *, /, ** (exponentiate)

• 𝑥**𝑛 corresponds to exp(𝑛*ln(𝑥)) -> only allowed for 𝑥 > 0

• power(𝑥,𝑛) can be used instead (if 𝑛 ∊ ℤ)

Page 26: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

27

Data: Expressions (II)

Indexed Operations:

Page 27: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

28

Variables

Examples:

Page 28: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

29

Variable Attributes

Attributes of a variable:

Examples:

Page 29: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

30

Equations (I)

• Equations serve to define restrictions (constraints) and an objective function

Declaration:

• Syntax:

• Example:

Definition:

• Syntax:

[...] [...]

Page 30: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

31

Equations (II)

Example:

Attributes of an equation:

Page 31: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

32

Model Statements (I)

• Model = collection of equations

• Syntax:

• Example:

Page 32: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

33

Model Statements (II)

• Attributes:

• Example:

Page 33: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

34

Solving a Model

• Passing a model to a solver and evaluation of results

• Specification of one free variable to be minimized or maximized

• Syntax:

• the model type defines the problem class to be used for the model:

• Example:

[...]

Page 34: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

GAMS –Hands On Examples

Page 35: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

36

• What does this example show?

A Simple Transportation Problem

• It gives a first glimpse of how a problem can be formulated in GAMS

• It shows how easy it is to change model type and, consequently, solver technology

• It shows some basics of data exchange with GAMS

Page 36: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

37

LP

•Determine minimum transportation cost

•Result: city to city shipment volumes

MIP

•Discretedecisions

•E.g.: Ship at least 100 cases

MINLP

•Non-linearity

•E.g.: Decreasein unit cost with growing volumes

Scenarios

•SolveLink

•Grid Facility

•GUSS

Page 37: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

38

A Simple Transportation Problem

Freight: $90 case / thousand miles

Canning Plants (supply) Markets (demand)shipments

(Number of cases)

Page 38: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

39

Minimize Transportation costsubject to Demand satisfaction at markets

Supply constraints

350

San Diego 600

275

300

325

Topeka

1.4

2.5

1.8

1.81.72.5

Supply(cases)

Demand(cases)

Distance(thousand miles)

New York

Chicago

Seattle

Freight: $90 case / thousand miles

A Simple Transportation Problem

Page 39: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

40

Mathematical Model Formulation

Indices: 𝑖 (Canning plants) 𝑗 (Markets) Decision variables: 𝑥𝑖𝑗 (Number of cases to ship)

Data: 𝑐𝑖𝑗 (Transport cost per case)

𝑎𝑖 (Capacity in cases) 𝑏𝑖 (Demand in cases) min 𝑐𝑖𝑗 ∙ 𝑥𝑖𝑗𝑗𝑖 (Minimize total transportation cost)

subject to 𝑥𝑖𝑗𝑗 ≤ 𝑎𝑖 ∀ 𝑖 (Shipments from each plant ≤ supply capacity)

𝑥𝑖𝑗𝑖 ≥ 𝑏𝑗 ∀ 𝑗 (Shipments to each market ≥ demand)

𝑥𝑖𝑗 ≥ 0 ∀𝑖, 𝑗 (Do not ship from market to plant)

𝑖, 𝑗 ∈ ℕ

Hands-On

Page 40: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

41

GAMS Syntax (LP Model)

Page 41: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

42

GAMS Syntax (Data Input)

Page 42: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

43

Solution to LP model

Freight: $90 case / thousand miles Total cost: $153,675

50

275

300

275

Canning Plants (supply) Markets (demand)shipments

(Number of cases)

Page 43: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

44

LP

•Determine minimum transportation cost

•Result: city to city shipment volumes

MIP

•Discretedecisions

•E.g.: Ship at least 100 cases

MINLP

•Non-linearity

•E.g.: Decrease in unit cost with growing volumes

Scenarios

•SolveLink

•Grid Facility

•GUSS

Page 44: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

45

• Shipment volume: x (continuous variable)

• Discrete decision: ship (binary variable)

MIP Model: Minimum Shipment of 100 cases

add constraints:𝑥𝑖,𝑗 ≥ 100 ∙ 𝑠ℎ𝑖𝑝𝑖,𝑗 ∀ 𝑖, 𝑗 (if ship=1, then ship at least 100)𝑥𝑖,𝑗 ≤ 𝑏𝑖𝑔𝑀 ∙ 𝑠ℎ𝑖𝑝𝑖,𝑗 ∀ 𝑖, 𝑗 (if ship=0, then do not ship at all)

𝑠ℎ𝑖𝑝𝑖,𝑗 ∈ 0,1

100

ship = 0 ship = 1

0

Cost ($)

Not possible

x (Number of cases)

Hands-On

Page 45: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

46

MIP Model: GAMS Syntax

Page 46: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

47

MIP Model: Results

Page 47: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

48

MIP Model: Solution

Freight: $90 case / thousand miles Total cost: $153,675

325

300

275

Canning Plants (supply) Markets (demand)shipments

(Number of cases)

Page 48: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

49

LP

•Determine minimum transportation cost

•Result: city to city shipment volumes

MIP

•Discretedecisions

•E.g.: Ship at least 100 cases

MINLP

•Non-linearity

•E.g.: Decreasein unit cost with growing volumes

Scenarios

•SolveLink

•Grid Facility

•GUSS

Page 49: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

50

MINLP: Cost Savings

100

ship = 0 ship = 1

0

Cost ($)

Not possible

The cost per case decreases with an increasing shipment volume

Replace:min 𝑖 𝑗 𝑐𝑖𝑗 ∙ 𝑥𝑖𝑗 (Minimize total transportation cost) Withmin 𝑖 𝑗 𝑐𝑖𝑗 ∙ 𝑥𝑖𝑗

𝒃𝒆𝒕𝒂 (Minimize total transportation cost)

x (Number of cases)

Hands-On

Page 50: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

51

MINLP Model: GAMS Syntax

Page 51: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

52

MINLP Model: Results

Page 52: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

53

MINLP Model: Solution

Freight: $90 case / thousand miles

325

300

275

Total cost: $115,438

Canning Plants (supply) Markets (demand)shipments

(Number of cases)

Page 53: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

54

LP

•Determine minimum transportation cost

•Result: city to city shipment volumes

MIP

•Discretedecisions

•E.g.: Ship at least 100 cases

MINLP

•Non-linearity

•E.g.: Decreasein unit cost with growing volumes

Scenarios

•SolveLink

•Grid Facility

•GUSS

Page 54: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

55

• Solving challenging real-world problems often involves the solution of many optimization problems

• Decomposition Methods• Scenario Analysis• Heuristics• …

• Such approaches are often chosen, if solving the problem at hand does not work with a single monolithic model, e.g.

• Due to it’s size and the required resources (e.g. memory)• Due to time restrictions (Problem should be solved in minutes

but it takes days)• …

→GAMS Grid Facility→Gather-Update-Solve-Scatter

Motivation

Page 55: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

56

Controls GAMS function when linking to solver.

Model transport /all/ ;

transport.solveLink={0 %Solvelink.ChainScript%,

1 %Solvelink.CallScript%,

2 %Solvelink.CallModule%,

3 %Solvelink.AsyncGrid%,

4 %Solvelink.AsyncSimulate%,

5 %Solvelink.LoadLibrary%,

6 %solveLink.aSyncThreads%,

7 %solveLink.threadsSimulate%};

solve transport using lp minimizing z;

SolveLink Option

Page 56: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

57

• ChainScript [0]: Solver process, GAMS vacates memory+ Maximum memory available to solver+ protection against solver failure (hostile link)- swap to disk

• Call{Script [1]/Module [2]}: Solver process, GAMS stays live+ protection against solver failure (hostile link)+ no swap of GAMS database- file based model communication

• LoadLibrary [5]: Solver DLL in GAMS process+ fast memory based model communication+ update of model object inside the solver (hot start)- not supported by all solvers

SolveLink Option – Sequential Solves

Page 57: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

58

• Generate 100 distance scenarios with random data

• Solve these scenarios with the solveLink values…• ChainScript [0]• CallModule [2]• LoadLibrary [5]

• Compare the execution time of solving all scenarios with different solveLink settings• Hint: Look at the GAMS function jNow

SolveLink Option Sequential – Exercise

Hands-On

Page 58: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

59

SolveLink Option – Sequential Solves

---- 88 PARAMETER time time for 100 scenarios

ChainScript 6.710, CallModule 2.694, LoadLibrary 0.578

Page 59: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

60

• aSyncGrid [3]: GAMS starts the solution and continues in a Grid computing environment

• aSyncThreads [6]: The problem is passed to the solver in core without use of temporary files, GAMS does not wait for the solver to come back

SolveLink Option – Asynchronous Solves

Page 60: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

61

• Generate 100 distance scenarios with random data

• Solve these scenarios with the solveLink values…• aSyncGrid [3]• aSyncThreads [6]

• Compare the execution time of solving all scenarios with different solveLink settings• Hint: Check the log for output about solveLink

• → Use solver CplexD instead of Cplex• Hint: Look at the following GAMS functions:

• readyCollect

• handleCollect

• handleDelete

SolveLink Option Asynchronous – Exercise

Hands-On

Page 61: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

62

SolveLink Option – Asynchronous Solves

---- 96 PARAMETER time time for 100 scenarios

aSyncGrid 4.259, aSyncThreads 0.496

ChainScript 6.710

CallModule 2.694

LoadLibrary 0.578

aSyncGrid 4.259

aSyncThreads 0.496

Page 62: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

63

• Helpful, if large ratio of solver time / GAMS time

SolveLink Option – Asynchronous Solves

ChainScript 29.807

CallModule 30.004

LoadLibrary 28.864

aSyncGrid 9.112

aSyncThreads 7.901

Page 63: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

64

GUSS – Gather-Update-Solve-Scatteraka Scenario Solver

Generation

Solution

Update

Simple Serial Solve Loop

Scenario Solver/GUSS

Generates model once and updates the algebraic model keeping the model “hot” inside the solver.

Loop

Generation

Solution

Update

Page 64: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

65

GUSS – Gather-Update-Solve-Scatteraka Scenario Solver

ChainScript 6.710

CallModule 2.694

LoadLibrary 0.578

aSyncGrid 4.259

aSyncThreads 0.496

GUSS 0.273

Page 65: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

66

• trnsgrid: https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_trnsgrid.html

• Simple asynchronous solves in a loop, separate collection loop

• tgridmix: https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_tgridmix.html

• Asynchronous solves in combined submission & collection loop. Keep number of submitted models <= #threads

• gussgrid: https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_gussgrid.html

• Asynchronous GUSS-solves in combined submission & collection loop. Keep number of submitted models <= #threads

Grid & GUSS – Examples from the model library

Page 66: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

A Model is a Model is a Model*

* Freely adapted from the poetry of Gertrude Stein, 1874-1946, American writer

Page 67: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

68

What is a Model?

Page 68: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

69

• A mathematical model is a description of a system using mathematical language (from: Wikipedia)

➔Mathematical Programming (MP) Model:List of Equations

What is a Model?

Page 69: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

70

• A mathematical model is a description of a system using mathematical language (from: Wikipedia)

➔Mathematical Programming (MP) Model:List of Equations

• Collection of several intertwined MP Models• Data Preparation• Data Calibration• “Solution” Module (e.g. sequential, parallel loop)• Report Module

What is a Model in GAMS?

Page 70: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

71

• Defining scope of a (part of a) project/model

• IT, analysts, managers, model builders have different views

• Misunderstandings common with verbal descriptions

• Use a model to define the scope• Requirements for such a model

• Rapid prototyping (max. 1-2 man days)• Standard IO interface (Excel)• Remote execution (e.g. through Web UI)

Model as Communication Vehicle

Page 71: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

72

• Optimization models do not allow for any type of vagueness• Input data requirements• Objectives and constraints• Results

• Misunderstandings result in failure of the model• Compilation/execution errors• Infeasible/unbounded MP models

• Model as a contract

Model as Analytic Framework

Page 72: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

73

• Good models do not rely on contract (input data)

• Input Module (handles bad data)• Simple error checks• Analyzing and reporting complex data

problems• Good models (modeling systems) provide

access to results via independent result analyzers for non model experts

• Analytic framework help define result metric• e.g. violations of soft constraints

Model as Contract

Page 73: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

74

Model as Cost Saver

• Most convincing and obvious reason for using an optimization model

• Science of better (INFORMS)

• Often exaggerated/difficult to estimate

Model Roles over Time

Communication Vehicle

Analytic Framework

Contract Cost Saver

Page 74: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

Outlook: Parallelization on HPC SystemsFrom simple sequential to highly parallel solve statements

Page 75: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

76

Off-the-shelf software

(speedup via parallelization)

How does GAMS support problem specific solution approaches that are well suited/customized for HPC?

OptimizationProblem

core core core core

memory

Multi-core shared memory

Distributed (shared) memory

. . .

core core core core

memory

No

de 0

core core core core

memory

No

de 1

core core core core

memory

No

de n

-1

Available Computing Resources

stan

dar

dH

PC

Page 76: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

77

Non-zero Plot of matrix

Solve sequence of problems (e.g. in Benders Decomp.)

… …

Parallelize

…time time

……

Decompose

Use structure exploiting solver

User Annotation to define block structure

1

2

GAMS supports different levels of parallelization

GAMS provides annotation facilities and HPC solver links

OptimizationProblem

Page 77: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

78

• loop body code in sequence, often with an expensive solve statement:

Sequential Solve Statements in Loops

Model generation

Solution process

Model generation

Solution process

Model generation

Solution process

time

Page 78: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

79

• SolveLink option specifies the solver linking conventions

• Split loop in submission & collection loop:

• Model generation and loop body code in sequence

• Either file based IO or limited to shared memory

Parallel Solves – GAMS Grid Facility

MG

SMG

SMG

Stime

Page 79: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

80

mpiexec –n 5 gams myfile

Excursus 1: Message Passing Interface (MPI)

gams myfile

gams myfile

gams myfile

gams myfile

gams myfile

Page 80: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

81

broadcast(db,0)

mpiexec –n 5 gams myfile

Excursus 1: Message Passing Interface (MPI)

gams myfile <-- %sysenv.PMI_RANK%=0

gams myfile <-- %sysenv.PMI_RANK%=1

gams myfile <-- %sysenv.PMI_RANK%=2

gams myfile <-- %sysenv.PMI_RANK%=3

gams myfile <-- %sysenv.PMI_RANK%=4

0

1 2 3 4

gather(db,0)

0

1 2 3 4

myfile.gms – pseudo code

Page 81: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

82

mpiexec –n 5 gams myfile

Excursus 1: Message Passing Interface (MPI)

gams myfile <-- %sysenv.PMI_RANK%=0

gams myfile <-- %sysenv.PMI_RANK%=1

gams myfile <-- %sysenv.PMI_RANK%=2

gams myfile <-- %sysenv.PMI_RANK%=3

gams myfile <-- %sysenv.PMI_RANK%=4

myfile.gms – pseudo code

MG

S …

MG

S

MG

Stime

Page 82: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

83

mpiexec –n 5 gams myfile

Excursus 1: Message Passing Interface (MPI)

gams myfile <-- %sysenv.PMI_RANK%=0

gams myfile <-- %sysenv.PMI_RANK%=1

gams myfile <-- %sysenv.PMI_RANK%=2

gams myfile <-- %sysenv.PMI_RANK%=3

gams myfile <-- %sysenv.PMI_RANK%=4

• Requires reorganization of the code but allows parallel solve

• Distribute/merging data easy (part of MPI)

• Network based communication• Need to make GAMS aware of

MPI → Embedded Code

myfile.gms – pseudo code

Page 83: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

84

Excursus 2: Embedded Code Facility

Page 84: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

85

set scen 'scenario set' / scen1*scen100 /s(scen) 'dynamic secenario subset'k 'benders iterations' / k1*k1000 /;

... // preparatory workloop(k$( NOT done ),

... // setup model for master-problemsolve master min obj_master use lp;... // fix first stage variablesloop(scen,

... // setup model for sub-problemoption clear=s; s(scen) = yes;solve sub min obj_sub use lp;... // process results

);... // compute cuts for next master... // free fixed first stage variables... // set done=1 if convergence criterion is met

);... // reporting

Example: Sequential Benders Decomposition

Page 85: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

86

set scen 'scenario set' / scen1*scen100 /

s(scen) 'dynamic secenario subset'

k 'benders iterations' / k1*k1000 /;

...

embeddedCode Python:

from mpi4py import *

comm = MPI.COMM_WORLD

...

pauseEmbeddedCode

... // preparatory work

$ifthen.MPI 0==%sysenv.PMI_RANK%

loop(k$( NOT done ),

... // setup model for master-problem

solve master min obj_master use lp;

... // fix first stage variables

continueEmbeddedCode:

comm.bcast([[done]] + <data for sub>, root=0)

cut = comm.gather(None, root=0)[1:]

... // gathered data → GAMS data struct.

pauseEmbeddedCode <load GAMS data struct.>

... // compute cuts

... // free fixed first stage variables

... // set done=1 if convergence criterion is met

);

continueEmbeddedCode:

comm.bcast([[done],<empty>], root=0)

endEmbeddedCode

... // reporting

$else.MPI

Example: Parallel Benders with mpi4py

set scen 'scenario set' / scen1*scen100 /

s(scen) 'dynamic secenario subset'

k 'benders iterations' / k1*k1000 /;

...

embeddedCode Python:

from mpi4py import *

comm = MPI.COMM_WORLD

...

pauseEmbeddedCode

... // preparatory work

$else.MPI

s(scen) = ord(scen)=%sysenv.PMI_RANK%;

while(1,

continueEmbeddedCode:

primal_solution = comm.bcast(None, root=0)

// broadcasted data → GAMS data struct.

pauseEmbeddedCode <GAMS data struct.>

abort.noerror$done 'terminating subprocess';

solve sub min obj_sub use lp;

... // process results

continueEmbeddedCode:

comm.gather(<subproblem results>), root=0 )

pauseEmbeddedCode

);

$endif.MPI

PMI_RANK=0 PMI_RANK>=1

Page 86: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

87

• Two-stage stochastic problem emerged from energy system model• 100 scenarios• Deterministic Equivalent:

21,029,101 rows, 23,217,077 columns, 85,721,477 non-zeroes

• Benders:• Master: up to 553 rows, 177 columns, 24,911 non-zeroes• Sub: 210,282 rows 232,161 columns 696,461 non-zeroes• 19 lines of Python Code + some refactorization of GAMS code for MPI version

All runs were made with GAMS 25.1.2 on JURECA@JSC with 24 cores per node, 2.5 GHz, (Intel Xeon E5-2680 v3 Haswell), 128 GB RAM

1: single node, 16 cores, CPLEX barrier, no crossover

2: single node, 4 cores per solve statement, CPLEX barrier, advind 0

3: 17 nodes, 404 cores in total, 4 cores per solve statement, CPLEX barrier, advind 0

Computational Result(s)

TIME [sec]

Methodsub-

problemsmaster-problem total

Deterministic Equivalent1 4059.00

Seq. Benders2 2394.92 0.18 2395.10

MPI Benders3 28.35 0.16 28.51

Page 87: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

Deployment of GAMS models

Page 88: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

89

Calling GAMS from your Application

Creating Input for GAMS Model

→ Data handling using GDX API

Callout to GAMS

→GAMS option settings using Option API→Starting GAMS using GAMS API

Reading Solution from GAMS Model

→ Data handling using GDX API

ApplicationGDX

GAMS SOLVER

Page 89: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

90

• Low level APIs• GDX, OPT, GAMSX, GMO, …• High performance and flexibility• Automatically generated imperative APIs for

several languages (C, C++, C#, Delphi, Java, Python, VBA, …)

• Object Oriented GAMS API• Additional layer on top of the low level APIs• Object Oriented• Written by hand to meet the specific

requirements of different Object Oriented languages

Low level APIs → Object Oriented API

Page 90: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

91

• GAMS comes with several OO APIs (Python, Java, C++, C#, …) to develop applications

→ Programming required to build your applications

Page 91: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

92

From GAMS Model to Visual Web User Interface

Page 92: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

93

1Basic setup:

✓ Annotating GAMS model (defining the input and output data to be displayed in the WebUI)

From GAMS Model to Visual Web User Interface

Page 93: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

94

✓ Fully functional interface by only specifying input and output data

✓ Tabular view of input (editable) and output data

✓ Graphical visualization via pivot charts

Basic Setup –GAMS Model Annotations

Page 94: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

95

Basic Setup –GAMS Model Annotations

Page 95: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

96

Basic Setup –GAMS Model Annotations

Page 96: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

97

Basic Setup –GAMS Model Annotations

Page 97: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

98

1

2

Basic setup:

✓ Annotating GAMS model (defining the input and output data to be displayed in the WebUI)

Advanced setup: ✓ Configuration of standard graphics and UI✓ Sophisticated (custom) graphics (R API)✓ Scenario management with internal database

From GAMS Model to Visual Web User Interface

Page 98: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

99

Advanced Setup –Configuration

✓ Configuration via JSON file✓ Access to a number of pre-

implemented tools for graphical representation

✓ Focus on configuration, not programming

Page 99: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

100

Advanced Setup –Sophisticated graphics

✓ Sophisticated graphics created in R can be included as modules

✓ Access to the entire R ecosystem

✓ Easily extendable with the wide spectrum of the R programming language

Page 100: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

101

1

2

3

Advanced setup: ✓ Configuration of standard graphics and UI✓ Sophisticated (custom) graphics (R API)✓ Scenario management with internal database

Enterprise setup:✓ User- and Application management

Initialization:

✓ Annotating GAMS model (defining the input and output data to be displayed in the WebUI)

From GAMS Model to Visual Web User Interface

Page 101: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

102

Enterprise Setup –User and Application Management

✓ Local or server-based solution✓ User authentication (e.g. LDAP,

OAuth 2.0, Google, GitHub, Facebook)

✓ Multi-Application support with docker-based technology

Yaml config file

Page 102: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

103

Enhanced Model Deployment in GAMS using R/Shiny

• Application connects Web User Interface with a GAMS model

• User Interface allows ✓ Data exchange via local files or database✓ Modification of the input data ✓ Extensive visualization options✓ Comparison of different scenarios✓ Multi-user support based on Docker technology✓ User authentication

• Tool with intuitive interface for planners (configuration vs. programming)

• This “product” is currently under development. If you are interested in getting involved, please contact [email protected]

Page 103: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

104

Welcome to Jupyter @ GAMS!

Page 104: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

105

GAMS Jupyter Example

Hands-On

Page 105: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

106

• Runs in a browser/on a server → No local installation needed

• Allows to use notebook technology in combination with GAMS

• Notebooks allow to combine GAMS and Python• GAMS works great with well structured data and optimization

models• Python is very rich in features to retrieve, manipulate, and

visualize data that comes in all sort of ways• ➔ Combining GAMS and Python in a notebook makes is easy

to tell optimization story with text, data, graphs, math, and models

• This “product” is currently under development.Give it a try at https://jupyterhub.gams.com/hub/login

Using GAMS Jupyter Notebooks to tell “optimization stories”

Page 106: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

Outlook: Stochastic Programming

Page 107: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

108

Stochastic Programming in GAMS

EMP Information

(uncertain Par.)

ReformulatedModel

Solution

Ma

pp

ing

So

lutio

n

into

origin

al space

Deterministic Model

Translation

Solve withestablished Algorithms

EMP/SP➢ Simple interface to add

uncertainty to existing deterministic models

➢ (EMP) Keywords to describe uncertainty include: discrete and parametric random variables, stages, chance constraints, Value at Risk, ...

➢ Available solution methods:➢ Automatic generation of

Deterministic Equivalent (can be solved with any solver)

➢ Specialized commercial algorithms (DECIS, LINDO)

Page 108: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

109

Transport Example – Uncertain Demand

bf

Prob: 0.3Val: 0.90

Prob: 0.5Val: 1.00

Prob: 0.2Val: 1.10

Decisions to make➢ First-stage decision: How many units should be shipped

“here and now” (without knowing the outcome)➢ Second-stage (recourse) decision:

➢ How can the model react if we do not ship enough?➢ Penalties for “bad” first-stage decisions, e.g. buy

additional cases u(j) at the demand location:costsp .. z =e= sum((i,j), c(i,j)*x(i,j))+ sum(j,0.3*u(j));

demandsp(j) .. sum(i, x(i,j)) =g= bf*b(j) - u(j) ;

Uncertain demand factor bf

Page 109: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

110

Uncertain Demand: GAMS Algebra

Page 110: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

111

Uncertain Demand: Results

Page 111: GAMS An Introduction - uni-bremen.de · Mathematical Programming Study 20 (1982) 1–29.] Self-documenting model. A GAMS model is a machine-executable documentation of an optimization

112

• The Extended Mathematical Programming (EMP) framework is used to replace parameters in the model by random variables

• Support for Multi-stage recourse problems and chance constraint models

• Easy to add uncertainty to existing deterministic models, to either use specialized algorithms or create Deterministic Equivalent (new free solver DE)

• More information:https://www.gams.com/latest/docs/UG_EMP_SP.html

Stochastic Programming in GAMS