Vous êtes sur la page 1sur 26

Dynamic Optimization

Dr. Abebe Geletu


Winter Semester 2011/2012

Ilmenau University of Technology


Department of Simulation and Optimal Processes
(SOP)

sop

Seite 1

www.tu-ilmenau.de/simulation

Course Content
Topics
1. Introduction
2. Mathematical Preliminaries
- review of calculus of several variables,
- numerical methods of linear and nonlinear equations
3. Numerical Methods of Differential and Differential Algebraic Equations
- Euler methods, Rung Kuttat Methods, Collocation on finite elments
4. Modern Methods of Nonlinear Constrained Optimization Problems
- necessary Optimality Conditions (KKT conditions)
- the sequential quadratic programming (SQP) method
- the interior point method (Optional)
5. Direct Methods for Dynamic Optimization Problems
- An overview of the maximum principle
- Direct methods Collocation on finite elements
6. Introduction to Model Predictive Control (Optional)
Prerequisites: Programming under MATLAB, (Knowledge of C/C++ is advantageous)

sop

Seite 2

www.tu-ilmenau.de/simulation

Course Content
References:
J. T. Betts: Practical Methods for Control Using Nonlinear Programming. SIAM 2001.
R. D. Rabinet III, et al. Applied Dynamic Programming for Optimization of Dynamical
Systems. SIAM 2005.

M. Papageorgiou: Optimierung. Oldenburg. 1996.

J. Nocedal, S. J. Wright: Numerical Optimization, Springer 2006.


D. E. Kirk: Optimal Control Theory, McGraw-Hill, 1992.
Chiang: Elements of Dynamic Optimization, McGraw-Hill, 1992.
Additional references will be cited for individual topics.
Software and Resources
The Matlab ODE Toolbox
The Matlab Optimization Toolbox
The Open Modelica Simulation Environment: http://www.openmodelica.org
General Pseudospectral Optimal Control Software (GPOS): http://www.gpops.org
GAMS

sop

Seite 3

www.tu-ilmenau.de/simulation

Chapter 1: Introduction
1.1 What is a system?
"A system is a self-contained entity with interconnected elements,
process and parts. A system can be the design of nature or
a human invention."

A system is an aggregation of
interactive elements.
A system has a clearly defined boundary. Outside this boundary is
the environment surrounding the system.
The interaction of the system with its environment is the most vital
aspect.
A system responds, changes its behavior, etc. as a result of
influences (impulses) from the environment.

sop

Seite 4

www.tu-ilmenau.de/simulation

1.2. Some examples of systems


Water reservoir and distribution network systems
Thermal energy generation and distribution systems
Solar and/or wind-energy generation and distribution systems
Transportation network systems
Communication network systems
Chemical processing systems
Mechanical systems
Electrical systems
Social Systems
Ecological and environmental system
Biological system
Financial system
Planning and budget management system
etc

sop

Seite 5

www.tu-ilmenau.de/simulation

Space and Flight Industries


Dynamic Processes:
Start up
Landing
Trajectory control

sop

Seite 6

www.tu-ilmenau.de/simulation

Dynamic Processes:
Start-up
Chemical reactions
Change of Products
Feed variations
Shutdown

Chemical Industries

sop

Seite 7

www.tu-ilmenau.de/simulation

Industrial Robot
Dynamic Processes:
Positionining
Transportation

sop

Seite 8

www.tu-ilmenau.de/simulation

1.3. Why System Analysis and Control?


1.3.1 Purpose of systems analysis:
study how a system behaves under external influences
predict future behavior of a system and make
necessary preparations
understand how the components of a system interact
among each other
identify important aspects of a system magnify some
while subduing others, etc.

sop

Seite 9

www.tu-ilmenau.de/simulation

Strategies for Systems Analysis


System analysis requires system modeling and simulation

A model is a representation or an idealization of a system.


