GAMS Model Development – Using CHP as an example Using CHP as an example Michael Bussieck [email protected]Jan-Hendrik Jagla [email protected]Lutz Westermann [email protected]GAMS Software GmbH www.gams.de GAMS Development Corporation www.gams.com
35
Embed
GAMSold.gams.com/presentations/present_gor08_ws_chp.pdf · GAMS Model Development ... Combined Heat and Power (CHP) Plant electricity has to be satisfied • Electricity can be traded
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
• Special Ordered Sets Type 1 (Only one member in a set of variables can have nonzero value)
• Special Ordered Sets Type 2 (Only two adjacent members in a set of variables can have nonzero value)
8
GAMS Syntax: Equations
• Definition
9
• Declaration
GAMS Syntax: Model Definition
• Model
• Solver selection
10
• GAMS options
• Solver options
• Solve
GAMS Syntax: Procedural Elements
• For
• While
11
• While
• Loop• If… else…
Mathematical Functions
12 *not exhaustive
• Compile time arguments…– start with $– are executed when compiling a GAMS file– are e.g. $if, $set, $goto, $exit, $call …
Compile Time vs. Execution Time
• Execution time arguments…– are executed during the execution of the compiled
GAMS file– are e.g. if, execute, solve, loop, …
NOTE: When reading a model from top to bottom, we can see an execution time command before a compile time command, but the latter will be executed first.
13
Agenda
GAMS – Basic Syntax
14
GAMS – Basic Syntax
Excursus: GDX
Building a Model: CHP Generation Plant
IDE GDX Viewer
GDX
IDE GDX Viewer
GDX
Gams Data eXchange
Application GDX
GAMS
SOLVER
Binary Data Exchange
GDX Tools
GDX
GDXxrw(MS Office)
GAMS
GDXDiff
GDXDump
GDXMerge
GDXRank
GDXAPI
GDX
GDXxrw(MS Office)
GAMS
GDXDiff
GDXDump
GDXMerge
GDXRank
GDXAPI
• Fast exchange of data
• Syntactical check on data before model starts
• Data Exchange at any stage (Compile and Run-time)
• GT may be turned on not more than 8 times during modeled time frame
Exercise 4: Limiting Number of GT Starts
modeled time frame
31
1),(0),1(1),( =⇒=−∧= phSTARTUPphONOFFphONOFF
),1(),(),( phONOFFphONOFFphSTARTUP −−≥→
8)'',( ≤∑h
GThSTARTUP
• GT has to stay off for at least 8 hours when shut down
Exercise 5: Add “cool down” time for GT
)'',()'',1()'',(
1),(1),1(0),(
GThONOFFGThONOFFGThSHUTDOWN
phSHUTDOWNphONOFFphONOFF
−−≥→
=⇒=−∧=
32
)'',(1)'',(8|
2
222
GThSHUTDOWNGThSTARTUPhhhhh
−≤→ ∑+<∧≥
8|0)'',(
1)'',(
22+<≤=⇒
=
hhhGThSTARTUP
GThSHUTDOWN
Demo: Calling GAMS from MS Excel
33
GAMS on the Web
Download www.gams.de www.gams.com
Help and SupportSupport Wiki http://support.gams-software.com
34
Support Wiki http://support.gams-software.comInterfaces Wiki http://interfaces.gams-software.comMcCarl‘s News http://www.gams.com/maillist/newsletter.htmUser Group http://www.gams.com/maillist/gams_l.htmGoogle Group http://groups.google.de/group/gamsworld
Search all GAMSWebsites http://www.gams.com/search.htm