Dynamic Optimization Dr. Abebe Geletu Ilmenau University of Technology Department of Simulation and Optimal Processes (SOP) sop Seite 1 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 2 www.tu-ilmenau.de/simulation Course Content Chapters 1. Introduction 2. Mathematical Preliminaries 3. Numerical Methods of Differential Equations 4. Modern Methods of Nonlinear Constrained Optimization Problems 5. Direct Methods for Dynamic Optimization Problems 6. Introduction of Model Predictive Control (Optional) References: sop Seite 3 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 4 www.tu-ilmenau.de/simulation Space and Flight Industries Dynamic Processes: • Start up • Landing • Trajectory control sop Seite 5 www.tu-ilmenau.de/simulation Dynamic Processes: • Start-up • Chemical reactions • Change of Products • Feed variations • Shutdown Chemical Industries sop Seite 6 www.tu-ilmenau.de/simulation Industrial Robot Dynamische Processes: • Positionining • Transportation sop Seite 7 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 8 www.tu-ilmenau.de/simulation Strategies for Systems Analysis • System analysis requires system modeling and simulation 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 9 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 we evolove with time are known as dynamic systems. sop Seite 10 www.tu-ilmenau.de/simulation 1.3.2. Examples of dynamic models • Linear Differential Equations x Ax Bu • Example RLC circuit (Ohm‘s and Kirchhoff‘s Laws) R 1 i 1 i L L L v v v 1 0 C C C 0 • i x , vC sop Seite 11 1 R 1 i L L , B L , u v x , A 0 1 v 0 C C www.tu-ilmenau.de/simulation 1.3.2. Examples of dynamic models • Nonlinear Differential equations x(t ) f ( x(t ), u (t ), t ) sop Seite 12 www.tu-ilmenau.de/simulation 1.3.2. Examples of dynamic models • Nonlinear Differential equations x(t ) f ( x(t ), u (t ), t ) 5i1 15(i1 i3 ) 220V R(i2 i3 ) 5i2 10i2 0 20i3 R(i3 i2 ) 15(i3 i1 ) 0 sop Seite 13 www.tu-ilmenau.de/simulation 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 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 ) : PropulsiveForce 0 1 2 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 brought halted after landing. Target states: Position x S 0 , Speed x S 0 1 2 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 0 1 u (t ) : PropulsiveForce m : Mass (m 1 kg) 2 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 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 2 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 Tsoll Some basic operations of a batch reactor TC • feeding Ingredients • adding chemical catalysts • Raising temprature • Reaction startups • Reactor shutdown Chemical ractions: 2nd order A B 1st order C CA (0) 1 mol/l,CB (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 ) dCA k1 (T )C A2 dt dCB k1 (T )C A2 k 2 (T )C B dt dCC k 2 (T )CB 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 CA (0) 1 mol/l,CB (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 min J ( x, u , p ) wit h x f ( x, u , p ), x(t0 ) x0 g1 ( x, u , p ) 0 g 2 ( x, u , p ) 0 u min u u max t0 t t f . sop Seite 23 www.tu-ilmenau.de/simulation a DAE system 1.4. 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 1950‘s) • Dynamic programming (Bellman, 1953) • The Maximum-Principle (Pontryagin, 1956)1 Lev Pontryagin Direct (or collocation) Methods (since the 1980‘s) • Discretization of the dynamic system • Transformation of the problem into a nonlinear optimization problem • Solution of the problem using optimization algorithms Verfahren sop Seite 25 www.tu-ilmenau.de/simulation 1.5. Nonlinear Optimization formulation of dynamic optimization problem • After appropriate renaming of variables we obtain a non-linear programming problem (NLP) min E ( X , U , p ) U with FCollocation ( X , U ,Method p) 0 G ( X ,U , p) 0 u min U u max . sop Seite 26 www.tu-ilmenau.de/simulation