Modeling usually considers some important aspects and
processes of a system.
A model for a system can be:
a graphical or pictorial representation
a verbal description
a mathematical formulation
indicating the interaction of components of the system

sop

Seite 10

www.tu-ilmenau.de/simulation

1.3.1A. Mathematical Models


The mathematical model of a system
usually leads to a system of equations
describing the nature of the interaction of the system.
These equations are commonly known as governing laws or
model equations of the system.
The model equations can be:
time independent
steady-state model equations
time dependent
dynamic model equations
In this course, we are mainly interested in dynamical systems.

Sytems that evolove with time are known as


dynamic systems.

sop

Seite 11

www.tu-ilmenau.de/simulation

Examples of Dynamic models RLC Circuit


Linear Differential Equations

x = Ax + Bu
Example RLC circuit (Ohms and Kirchhoffs Laws)

R
1 i 1
i
L
L + L v
=
v
v 1
0

C C
C 0

i
x = ,
vC

sop

Seite 12

1
R

1
i
L
L

, B = L , u = v
x = , A=
0
1
v
0

www.tu-ilmenau.de/simulation

Examples of Dynamic Models Inverted Pendulum

Nonlinear Differential equations

x(t ) = f ( x(t ), u (t ), t )

Example: Cart mounted inverted one-bar pendulum


position of the cart : x
position of the cart center x , y
1
1
the angle
1

Nonlinear Model Equations


(Using Newton and DLamberts Laws)

(m + m1 ) x + m1l1 cos 1 = F + m1l1 sin 1 1

m1l1 cos 1 x + I1 + m l 1 = m1l1 sin 1 g


I1 =

sop

Seite 13

4
m1l12
3

www.tu-ilmenau.de/simulation

2
11

1.3.1B Simulation
studies the response of a system under various external
influences input scenarios
for model validation and adjustment may give hint for
parameter estimation
helps identify crucial and influential characterstics
(parameters) of a system
helps investigate:
instability, chaotic, bifurcation behaviors
in a systems dynamic as caused by certain external
influences
helps identify parameters that need to be controlled

sop

Seite 14

www.tu-ilmenau.de/simulation

1.3.1B. Simulation ...


In mathematical systems theory, simulation is done
by solving the governing equations of the system for
various input scenarios.
This requires algorithms corresponding to
the type of systems model equation.
Numerical methods for the solution of systems of
equations and differential equations.

sop

Seite 15

www.tu-ilmenau.de/simulation

1.4 Optimization of Dynamic Systems


A system with degrees of freedom can be always

manuplated to display certain useful behavior.


Manuplation

possibility to control
Control variables are usually systems degrees of
freedom.

We ask:
What is the best control strategy that forces a
system to display required characterstics, output,
follow a trajectory, etc?
Optimal Control

sop

Seite 16

www.tu-ilmenau.de/simulation

Methods of
Numerical
Optimization

Optimal Control of a space-shuttle


x1 (t ) : Position
x2 (t ) : Speed
u (t ) : Propulsive Force

The shuttle has a drive engine for


both launching and landing.

m : Mass (m = 1 kg)
Initial States:

x1 (0) = 2 m, x2 (0) = 1 m/s

Objective: To land the space vehicle at a given position , say


position 0, where it could be halted after landing.
Target states: Position x S = 0 , Speed x S = 0
1

What is the optimal strategy to bring the space-shuttle to the


desired state with a minimum energy consumption?

sop

Seite 17

www.tu-ilmenau.de/simulation

Optimal Control of a space-shuttle


x1 (t ) : Position
x2 (t ) : Speed

u (t ) : Propulsive Force
m : Mass (m = 1 kg)

Model Equations:
x1 (t ) = x2 (t )
Then

Hence

u (t ) = m a(t ) = m x2 (t )

x1 0 1 x1 0
x = 0 0 x + 1 u
2
2

x1 (t ) = x2 (t )

x = Ax + Bu

x2 (t ) =

Objectives of the optimal control:


