PROPT - Matlab Optimal Control Software
Total Page:16
File Type:pdf, Size:1020Kb
PROPT - Matlab Optimal Control Software - ONE OF A KIND, LIGHTNING FAST SOLUTIONS TO YOUR OPTIMAL CONTROL PROBLEMS! Per E. Rutquist1 and Marcus M. Edvall2 April 26, 2010 1Tomlab Optimization AB, V¨aster˚asTechnology Park, Trefasgatan 4, SE-721 30 V¨aster˚as,Sweden. 2Tomlab Optimization Inc., 1260 SE Bishop Blvd Ste E, Pullman, WA, USA. 1 Contents Contents 2 1 PROPT Guide Overview 22 1.1 Installation................................................. 22 1.2 Foreword to the software.......................................... 22 1.3 Initial remarks............................................... 22 2 Introduction to PROPT 24 2.1 Overview of PROPT syntax........................................ 24 2.2 Vector representation........................................... 25 2.3 Global optimality............................................. 25 3 Modeling optimal control problems 27 3.1 A simple example.............................................. 27 3.2 Code generation.............................................. 28 3.3 Modeling.................................................. 29 3.3.1 Modeling notes........................................... 31 3.4 Independent variables, scalars and constants............................... 33 3.5 State and control variables......................................... 33 3.6 Boundary, path, event and integral constraints............................. 34 4 Multi-phase optimal control 34 5 Scaling of optimal control problems 34 6 Setting solver and options 35 7 Solving optimal control problems 36 7.1 Standard functions and operators..................................... 36 7.1.1 collocate | Expand a propt tomSym to all collocation points on a phase........... 36 7.1.2 tomSym=dot............................................ 36 7.1.3 final | Evaluate a propt tomSym at the final point of a phase................ 36 7.1.4 icollocate | Expand a propt tomSym to all interpolation points on a phase........ 36 7.1.5 initial | Evaluate a propt tomSym at the initial point of a phase............... 36 7.1.6 integrate | Evaluate the integral of an expression in a phase................. 37 7.1.7 mcollocate | Expand to all collocation points, endpoints and midpoints on a phase.... 37 2 7.1.8 setPhase | Set the active phase when modeling PROPT problem.............. 37 7.1.9 tomControl | Generate a PROPT symbolic state....................... 37 7.1.10 tomControls | Create tomControl objects........................... 38 7.1.11 tomPhase | Create a phase struct............................... 38 7.1.12 tomState | Generate a PROPT symbolic state........................ 38 7.1.13 tomStates | Create tomState objects as toms create tomSym objects............ 39 7.2 Advanced functions and operators.................................... 40 7.2.1 atPoints | Expand a propt tomSym to a set of points on a phase.............. 40 7.2.2 interp1p | Polynomial interpolation............................... 40 7.2.3 proptGausspoints | Generate a list of gauss points....................... 40 7.2.4 proptDiffMatrix | Differentiation matrix for interpPoly.................... 40 7.3 Screen output................................................ 41 7.4 Solution structure............................................. 41 7.5 Plotting................................................... 41 8 jj OPTIMAL CONTROL EXAMPLES jj 42 9 Acrobot 42 9.1 Problem Formulation............................................ 42 10 A Linear Problem with Bang Bang Control 43 10.1 Problem description............................................ 43 10.2 Problem setup............................................... 44 10.3 Solve the problem............................................. 44 10.4 Plot result.................................................. 45 11 Batch Fermentor 47 11.1 Problem description............................................ 47 11.2 Solving the problem on multiple grids................................... 48 11.3 Plot result.................................................. 52 12 Batch Production 58 12.1 Problem description............................................ 58 12.2 Problem setup............................................... 59 12.3 Solve the problem............................................. 61 12.4 Plot result.................................................. 62 13 Batch Reactor Problem 66 3 13.1 Problem description............................................ 66 13.2 Problem setup............................................... 66 13.3 Solve the problem............................................. 67 13.4 Plot result.................................................. 68 14 The Brachistochrone Problem 70 14.1 Problem description............................................ 70 14.2 Problem setup............................................... 70 14.3 Solve the problem............................................. 71 14.4 Plot the result............................................... 72 15 The Brachistochrone Problem (DAE formulation) 73 15.1 DAE formulation.............................................. 73 15.2 Problem setup............................................... 73 15.3 Solve the problem............................................. 74 15.4 Plot the result............................................... 75 16 Bridge Crane System 76 16.1 Problem description............................................ 76 16.2 Problem setup............................................... 77 16.3 Solve the problem............................................. 77 16.4 Plot result.................................................. 78 17 Bryson-Denham Problem 80 17.1 Problem description............................................ 80 17.2 Problem setup............................................... 80 17.3 Solve the problem............................................. 81 17.4 Plot result.................................................. 81 18 Bryson-Denham Problem (Detailed) 83 18.1 Problem description............................................ 83 18.2 Define the independent variable, and phase:............................... 83 18.3 A few constants............................................... 83 18.4 Define a list of states............................................ 83 18.5 Adding the control variable and equations................................ 84 18.6 Equations.................................................. 84 18.7 Build the .m files and general TOMLAB problem............................ 84 4 19 Bryson-Denham Problem (Short version) 86 19.1 Problem description............................................ 86 19.2 Problem setup............................................... 86 20 Bryson-Denham Two Phase Problem 88 20.1 Problem description............................................ 88 20.2 Problem setup............................................... 88 20.3 Solve the problem............................................. 90 20.4 Plot the result............................................... 91 21 Bryson Maxrange 93 21.1 Problem description............................................ 93 21.2 Problem setup............................................... 93 21.3 Solve the problem............................................. 94 21.4 Plot result.................................................. 94 22 Catalyst Mixing 96 22.1 Problem formulation............................................ 96 22.2 Problem setup............................................... 96 22.3 Solve the problem............................................. 97 22.4 Plot result.................................................. 98 23 Catalytic Cracking of Gas Oil 100 23.1 Problem Formulation............................................ 100 23.2 Problem setup............................................... 100 23.3 Solve the problem............................................. 101 23.4 Plot result.................................................. 102 24 Flow in a Channel 103 24.1 Problem Formulation............................................ 103 24.2 Problem setup............................................... 104 24.3 Solve the problem............................................. 104 24.4 Plot result.................................................. 105 25 Coloumb Friction 1 107 25.1 Problem Formulation............................................ 107 25.2 Problem setup............................................... 107 25.3 Solve the problem............................................. 108 5 25.4 Plot result.................................................. 109 26 Coloumb Friction 2 110 26.1 Problem Formulation............................................ 110 26.2 Problem setup............................................... 111 26.3 Solve the problem............................................. 111 26.4 Plot result.................................................. 112 27 Continuous State Constraint Problem 114 27.1 Problem description............................................ 114 27.2 Problem setup............................................... 114 27.3 Solve the problem............................................. 115 27.4 Plot result.................................................. 115 28 Curve Area Maximization 117 28.1 Problem Description............................................ 117 28.2 Problem setup............................................... 117 28.3 Solve the problem............................................. 118 28.4 Plot result.................................................. 118 29 Denbigh's System of Reactions 120 29.1 Problem description............................................ 120 29.2 Problem