Upload
dangdang
View
223
Download
2
Embed Size (px)
Citation preview
A Brief GAMS Tutorial for Dynamic Optimization
L. T. Biegler Chemical Engineering Department
Carnegie Mellon University Pittsburgh, PA
Carnegie Mellon
tf, final time u, control variables p, time independent parameters
t, time z, differential variables y, algebraic variables
Dynamic Optimization Problem
s.t.
Carnegie Mellon
DAE Models in Engineering
Differential Equations • Conservation Laws (Mass, Energy, Momentum)
Algebraic Equations • Constitutive Equations, Equilibrium (physical properties, hydraulics, rate laws)
Characteristics • Large-scale models – not easily scaled • Sparse but no regular structure • Direct solvers widely used • Coarse-grained decomposition of linear algebra
Carnegie Mellon
Nonlinear Dynamic Optimization Problem
Collocation on finite Elements
Nonlinear Programming Problem (NLP)
Nonlinear Programming Formulation
Carnegie Mellon
to tf
" " " "
Collocation points
•" •"•"•" •"
•"•"
•"•"
•"•"
•"
True solution Polynomials
" "" "
•"
Finite element, i
ti
Mesh points i
" " " "
" ""
"element i """"
Algebraic and Control variables Discontinuous
"
"
" "
Collocation on Finite Elements
Carnegie Mellon
Nonlinear Programming Problem
s.t.
Carnegie Mellon
Dynamic Optimization: Methods of Solution
• GAMS – requires complex set notation and conditional statements, general formulation with all collocation equations
• AMPL – similar to GAMS, more elegant set notation and conditional statements, general formulation with all collocation equations
• DynoPC – requires only statement of model, data-driven program in Windows, uses IPOPT and ADOL-C
Carnegie Mellon
Example: Hicks Reactor Problem
Carnegie Mellon
Example: Hicks Reactor Problem
Carnegie Mellon
Introduction and define Sets
Carnegie Mellon
Define Sets and Conditional Sets
Carnegie Mellon
Define parameters for collocation
Carnegie Mellon
Define Variables and Equations
Carnegie Mellon
Collocation Model
Carnegie Mellon
Initialization and Solution