Minimization of the error:
Minimization of energy:

sop

Seite 18

x1S x1 (t ); x2S x2 (t )

u (t )

www.tu-ilmenau.de/simulation

1
u (t )
m

Problem formulation:

{[

Performance function:

1
min
x1S x1 (t )
u (t ) 2
0

+ 2 x2S x2 (t )

Model (state ) equations:

x1 0 1 x1 0
x = 0 0 x + 1 u
2
2

Initial states:

x1 (0) = 2; x2 (0) = 1

Desired final states:

x1S = 0; x2S = 0

+ [u (t )] dt
2

How to solve the above optimal control problem in order to achieve


the desired goal? That is, how to determine the optimal trajectories

x1* (t ), x2* (t ) that provide a minimum energy consumption u * (t ) so


that the shuttel can be halted at the desired position?

sop

Seite 19

www.tu-ilmenau.de/simulation

Optimal Operation of a Batch Reactor

sop

Seite 20

www.tu-ilmenau.de/simulation

Optimal Operation of a Batch Reactor


Some basic operations of a
batch reactor
feeding Ingredients
adding chemical catalysts
Raising temprature
Reaction startups
Reactor shutdown
Chemical ractions:

2nd order

A B

1st order

C A (0) = 1 mol/l, C B (0) = 0, CC (0) = 0

Initial states:

Objective: What is the optimal temperature strategy, during the operation


of the reactor, in order to maximize the concentration of komponent B in
the final product?
Allowed limits on the temperature: 298 K T 398 K

sop

Seite 21

www.tu-ilmenau.de/simulation

Mathematical Formulation:
Objective of the optimization:

Model equations:

max C B (t f )
T (t )

dC A
= k1 (T )C A2
dt
dC B
= k1 (T )C A2 k 2 (T )C B
dt
dCC
= k 2 (T )C B
dt
E
k1 (T ) = k10 exp 1
RT
E
k 2 (T ) = k 20 exp 2
RT

Process constraints:
Initial states:

298 K T 398 K
C A (0) = 1 mol/l, C B (0) = 0, CC (0) = 0

0 t tf

Time interval:

This is a nonlinear dynamic optimization problem.

sop

Seite 22

www.tu-ilmenau.de/simulation

1.5 Optimization of Dynmaic Systems


General form of a dynamic optimization problem
DynOpt

min J(x, u)
with

x(t) f=
=
( x(t), u(t) ) , x(t 0 ) x 0
g1 ( x(t), u(t) ) = 0
g 2 ( x(t), u(t) ) 0
u min u u max
t0 t tf .

sop

Seite 23

www.tu-ilmenau.de/simulation

a DAE system

1.6. Solution strategies for dynamic


optimization problems
Solution Strategies
Indirect Methods
Dynamic
Programming

Direct Methods

Maximum
Principle

Sequential
Method

Simultaneous Method
State and control
discretization
Nonlinear Optimization
Solution Nonlinear
Optimization Algorithms

sop

Seite 24

www.tu-ilmenau.de/simulation

Solution strategies for dynamic


optimization problems
Indirect methods (classical methods)
Calculus of variations ( before the 1950s)
Dynamic programming (Bellman, 1953)
The Maximum-Principle (Pontryagin, 1956)1

Lev Pontryagin

Direct (or collocation) Methods (since the 1980s)


Discretization of the dynamic system
Transformation of the problem into a nonlinear
optimization problem
Solution of the resulting problem using optimization
algorithms

sop

Seite 25

www.tu-ilmenau.de/simulation

1.7. Nonlinear Optimization formulation of


dynamic optimization problem
After discretization of DynOpt and appropriate

renaming of variables we obtain a non-linear


programming problem (NLP)

min f (x, u)
u

with
F(x, u) = 0
G(x, u) 0
u min u u max .

sop

Seite 26

www.tu-ilmenau.de/simulation

Vous aimerez peut-être aussi