Home
MUS COD II
Contents
1. name mc2 int itr cpu obj inf lag brgri ch sl RKF23S 4 0 5 1 25267 1077 5 0 1077 1 9 1075 brgr2 chs RKF23S 3 1 4 8 28574 1074 4 1 107 2 1 107 rosen vm sl NULLSLV 37 0 5 1 98930 10 0 0 5 8 107 eason fd bt NULLSLV 14 0 2 1 74415 0 0 1 2 107 wood vm sl NULLSLV 24 0 4 1 31641 1074 0 0 2 0 107 nlpi Im wl NULLSLV 10 0 1 1 08867 0 0 2 1 1078 nlp2 lm wl NULLSLV 6 0 1 3 00000 12 107 2 0 107 nlp3 Im wl NULLSLV 7 0 1 4 89898 4 0 1075 17 107 nlp4 lm wl NULLSLV 5 0 1 2 22222 83 107 5 3 1077 stpi lm wl RKF45S 3 0 2 0 164300 4 4 1075 1 6 10 6 stp2a vm sl RKF45S 7 1 3 0 761594 6 5 1072 21 1074 stp2b vm sl RKF45S 4 0 9 0 924234 2 0 107 2 1 107 stp2c vm sl RKF45S 4 0 9 0 901436 7 8 107 7410 4 stp2d vm sl RKF45S 5 1 1 0 776545 13 107 2 7 1074 stp2e vmysl RKF45S 4 0 9 0 924234 210 931974 stp3 vm l RKF45S 13 2 8 0 180033 4 0 107 333 1071 stp4a vm sl DAESOL 17 40 7 0 180033 1 10 2 3 10 stp4b vm sl DAESOL 21 48 5 0 180033 9 8 1079 4 1 10 4 qlin vm sl RKF45S 16 4 2 1 11600 4 0 1077 1 1 1074 tolini vm s RKF45S 23 10 3 75 0004 1 7 107 9 3 10 9 tolin2 vm sl RKF45S 8 2 0 74 9081 12 1075 16 107 ftlosi vm sl RKF45S 5 5 5 1 01930 1 6 1077 1 1 1075 ftlos2 fd bt RKF45S 6 10 0 1
2. 8 7 Termination Check for the SQP Algorithms 8 8 Graphical Visualization of the Results 8 9 Restrictions in the Choice of Modules 9 MUSCOD II output 9 1 TernunatON AA ds rr AAA s e ak eS od ee eee OR ACE Rd EO ERE X RUE RS 9 4 Matlab Logging 10 Interactive MUSCOD II TEMPE A NN S ENS lt lt lt lt 42 2 Win XP 3 Example ODE Test Problem reentry 14 Example MS MINTOC Problem lotka 15 Appendix A MUSCOD II test library 15 1 List of all Testproblems s ca ada a 15 2 List of solution characteristics 15 3 Further description of some of the problems 48 48 49 50 50 52 53 54 54 59 56 57 63 66 1 Introduction MUSCOD II is a robust and efficient optimization tool that allows to quickly implement and solve very general optimal control problems in differential algebraic equations DAE The manual is organized as follows l 2 In Section 2 we present class of problems which can be solved already introducing the problem syntax used in MUSCOD II In Section 3 a brief introduction to the solution algorithm the direct multiple shooting method is given Some understanding of the underlying method helps in learning the specific way of formulating problems for MUSCOD II The installation
3. static void ffcn double t double xd double xa double xu double p double rhs double rwh long iwh long x info E double rho RHO_0xexp BETA R xd 2 double cw 1 174 0 9 cos u 0 double ca 0 6 sin u 0 rhs 0 0 5 SM rhox xd 0 xa 0 cw G sin xd 1 1 04 xd 2 1 0 xd 2 rhs 1 0 5 SM rhoxxd 0 ca xd 0 cos xd 1 R 1 04 xd 2 G cos xd 1 xd 0 1 0 xd 2 1 0 xd 2 rhs 2 xd 0 sin xd 1 R static void rdfcn_s double ts double xsd double sa double xu double p double x pr double res long dpnd long xinfo if dpnd dpnd RFCN DPND 0 sd 0 0 0 0 return res 0 sd 0 0 36 res 1 sd 1 8 1 PI 180 0 res 2 sd 2 4 0 R 7 static void rdfcn_e double ts double sd double sa double xu double p double x pr double res long dpnd long xinfo 1 if dpnd 1 dpnd RFCNDPND 0 sd 0 0 0 0 return res 0 sd 0 0 27 tes ti sd 1 res 2 sd 2 2 5 R j extern C void def model void def_mdims NMOS NP NRC NRCE def_mstage 0 NXD NXA NU NULL lfcn 0 0 0 NULL ffen NULL NULL NULL def_mpc 0 Start_Point NPR NRD S NRDE_S rdfcn s NULL def mpc 0 End Point NPR NRD E NRDE_E rdfcn e NULL j 63 Listing 2 reentry dat MUSCOD II Apps TEST DAT reentry dat c Daniel B Leineweber 1995 reentry of spacecraft Boc
4. 7 Create the file profile and type the following lines export PGPLOT DIR c Programme GrWin pgplot export PGPLOT FONTS c Programme GrWin pgplot grfont dat export PGPLOT_RGB c Programme GrWin pgplot rgb txt Leave the editor again Apply the changes by typing source profile 61 8 If you checked out the MUSCOD II test projects change to the MUSCOD II test projects folder by typing cd MC2 TEST Make the MUSCOD IT test projects by typing make Again this may take some time 9 The installation process is now complete and MUSCOD II should be at your services 62 13 Example ODE Test Problem reentry Listing 1 reentry source file gt MUSCOD II Apps TEST SRC reentry cpp c Daniel B Leineweber 1995 gt reentry of Apollo type vehicle Plitt 1981 Stoer Bulirsch 1992 gt Id reentry cpp 3369 2009 07 14 09 10 40Z chris include lt cmath gt include def_usrmod hpp define NMOS define NP define NRC define NRCE define NXD define NXA define NU define NPR define NRD S define NRDE S define NRDE define NRDE E WwwWwwworowoodr define PI 3 1415 define BETA 4 26 define G 3 2172E 4 define R 209 0 define SM 53200 0 define RHO 0 2 704E 3 static void lfcn double t double xd double xa double xu double p double lval double rwh long iwh long xinfo lval 10 0 xd 0 xd 0 xd 0 sqrt RHO 0xexp BETA R xd 2
5. control slope start values scale factors and bounds DVec relevant only if u_type is 3 and 4 defaults all elements udot udot sca udot min and udot_max set to values 0 0 1 0 100 0 and 100 0 respectively uedot uedot_sca uedot min uedot_max end of model stage control slope start values scale factors and bounds DVec relevant only if u_type is 3 default same values as at previous multiple shooting point pr pr_sca pr min pr max local interior point constraint parameter start values scale factors and bounds DVec pr_fix local i p c parameter fixed value flags LVec if pr_fix i is 1 parameter pr i is fixed at its start value default no local i p c parameters fixed g_sca algebraic right hand side scale factors DVec rd_sca decoupled i p c scale factors DVec rc_sca coupled i p c scale factors DVec of sca of min of max objective scale and expected range double 7 2 1 Keywords for Robust Optimal Control Some additional keywords allow to automatically create a robustified version of an optimal con trol problem For theory and algorithms and to understand the implications of the approximate linearization robustification approach used in MUSCOD II please refer to DBKO6 rob 800 rob p Select the initial values and model parameters that are considered uncertain Set a 1 for each uncer
6. eason This is an example for unconstrained minimization namely Eason s function Reklaitis G V Ravindran A Ragsdell K M Engineering Optimization Methods and Applica tions 1983 dcbatl Discrete charge batch reactor I 2 charges Vassiliadis V S Pantelides C C Sargent W H Optimization of discrete charge batch reactors Comput Chem Engng 18 Suppl p 415 419 1994 dcbat2 discrete charge batch reactor II 5 charges Vassiliadis V S Pantelides C C Sargent W H Optimization of discrete charge batch reactors Comput Chem Engng 18 Suppl p 415 419 1994 dcbat3 discrete charge batch reactor III 10 charges Vassiliadis V S Pantelides C C Sargent W H Optimization of discrete charge batch reactors Comput Chem Engng 18 Suppl p 415 419 1994 energy 77 Energy Problem given in Bryson A E and Ho Y C Applied Optimal Control Hemi sphere Washington D C 1976 1 min 0 5 y a t dt lt a t l constant x 0 0 20 LCD EO 1 1 Formulation0 by setting zo x 1 2 0 5 J a t dt min 152 s t Xo 22 di a o 0 5 a Zo t lt l constant xo 0 0 x1 0 gt 1 12 0 zo 1 2 0 a1 1 1 Formulationl by setting x0 11 1 1 min 0 5 J a t dt s t x0 x2 71 x a xO t lt l constant x0 0 0 71 0 1 20 1 0 z1 1 1 eocarl Energy optimal car I eocar2 Energy opt
7. libmintoc mintoc SOR kck kok bk okok ok oko ook AC GR Rk ak ok ok ok Setting algorithmic parameters DK I II Ik II I k K k K k K K K K k ake ake k K options_acc 16 6 options ftol 1 0 options_itol 1 0 options rfac 0 0 options_levmar 0 0 options_qp featol 1 0e 8 options qp relax 1 1 options nhtopy 0 options frstart 0 options frmax 0 options itmax 100 options plevel screen 0 options plevel file 1 options_plevel_matlab 0 options bflag 1 options_qp itmax 10000 options_qp expand 99999999 options sflag 0 options wflag 0 options cflag 0 options output ps 0 options output gif 0 15 Appendix A MUSCOD II test library This section gives an overview over the testproblems in the software MUSCOD that can be found in Apps Test Src Note that some of the literature is no longer available and that description solution characteristics or literature do not exist for all problems 15 1 List of all Testproblems academy batchdist batchdistrob batchdistRobEx batchdistUT brac brerl brgr2 ccbat ccrane chainld chain container_bridge cstr cstr est dcbat1 dcbat2 dcbat3 eason energy f77 eocar1 eocar2 extrosen fedbat1 fedbat1m fedbat2 fedbat2m fedbat3 fedbat3m fedbat4 freudenstein ftlos1 ftlos2 ftlos2 nlp ftlos3 ftlos4 hang helical hydroscal inventory 77 kite Ibat macrol macro2 macro3 macro4 macro5 maratos nlbat nlp1 nlp2 nlp3 nlp4 nmpcl oceanda ocean3b optcar_lego orbit oven
8. COD User Manual MUSCOD II Release 6 0 Christian Hoffmann Christian Kirches Andreas Potschka Sebastian Sager Leonard Wirsching based on the previous version by Moritz Diehl Daniel B Leineweber Andreas A S Schafer Simulation amp Optimization Group Hans Georg Bock and Johannes P Schl der Interdisciplinary Center for Scientific Computing IWR University of Heidelberg Germany March 28 2011 Contents 4 4 TP LT 5 22 Interior Point and Path Constraints 5 Er uc 6 eins e da dd OS 6 3 The Direct Multiple Shooting Method 7 Aa A e DS e A 7 nidum IE 8 IE 8 Lua AA EH E ES 10 ID e 10 44 A ee ee ee 11 4 The software package MUSCOD II 12 4 1 Installation Steps for a UNIX Linux System 13 O ee ee 18 gig ahs A ee 20 Lk Gah kak oy e E oH ASR edt fd 20 21 5 1 Running an existing problem from the test set 21 AA E A Ad a e 21 22 22 bos ded eo dedos e 25 27 7 1 Data and the DAT Eilei 28 O 30 34 yw eee A A 35 LEA A 37 E EE E EE ee ees ee es ee 37 TE The Command gel Aa ere ee Y AR RA ue G 38 41 AA A A a a a se 42 NE AO EE AA A a ABA 42 a da e A 43 8 4 GlobalizationStrategy 8 5 Condensing of the Block Sparse OP 8 6 solution of ihe Condensed OP
9. Plot of the resulting paths can be obtained by calling gnuplot in the RES directory and typing plot optcar lego gnuplot using 2 3 w lines orbit 2d orbit transfer 80 qlin Quadratic linear problem Betts J T Eldersveld S K Huffman W P Sparse nonlinear programming test problems Release 1 0 Technical Report BCSTECH 93 047 Boeing Computer Services 1993 pbreac Packed bed reactor optimization problem case Ia Cuthrell J E Biegler L T On the optimization of differential algebraic process systems AIChE J 33 p 1257 1270 1987 reactdiff Constrained PDE minimization example Finite Difference Discretization of elliptic PDE in 2 D on unit square 0 d u dx au bq with bound restrictions 0 lt u lt 1 0 lt q lt 1 u corresponds to a the concentration of a species that 1 diffuses 2 reacts with second order and 3 is added with distributed controls q reentry Reentry of Apollo type vehicle Bock H G Plitt K J A multiple shooting algorithm for direct solution of optimal control problems Proceedings of the 9th IFAC World Congress Budapest 1984 Stoer J Bulirsch R Introduction to Numerical Analysis New York 1992 rob2link Two link robot model without joint flexibility Time optimal movement rob2link flex Two link robot model with joint flexibility Time optimal movement with least squares penalty on accelerations rob3link Three link robot model without joint
10. 0 0001 Multiplier of penalty parameter 2 5 Penalty tolerance 0 0001 Penalty integer tolerance 1e 08 Penalty convergence tolerance 1e 06 Number of QP iterations in Penalty strategy 100 Maximum number of iterations in Penalty strategy 50 Maximum number of iterations before stuck in Penalty strat egy 20 Adaptparam parameters minstagelength numadaptiters adaptmode adaptPenStart adaptPenIter Minimum length of stages 1e 05 Number of successive adaptations 1 Adaptmode 0 bisection 1 middle peak 2 adaptive 0 Start of Penalty after adaptivity 5 What was this again 0 5 General parameters tolZero simIndex maxIterationsForConvergence restart s spec plotAlgorithmicData milp_solver Zero tolerance 1e 06 Index of control to be used for simulation internal 7 Maximum number of iterations for NO restart in solution 6 What s spec for restarts 2 Open additional plot window 0 Name of callable by AMPL MILP solver cbc Rounding parameters roundOffset simulateOnly roundedEmbedding Offset that has been added to u max to avoid cycling 0 What after rounding 0 Optimize 1 Simulate only 0 Rounding 1 fix only bounds 0 set also variable value 0 Sequential parameters seq ptFreq Frequency of re optimization on shrinking horizon in mode 86 1 Integral Approximation u_switch_max imos Vector of maximum number of switches of binary control
11. and can hence reside in the suite in parallel This script extensively uses resources from folder AuxScripts The whole installation procedure is described below cleanup Removes the binary directories of a selected build type from all packages in the suite This is essentially a make clean for the whole suite and reverts the actions of bootstrap Note currently only packages built using CMake as install tool are affected which are essentially all packages developed by the SimOpt group Binaries from third party packages currently have to be removed manually When using the C option it only removes the CMake cache of all packages using CMake effectively re setting all CMake options to their default values 4 1 5 Technical Stuff The repository physically only contains the scripts Packages belonging to the suite are linked via Subversion s externals mechanism On checkout update or export subversion recursively checks out or updates the suite itself and all referenced packages and applications If you have a revision controlled working copy of the suite you can query the current list of references with user machine MUSCOD_SUITE gt svn propget svn externals Lines in the output that start with a are commented out 4 1 6 Installation The MUSCOD II suite should be easily installed by checking it out from the Subversion repos itory and running the bootstrap script 15 Prerequisites MUSCOD II uses many different software packa
12. by rel times the amount of infeasibility to make the next QP guaranteedly feasible Example qp relax1 1 default plotadjoints Opens an additional output window in which the adjoint trajectories of the ODE are drawn lagmulregreg Regularization of the multipliers resulting from solution of the condensed QP Applies a singular value decomposition to the matrix of active constraints and determines the multipliers with minimum 5 norm from the set of multipliers satisfying stationarity This helps for convergence problems that are caused by LICQ violation The parameter reg gives the cutoff threshold for the smallest accepted singular value Setting reg to zero disables this feature default Example lagmulregie 08 8 Dynamically Loadable Modules MUSCOD II incorporates a variety of different algorithms as a combination of different dy namically loadable libraries The choice between these libraries is performed on three levels A default values that are overridden by settings in the DAT file of the problem Section which in turn can be overridden by command line options The shared object files dynamic link libraries are loaded on startup of MUSCOD II 8 1 SQP Algorithms For overall control of SQP solution process the following shared objects are provided 8 2 mssqp standard The standard multiple shooting SQP algorithm mssqp nmpc gn Nonlinear model predictive control with a Gauf Newton approximation of the He
13. or Release in the case of a compilation with high compiler optimization and no debug information The bootstrap script creates these directories automatically as described below The subdirectories of MUSCOD_SUITE MC2 Src encapsulate different modules of MUSCOD II which are explained in section 4 2 1 The applications subdirectories e g MUSCOD_SUITE Apps TEST have the following structure e Src Source directory including problem dependent configuration files program code and problem description data 14 SRC Subdirectory containing program code DAT Subdirectory containing problem description data e Debug Release Binary directories containing compiled libraries DAT Subdirectory containing problem description data usually a symbolic link to Src DAT RES Subdirectory where the results of computations are stored 4 1 4 Functionality The suite comes with some bash scripts which automate common tasks All scripts that are usually invoked by the user are located in the suite root folder and have executable file permis sions All scripts provide usage information if invoked with the help command line option Here is a brief overview bootstrap Configures and installs all packages of the MUSCOD II suite and some applications Installations with different build types Debug Release etc are supported The binaries of each build type have their own directories with the same names as the build type
14. 00174 2 4 1071 2 5 1074 ftlos3 fd bt RKF45S 6 12 0 1 00174 7 4 1071 43 107 ftlos4 ch sl RKF45S 3 1 5 1 22742 107 1 6 1077 7 8 1075 tolosi Im wl RKF45S 20 19 9 4 23085 2 8 1079 2 5 107 tolos2 fd bt RKF45S 8 19 9 4 20162 84 1071 4 6 10 4 tolos3 fd bt RKF45S 8 16 1 4 20162 3 5 1077 10 107 tolos4 chsl RKF45S 5 5 0 3 82753 10777 8 8 10 2 6 107 Figure 4 Table 3 List of Test Problems name mc2 int itr cpu obj inf brac vmsl RKF458 15 3 1 0 312480 1 7 107 vdpol vm sl RKF458 5 1 2 1 68570 2 1 1078 eocari vm sl RKF45S 4 1 0 36 7270 2 4102 eocar2 fd bt RKF45S 7 2 1 36 7236 1 2 101 tocari lm wl RKF45S 6 0 7 30 1511 6 6 10 6 tocar2 lm wl RKF458 5 0 3 30 0000 1 0 10775 tocar3 lm wl RKF458 5 0 4 30 0000 1 0 105 reentry fd bt RKF23S 9 22 9 2 78268 107 6 4 107 hang Im wl RKF458 45 36 9 1247 66 6 7 107 unloadi fd bt RKF45S 4 5 9 7 74987 2 9 1077 unload2 fd bt RKF45S 6 7 3 7 74987 T7 N o ka ccrane Im wl RKF45S 15 6 5 5 34569 107 2 0 107 lbat lm wl RKF458 15 2 9 0 573527 12 1077 nlbat Im wl RKF45S 18 3 9 0 610797 5 2 1077 dcbati Im wl RKF458 15 1 8 0 447512 9 7 1077 dcbat2 fd bt RKF45S 6 5 1 0 447620 7 3 1078 dcbat3 fd bt RKF45S 9 18 5 0 489546 8 8 107 ccbat
15. 6 Table 8 List of MS MINTOC specific options The key word in the leftmost column is prece dented by mintoc in the dat files 11 4 Switching Time Optimization The optimization of switching times within MS MINTOC is implemented as a reformulation towards a multiple model stage problem with model stage lengths subject to optimization Obviously the model description provided by the def model routine needs to be adjusted 56 The number of model stages will depend on the algorithm that has been applied To be as flexible as possible and to allow e g both fixed and free end time formulations of the original problem a user specific formulation in the form def model ct is necessary ct for continuous time However MS MINTOC supplies information on the number of introduced model stages at runtime allowing for usage of def model ct both within the first run and from scratch with an automatically written dat file DAT name ct dat The callback function getNmos NMOS takes the original number NMOS as an argument and returns a LVec with the dimension NMOS and the number of introduced stages per original stage The last entry V EACC newnmos NMOS contains the overall new number of model stages The usage is best exemplified by an easy example see Section 12 Win XP 12 0 4 Requirements Administrator Rights The installation process will require you to hold administrator s rights WinZip In order to uncompress tar g
16. BFD 97 I Bauer F Finocchi W J Duschl H P Gail and J P Schl der Simulation of chemical reactions and dust destruction in protoplanetary accretion discs Astron Astrophys 317 273 289 1997 85 BP84 CS85 DBK06 DCDH90 DCHHSS DR96 GMSW83 Lei99 LHKK79 LJ96 Pea97 RD93 Rei72 H G Bock and K J Plitt A multiple shooting algorithm for direct solution of optimal control problems In Proceedings 9th IFAC World Congress Budapest pages 243 247 Pergamon Press 1984 M Caracotsios and W E Stewart Sensitivity analysis of initial value problems with mixed odes and algebraic equations Computers and Chemical Engineering 9 359 365 1985 M Diehl H G Bock and E Kostina An approximation technique for robust nonlinear optimization Mathematical Programming 107 213 230 2006 J J Dongarra J Du Croz I Duff and S Hammarling A set of level 3 basic linear algebra subprograms ACM Trans on Math Soft 16 1 1 28 1990 J J Dongarra J Du Croz S Hammarling and R Hanson An extended set of fortran basic linear algebra subprograms ACM Trans on Math Soft 14 1 1 32 1988 LS Duff and J K Reid The design of MA48 A code for the direct solution of sparse unsymmetric linear systems of equations ACM Trans om Math Soft 22 187 226 1996 P E Gill W Murray M A Saunders and M H Wright User s guide for SOL QPSOL a Fortran package for quadratic
17. Im wl RKF45S 22 4 0 0 499074 1 2 107 twobati fd bt RKF458 10 10 2 25 5913 9 7 10 twobat2 fd bt RKF458 9 4 9 25 5913 14 10 fedbati Im wl DDASAC 19 35 9 87 8751 6 2 10 fedbat2 lm wl DDASAC 34 55 3 87 9211 6 4 10 fedbat2m Im wl DDASAC 21 32 2 0 916841 2 8 1075 fedbat3 Im wl DDASAC 24 38 4 89 8542 1 7 1076 fedbat3m lm wl DDASAC 11 19 2 0 934468 2 9 107 fedbat4 lm wl DDASAC 29 50 4 120 549 2 6 1075 pbreac fd bt RKF23S 22 28 1 171 486 2 9 1075 Figure 5 Table 4 List of Test Problems 73 15 3 Further description of some of the problems academy This is a model of G Feichtinger and coworkers The idea is to optimize the recruitment strategy of an Academy of Sciences that aims at keeping the average age of the academy down maximizing the number of recruitments The size of the academy is fixed to 70 persons Only persons between 40 and 70 are counted as members The ratio between the two goals is given by the parameters p 2 and p 5 The optimal control is given by the control constraint rdfen otherwise full recruitment of young resp very old researchers is optimal batchdistUT This model uses the Unscented Transform to obtain mean and variance of the inequality constraint functions and optimizes then with a security back off It can also be used for simple dat
18. NN 16 wes 00 00 00 00 00 OO 1 neq uin DOS egt Y dy la Es 6 gt Nee Se Figure 2 Table 1 List of Test Problems 71 name M ng n n nm n ndis nvar neq nin brac 1 3 1 1 21 104 83 208 vdpol 1 2 1 21 82 62 164 eocari 1 2 1 21 82 63 164 eocar2 3 2 1 37 11 45 34 90 tocarl 1 2 1 Pto TA 34 24 68 tocar2 2 2 1 2 11 25 24 50 tocar3 2 2 1 1 2 1 35 24 70 reentry 1 3 1 1 7 34 29 68 hang 1 4 1 1 20 157 119 314 unloadi 1 6 2 1 13 115 95 230 unload2 2 6 2 2 13 116 95 232 ccrane 1 6 2 21 16 182 334 lbat 1 2 1 21 82 61 164 nlbat 1 2 1 21 82 61 164 dcbati 3 5 1 2 12 73 60 146 dcbat2 9 5 1 5 15 94 75 188 dcbat3 19 5 1 10 20 129 100 258 ccbat 1 5 1 1 11 76 65 152 twobati 3 6 1 de 12 8 58 48 118 twobat2 3 3314 1 1 2 8 34 26 70 fedbati 3 4 1 3 23 117 98 234 fedbat2 1 4 1 1 21 105 84 210 fedbat2m 1 4 1 1 21 105 84 210 fedbat3 1 4 1 1 21 105 84 210 fedbat3m 1 4 1 1 21 105 84 210 fedbat4 1 4 1 1 21 105 84 210 pbreac 1 2 3 1 1 26 23 53 Figure 3 Table 2 List of Test Problems 12
19. QPSOL QPOPT OOQP and BQPD SOLVE Globalization of the MSSQP step Holds line search trust region and watchdog approaches TCHK Termination Checks for the MSSQP algorithms Besides those algorithmic parts a number of subdirectories hold integral parts of MUSCOD II that are always present ADCAUX ADOL C auxiliary functions for computation of derivatives of model functions DOC Holds the TEX source code of this documentation 18 INCLUDE Holds C header files for all algorithmic parts INOUT Input and Output of MUSCOD II data structures Ultimately responsible for load ing the DAT file LINALG Selected linear algebra routines from the HSL archive used by PRSQP and some of the integrators found in IND MAIN Different flavors of the main executable of MUSCOD II Currently maintained is main dynamic cpp only MINTOC Mixed Integer Optimal Control package see section MODEL Description of the optimization problem NMPC Nonlinear Model Predictive Control PDAUX Problem Data Auxiliary functions PRSQP Partially Reduced Sequential Quadratic Programming for optimizationm problems with DAE models Comes in two flavors A sparse variant using HSL MA48 and a dense variant using LAPACK SCALE Scaling of problem variables TD12AUX Support for approximation of sparse jacobians using finite differences and CPR seed matrix compression uses HSL archive routine TD12 UTIL Utility functions for MUSCOD II for things like error h
20. acc PVars Defaults to 0 0 The value can be overridden on the command line using the r option options levmar Sets the Levenberg Maquardt regularization factor A for the Hessian Use this to add A Id onto a Gauf Newton approximation of the Hessian matrix Defaults to 0 0 The value can be overridden on the command line using the 1 option options qp featol Sets the feasibility tolerance of the QP solver QPOPT Defaults to 107 The value can be overridden on the command line using the qp featol option options qp relax Sets the constraint relaxation factor for infeasible QPs When an infeasible QP is detected all infeasible constraints are shifted by rel times the amount of infeasibility 35 to make the next QP guaranteedly feasible Defaults to 1 1 Useful values are greater than 1 0 The value can be overridden on the command line using the qp relax option options nhtopy Allows to employ a homotopy strategy beginning with a lower initial integra tion tolerance tol and thus faster SQP iterations set via options itol the current inte gration tolerance ctol is tightened until after nhtopy steps ftol set via options ftol is attained The steps in ctol interpolate logarithmically between itol and ftol A homo topy step is performed during the SQP iterations whenever the current accuracy cacc is attained It is determined as cacc ctol acc ftol By default no homotopy is employed The value can be overridden on the
21. algorithmic parts of MUSCOD II Some subdirectories offer alternative source files that are compiled into different flavors of the same algorithm COND Condensing of the block sparse multiple shooting QP into a dense unstructured QP Comes in two flavors Standard condensing and minimal condensing The latter only deals with the control discretization and with separability of global optimization variables such as model parameters but does not do any condensing EVAL Evaluation of all model functions and computation of derivatives using finite difference approximation HESS Computation of the Hessian of the Lagrangian of the multiple shooting NLP Comes in various flavors Constant hessian Gauf Newton approximation BFGS approximation limited memory BFGS approximation and exact Hessian using finite difference stars IND Internal Numerical Differentiation Holds a broad selection of integrators for the solution of ODE DAE system with various properties all equipped with internal numerical differenti ation MSSQP Multiple Shooting Sequential Quadratic Programming PLOT Plotting Visualization of state trajectories control profiles and the history of objec tive function values model parameters and stage lengths using different backends Currently implemented are PGPLOT Matlab and no plotting QPS Quadratic Programming Solution of the condensed quadratic programs using a broad range of commercial and open source QP solvers such as
22. computed using finite differences does not need to be positive definite so that you have to use a trust region strategy gt Use solve 1001 if you use hess_finitediff e If your model uses a continuous least squares objective CLSQ you must use an ODE DAE solver that is capable of evaluating it Use ind daesol ind rkf45adj or ind rkf45swt if you use CLSQ e If you use the sparse interior point QP solver OOQP performance is usually improved by leaving out condensing Try using cond min if you use qps ooqp AT 9 MUSCOD II output MUSCOD II provides information on algorithmic settings on convergence behavior and the results on different levels described in the following subsections An additional possibility to obtain information at runtime is to use the interactive version of MUSCOD II see Section 10 9 1 Terminal Output The terminal output of MUSCOD II will start with some general information on the chosen algorithmic settings the current version of the software and problem dimensions Then SQP iterations are described e g gt gt gt gt SQP iterations it qp qptol aset kkttol sobj Isinf vstepl vstpr mulstpl llgrdl alpha merit 0 9 402310 1 48E 05 1 42 1 48E 07 NEW 8 78E 02 29 314528 2 49E 04 2 96E 01 0 00E 0 1 18E 01 1 000000E 00 1 00 9 315597 2 5 2 49E 06 NEW 9 08E 01 8 406353 2 53E 02 3 03E 00 0 00E 0 2 99E 00 3 010900E 01 1 00 8 521348 3 33 1 00E 04 NEW 1 33E 00 7 078570 5 95E 02 4 0
23. directory The user has to provide the model source file and the data file say lt problem gt cpp and lt problem gt dat a detailed description of the structure of these files is given below The files have to be treated as follows e The model source file lt problem gt cpp has to be added to the TEST Src SRC direc tory Then edit the CMakeLists txt in this directory Search for the first occur rence of the CMake variable TEST_LIBS in CMakeLists txt This should be looking 21 like SET TEST LIBS followed by a long list of names Add the name of your source file i e lt problem gt to the list Take care that you put the name before the end of the list the right parenthesis and that you skip the file extension cpp Save your changes to CMakeLists txt e The data file lt problem gt dat has to be added to the TEST Src DAT directory In the desired binary directory say MUSCOD SUITE Apps TEST Debug run make The make process deals automatically with the changes in CMakeLists txt by calling CMake before starting the build After a successful build one may execute the problem as described above 6 The Model Source File In the model source file the dynamical model equations the constraints and the objective functions of the optimization problem are defined Furthermore the user has to provide a function for the setup of the optimization problem It is highly recommended for the unversed user to use an existing model sour
24. file controlled simulation runs This version is active at the moment brac Classical brachistochrone problem Betts J T Eldersveld S K Huffman W P Sparse nonlinear programming test problems Release 1 0 Technical Report BCSTECH 93 047 Boeing Computer Services 1993 brgrl Burgers equation for EPS B 1 0E 1 Betts J T Eldersveld S K Huffman W P Sparse nonlinear programming test problems Release 1 0 Technical Report BCSTECH 93 047 Boeing Computer Services 1993 brgr2 Burgers equation for EPS B 5 0E 2 Betts J T Eldersveld S K Huffman W P Sparse nonlinear programming test problems Release 1 0 Technical Report BCSTECH 93 047 Boeing Computer Services 1993 ccbat Continuous charge batch reactor Vassiliadis V S Pantelides C C Sargent W H Op timization of discrete charge batch reactors Comput Chem Engng 18 Suppl p 415 419 1994 ccrane Container crane Goh C J Teo K L Control parametrization a unified approach to optimal control problems with general constraints Automatica 24 p 3 18 1988 cstr constrained stirred tank reactor Model Equations according to Chen H Kremling A and Allgwer F Nonlinear pre dictive control of a benchmark CSTR Proc 3rd European Control Conference ECC 95 pp 3247 3252 1995 4 see also Diehl M Real Time optimization for large scale nonlinear processes Ph D thesis Heidelberg University 2001 p 12 ff
25. filename col row mat std rseq or cseq Scaled or unscaled output Set tolerance for constraint violation dd dumpDers Dump derivatives to Matlab file pd printDers Print nonzero objective derivatives pcd printConDers Print nonzero constraint derivatives pf printFuns Print objective and constraint function values pmc printMatch Print matching conditions pm printMults Print all multipliers ps printSens Print nonzero Wronskian sensitivities scaled pv printVars Print all variables pvc printVConst Print all violated constraints save saveBin Store current variables and Hessian in binary file pfp printFixedPars Print fixed global parameter values eval evaluate Reevaluate functions and gradients necessary after change of parameters sfp Set fixed parameter to new value needs 2 arguments index and new value uif userInteract Call def uif function ph printHess Print Hessian matrix kkt pkkt Print details about KKT tolerance papd printQPData Print QP data hessian gradient constraint matrix vector lower upper bound vector pqps printQPSol Print QP solution step constraint multipliers bound multi pliers dgp dumpQP Dump QP data and solution to matlab file Table 6 Interactive mode commands 11 MS MINTOC MS MINTOC is an extension of MUSCOD II written by Sebastian Sager to incorporate
26. flexibility Time optimal movement 6 state variables r 01 02 T 01 02 3 controls U Ue Ue u 0 u 1 u 2 rob3link flex Three link robot model with joint flexibility Time optimal movement 12 state variables T 0 05 Q 2 03 ES 01 05 Q 2 03 3 controls Up Uo Ue ul uft u 2 81 e rocket f77 min T 5 v C1 a Cw m cga with a lt 1 s 0 0 v 0 0 m 0 1 e rosen Unconstrained minimization example Rosenbrock s function Gill P E Murray W Wright M H Practical Optimization London et al 2006 e singular Unconstrained minimization example Powell s singular function Powell An iterative method for finding stationary values of a function of several variables Comput J 5 1962 e smb Model of a Simplified SMB process e stpl Simple test problem 1 Steinbach M C Fast recursive SQP methods for large scale optimal control problems PhD thesis University of Heidelberg 1995 e stp2a Simple test problem IIa Goh C J Teo K L Control parametrization a unified ap proach to optimal control problems with general constraints Automatica 24 p 3 18 1988 e stp2b Simple test problem IIb Goh C J Teo K L Control parametrization a unified ap proach to optimal control problems with general constraints Automatica 24 p 3 18 1988 e stp2c Simple test problem IIc Goh C J Teo K L Control parametrization a unified ap proach to
27. function in the line search function to enforce descent of the line search function The value MAX_ALPHA holds the maximum step length and defaults to 1 0 8 5 Condensing of the Block Sparse QP For the condensing of the block sparse multiple shooting QP the following shared objects are provided e cond_std The standard condensing algorithm reduces the large amount of independent variables of the multiple shooting method by exploiting the linearized continuity condi tions Only the condensed quadratic program is then solved by a dense QP solver e cond min The minimal condensing algorithm is normally not used It only cares about the control discretization and a separabile formulation for the global unknowns It does not eliminate state variables using the linearized continuity conditions This variant may be useful in conjunction with a sparse QP solver such as OOQP which is able to exploit the sparsity in the uncondensed QP For dense QP solvers the majority of supported QP codes using this variant will result in inferior performance e For expert users By manually changing the source code the following alternatives may be realized You have the option to truncate the step to avoid violation of bounds via the flag TRUNC STP inactive by default This may be advantageous if no feasible QP solution was available only a relaxed one and bounds should be given priority over linearized continuity conditions Not all
28. not included and has to be separately licensed and obtained from the University of Dundee qps old qpopt is an interface to the QP solver QPOPT Fortran version 1 0 9 part of the NAG library The interface is deprecated it is recommended to use the qps_qpopt instead qps old qpsol is an interface to the QP solver QPSOL now superseeded by QPOPT part of the NAG library The interface is deprecated it is recommended to use the qps qpopt instead qps old 1ssol is an interface to the linear least squares solver LSSOL part of the NAG library Using this solver is recommeded for QPs which have only few active constraints in the solution The interface is experimental The solvers ve02 and ve17 available in older releases of MUSCOD II have been removed as these codes are nowadays considered obsolete For expert users By manually changing the source code the following alternatives may be realized The active set is stabilized by setting the flag ACTSTAB default active that introduces a relaxed tolerance for previously inactive constraints The QPOPT solver writes a file gpopt tzt providing detailed information about the QP solution process if you set msglul to one of the values 5 10 20 or 30 in the file qps qpopt neu cpp The options BIGBND and BIGSTP define the magnitudes of bounds or steps that are considered infinite The default values are 109 and it may be necessary to rise them to 1019 for ill condition
29. pbreac powerkite qlin reactdiff reentry rob2link rob2link flex rob3link rob3link flex rocket 77 rosen singular skeleton smb Soccer stpl stpl gn stp2a stp2b stp2c stp2d stp2e stp3 stp3 77 stp3 gn stp4a stp4a gn stp4b swtball tocarl tocar2 tocar3 tolinl tolin2 tolos1 tolos2 tolos3 tolos4 twobatl twobat2 unload1 unload2 vdpol watson wood 15 2 List of solution characteristics The tables are taken from PhD thesis of D Leineweber 1999 They use the following symbols and abbreviations e name gives a mnemonic description of the test problem usually this is also the name of the corresponding model and data files e M denotes the total number of model stages each set of stage transition conditions if explicitly specified counts as an additional algebraic model stage e nj nz n are the numbers of differential states algebraic states and control functions specified separately for each model stage i if there are changes in the model dimensions e n and n are the numbers of the free model parameters and model stage durations n includes global as well as local model parameters 69 ndis denotes the total number of discretization points used i e the number of multiple shooting intervals plus one nvar is the total number of variables in the resulting structured NLP problem including all discretized state variables control parameters and free model parameters model stage durations neq and nin refer to the nu
30. pointed to by iswt Upon return of the function call res should have been filled with the requested switch function residuals swtexecfcn imos tau xd xa u p iswt rwh iwh info This function is called when an implicitly defined switch condition has been detected iswt is a long pointer to the index of the flipped switch while the meaning of all other parameters is identical to swtdtcfcn Upon return of the function the differential states xd should have been updated if desired The switching functions described above are assigned to the model stages by using the def swt function within the model definition function see below The ODE model s right hand side ffcn is provided with the current switch structure by way of the following mechanism that had to favour backward compatibility over clarity Although still declared a long the info pointer of ffcn no longer points to a single long integer value but may instead be safely typecast into a pointer to the structure rkfXXswt info t defined in MC2 IND RKFSWT ind rkfXXswt hpp with the following declaration typedef struct 1 long info return code as usual long swt sign structure of the NSWT switches on the stage rkfXXswt_info_t It is up to the model implementor to respect the swt vector within ffcn so as to evaluate the proper model Using this mechanism implicit discontinuities in the model s right hand side may be covered In order to cover discontinuities in
31. state bounds are given to the lower level QP solver only potentially active ones i e those that have previously been active are condensed and passed on By inactivating the flags SD BOUNDS and SA BOUNDS default active for differential and algebraic states the corresponding bounds are neglected and not even checked The flag RECALC_QP default active enforces a recalculation the QP problem in the same SQP iteration if the potentially active bounds have changed 8 6 Solution of the Condensed QP For the solution of the condensed QP the following shared objects are provided 45 qps qpopt is an interface to our in house C converted version of the QP solver QPOPT 1 0 10 by Gill Murray and Saunders This is by far the most important QP solver available The solver itself is included in Packages QPOPT and is licensed to IWR for academic purposes qps ooqp is an interface to the open source sparse interior point QP solver OOQP avail able from the COIN OR project web site It is up to now the only publicly available sparse QP solver interfaced with MUSCOD II and should be used in conjunction with the min imal condensing module cond min Using this solver inside an SQP algorithm is usually ineffective It has however been successfully used for highly sensitive multibody ODE systems in robotics for which con densing leads to ill conditioned QPs qps bqpd is an interface to the QP solver BQPD by R Fletcher The solver itself is
32. value x t 1 by the simple evaluation of a transition function c that may even change the differential state dimensions n5 is not necessarily equal to nz Usually the duration of a transition stage is set to zero i e tj41 tj The continuity condition after the transition stage 7 provides an initial value for the following model stage j 1 Ti ltj 1 Ci tj 25085 25085 p Here the transition function c has the same syntax as the right hand side function f 2 2 Interior Point and Path Constraints For all variables i e states controls parameters and durations upper and lower bounds can and in fact have to be given Additionally general decoupled constraint vector functions rf with dimension n74 can be specified that require at single points t t in time or on complete model stages i e Vielt t 1 s 5b 0 Please note that allowing the point control value u t to enter the transition function amounts to giving it the status of a parameter If algebraic variables z t are used on the transition stage they have to be defined by declaring an appropriate algebraic equation at time tj 0 gj tj 5 ti 25 ty uy ty p Note that a pointwise influence of the control values on the transition function as above can also occur indirectly via the algebraic states Here the first ni components are equalities and the remaining ones of altogether n in equ
33. 0 h sca 0 1 0 h min 0 3 0 h_max 0 12 0 model stage duration fixed value h fix 0 1 s_spec 2 differential state start values sd 0 0 0 0 5 0 7 2 0 0 sd_fix 0 0 0 1 tl 2 1 sd_sca x x 0 1 0 ES 6 2 1 0 sd min x 0 0 0 0 0 2 0 0 sd_max x 0 20 0 20 0 2 25 0 lotka dat file on each model stage scales bounds flags scales bounds objective scale of_sca 1 0 and expected range of min 0 0 of max 25 0 of name Quadratic deviation h_name 0 Zeit ParamB Force parameter eps u_name 0 Control function u t xd name 0 Biomass of Prey 1 Biomass of Predator 2 Integrated deviation nhist 30 u type 0 0 u sca 0 0 15 21 270 u 0 x 0 1 0 u_min 0 x 0 0 0 u max 0 On 1 0 FOG I kak K K MINTOC variables ak ok ok ok gt ok ok gt ok ok K K ak x 0 x 1 continuous binary integer x gt 1 SOS1 variable x 1 SOS1 variable int 0 1 x 1 with control n w Og o xx p int ALL 0 FA AO K K a kk MINTOC options 2K SK od OE ok OK 0 HH penalty term parameters Initialization eps init 0 0001 of penalty parameter Multiplier eps step 2 of penalty parameter Penalty tolerance penTolZero 0 001 Penalty tolerance penIntTol 1e 05 integer Penalty convergence tolerance penConTol 0 0001 Number of QP penNumQPSteps 1
34. 00 iterations in Penalty 67 eliminated strategy Maximum number of iterations penMaxSteps 20 in Penalty Maximum number of iterations before stuck in Penalty strategy penMaxStuck 30 HH adaptparam parameters Minimum length of stages minstagelength 0 0001 Number of numadaptiters successive adaptations strategy 3 Adaptmode O bisection 1 middle peak 2 adaptive adaptmode 0 Start of Penalty after adaptivity adaptPenStart 3 What was this again adaptPenlter 1 HH General parameters Zero tolerance tolZero 1e 05 Index of control to be used for simIndex ya Mazimum of how many iterations for NO restart in maxlterationsForConvergence 6 solution A What s spec restart s spec 2 for restarts HA Rounding parameters Offset that has been added to u max to avoid roundOffset 0 What after simulateOnly 0 rounding Rounding simulation internal cycling O Optimize 1 Simulate only 1 fix only bounds O set also variable value roundedEmbedding a Open additional plot window plotAlgorithmicData 1 FOI i Rk ak K k Choosing libraries DK ck sk ok ok ok oe ok oko 7 7 ok K K ke ee ibmodel SRC liblotka ibhessian hess_update libsolve solve slse ibcond cond std ibtchk tchk 68 libmssqp mssqp standard libeval eval_ind libind 0 ind rkf45 libqps qgps qpopt libplot plot pgplot
35. 47 p 851 864 1992 hang Hang glider problem Betts J T Eldersveld S K Huffman W P Sparse nonlinear programming test prob lems Release 1 0 Technical Report BCSTECH 93 047 Boeing Computer Services 1993 Bulirsch R Nerz E Pesch H J Stryk O von Combining Direct and Indirect Meth ods in Optimal Control Range Maximization of a Hang Glider in International Series of Numerical Mathematics Vol 111 1991 p 273 288 TT e helical A helical valley function See Fletcher Powell A rapidly convergent descent method for minimization Comput J 6 1963 e hydroscal Distillation model 82 diff 122 alg var For a description see e g Chapter 7 in the PhD thesis Real Time Optimization for Large Scale Nonlinear Processes 2001 by Moritz Diehl Download at http www ub uni heidelberg de archiv 1659 Optimization problem is to steer the column from a disturbed state back into the nominal operating point minimizing an integrated least squares deviation of two temperatures and the controls e inventory min de exp p2 ts a zd 0 exp po ts 00 u 0 exp pi ts b1 ul st u0 ul d o 51 lt an O lt u lt 0 lt ur 41 uot u lt 09 ZU uy AT rr discount rates p 0 1 yl 72 1 are unit cost of storage w r p p replenishment w r t ro0 and selling price with respect to rol respectively d own demand x is the stock fun
36. 64 for glnx86 Press c and g to configure and generate the Makefiles Leave the CMake GUI e Recompile COMMON CODE by calling user machine MUSCOD_SUITE Packages COMMON_CODE Debug gt make install e Call the CMake GUI in your MC2 binary directory user machine MUSCOD_SUITE MC2 Debug gt ccmake 51 e Enable the options MATLAB_SUPPORT e Press c and fill in the possibly missing Matlab libraries like above e Configure generate the Makefile leave the GUI and recompile MUSCOD II via user machine MUSCOD_SUITE MC2 Debug gt make install e Recompile your application e g by user machine MUSCOD_SUITE Apps TEST Debug gt make Using Matlab logging You can now have MUSCOD II data logged to a file RES problemname mat by via the pmatlab lt n gt option of the MUSCOD II executable The print level n currently knows two thresholds n 2 Log only primal and dual variables The Matlab file will contain a single hierarchical cell array called iterations which contains a struct for each iteration The struct consists of the substruct variables varstep varnew and mulnew corresponding to the step in the primal variables the updated primal variables and the updated dual variables respec tively The substructs are structs themselves E g varnew sd is a cell array containing the differential Multiple Shooting states To examine the differential state at the third shooting node attention counted from 1 accord
37. 8E 00 0 00E 0 1 47E 01 3 589541E 01 1 00 7 507059 The explanation of the columns is given in Table crit stat REL SUCC STD SUCC STD SUCC column description it Number of current SQP iteration qp Number of QP iterations needed qptol Tolerance given to the QP solver aset Has the active set changed compared to last SQP iteration kkttol Karush Kuhn Tucker Tolerance used for termination check sobj Objective function value sinf Norm of infeasibility Ivstepl Norm of variable step Ivstpr Norm of step in the primal variables mulstp Norm of step in the dual variables lgrd Norm of Lagrange gradient alpha Step length deduced by line search trad Trust region radius tact Is trust region bound active merit Value of merit function crit Relaxation of constraints STD or REL stat Status of iteration SUCC PEND or BACK Table 4 Columns in the terminal output of MUSCOD II Finally statistics on function evaluations and CPU time usage are displayed 48 9 2 Online Graphics MUSCOD II uses a powerful PLOT module that contains interfaces to different online graphic software Currently these are PGPLOT and MATLAB a CairoGraphics implementation is envis aged The plotting of differential and algebraic states of control functions and of parameters and objective function histories are controlled by setting appropriate names in the dat file Section
38. The PGPLOT visualization module plot_pgplot reads several options from the file default plot as detailed in table Options Possible Values Description Screen enabled on off Switch on screen visualization on or off Screen width double Screen width in inch pixels dpi Recommended values are 10 6 for 1024 pixels 13 3 for 1280 pixels 16 6 for 1600 pixels Screen aspect double Screen s aspect ratio height width Recommended values are 0 75 for a 4 3 screen 0 625 for a 16 10 widescreen screen hostname string PGPLOT X server host name e g j m iwr uni heidelberg de Screen display int X server display number usually 0 Screen screen int X server screen number usually 0 ps_enabled on off Switch generation of PostScript graphics on or off ps append file on off Whether to write all iterations figures into the same PostScript file on multiple pages ps_width double PostScript paper width in inches Recommended values are 7 5 for portrait 10 6 for landscape ps_aspect double PostScript paper aspect ratio Recommended values are 1 4142 for portrait 0 7071 for landscape ps_color on off Whether to generate a color or a grayscale PostScript file gif_enabled on off Switch generation of GIF graphics on or off gif_width double GIF file width in inches gif_aspect double GIF file aspect ratio Table 5 Options for the PGPLOT visualization module plo
39. USCOD II within a so called suite a structured collection of packages used in the context of MUSCOD II We highly recommend to use the suite when working with MUSCOD II Using a manual installation of all required packages is possible but requires expert knowledge and is likely to cause problems You have been warned 4 1 1 Overview The MUSCOD II Suite is a structured collection of software packages which are somehow related to MUSCOD II Major aims of this bundle are e reduce the effort required for setting up a MUSCOD II work environment to a minimum e simplify migrating MUSCOD II to new platforms and operating systems and e provide standardized environment for easy debugging 4 1 2 Getting it The MUSCOD II suite is checked in to SimOpt s Subversion revision control system The MUSCOD II suite repository has a sub folder for each target platform Currently only the Linux version is supported Like every Subversion repository the suite also comes in different flavors tags a collection of fixed versions that are not subject to change and trunk the 13 developers version unstable To check out a local working copy of MUSCOD II to your sys tem call name machine gt svn checkout https liz iwr uni heidelberg de MUSCOD muscod_suite linux lt flavor gt MUSCOD SUITE You will have to enter your svn password several times during the checkout once for every new sub repository that is accessed see section Technical S
40. ackage that may be used for on line graphics It is not essential but online graphics helps a lot to better understand possible difficulties MATLAB The Mathworks Inc may be used for online graphics as well Furthermore MUSCOD II contains interfaces to some external software modules not dis tributed with it You may use these interfaces if you have the software available and hold an appropriate license user commercial products in italics e ODE DAE solvers DDASAC Caracotsios and Stewart 1985 CS85 5By default according to Plitt BP84 an initial scaling factor is determined that bounds the first QP solution to be roughly twice as big as the minimum norm step satisfying the linearized constraints 12 MBSNAT METANB e standard QP solvers of which at least one has to be licensed preferably QPQPT BQPD OOQP QPOPT Gill et al NAG E04NFF QPOPT Gill et al NAG E04NAF QPSOL Gill et al 1983 GMSWS3 Installation of MUSCOD II under Windows is possible but will require additional software to provide a Linux like working environment e MSYS a Linux like shell for Windows e MinGW a collection of the C C and Fortran development tools for Windows e GrWin which provides PGPLOT support for Windows The installation of MUSCOD II under Windows is currently not covered by this manual 4 1 Installation Steps for a UNIX Linux System here we describe the installation of M
41. aic right hand side function on model stage i mfcn Mayer term of objective lfcn L Lagrange term of objective lsqfcn I least squares residual vector function The RKFSWT integrator supports the detection of implicitly defined switching events within a model stage thus eliminating the need for a multi stage modelling approach and the intro duction of transition stages under certain circumstances Implicit switches are realized by an implicit switching function which enables the detection Table 1 Correspondence between customary MUSCOD II source file notation and mathemat ical notation of a switching event by the change of sign in the switching function residuals and a state jump function which allows for an update of the differential states once a switching event has occurred The interfaces of the implicit switching function and the state jump function are as 23 follows swtdtcfcn imos tau xd xa u p nstep iswt nswsta res rwh iwh info This function is called to detect implicitly defined switch conditions imos is a long pointer to the current model stage index tau xd xa u and p are double pointers to the current physical time differential and algebraic states controls and model parameters respectively The parameter nstep is undocumented iswt is a long pointer to a list of indices of the switches to be evaluated by the current function call nswsta is a long pointer to the length of the index list
42. alities These decoupled constraints can be formulated either only at the start or end points of a stage or on the whole interior of a stage For the formulation of coupled constraints MUSCOD II employs a specific formulation for reasons of numerical efficiency it allows to couple different time points linearly in the following way the user specifies vector functions r at time points t all of equal dimension n The vector sum of these functions is then required to satisfy K r ty a tg z t u te p Pr gt 0 k 0 Again the first n components are taken as equalities the rest as inequalities In both decoupled and coupled constraints local parameters pj can be employed in addition to the global parameters p they are preferable to global parameters for reasons of numerical efficiency if they can replace them 2 3 The Objective Function The objective function is of generalized Bolza type containing Lagrange and Mayer terms for each model stage y rtt z t ult p dt titi mibi p 1 Note that no Lagrange term can be defined for transition stages 2 4 Least Squares Objective Contributions The objective function of Bolza type may be extended by an additional contribution that contains pointwise defined least squares terms of the form K NO Etr tr tx ute Ps PR k 0 where the time points t are specified as for the interior point constraints r Though th
43. andling logging interactive mode stack traces etc Some directories hold currently deprecated or non maintained code QUICKAUX ROBUST The following directories belong to the CMake build system CMake helperscripts 4 2 2 CMake Compilation Flags In the main makefile of the MUSCOD II sources MUSCOD II MC2 makefile several optional compilation flags can be set user defined parts of CFLAGS NDEBUG generate non debug version MSPLOT include online graphics CSTATS include computational statistics PRSQP use partially reduced SQP strategy 19 FEASIMP Use feasibility improvement for PRSQP NDIRDER do not use directional derivatives for PRSQP CENTDIFF use central difference gradient approximations REGOBJ use regularized objective LSQ allow least squares terms CLSQ allow continuous least squares terms As an example your compilation flags could be CCUFLAGS 02 DNDEBUG DCSTATS DPRSQP DMSPLOT DLSQ DCLSQ user defined parts of FFLAGS FCUFLAGS 02 Here 02 stands for the desired optimization level of your compiler Please note that after changing one of these flags no automatic compiling is performed after calling make without arguments Instead one has to use make FRC force_rebuild 4 3 Compiler Warnings As a MUSCOD II distribution contains also third party software the developers cannot guar antee that every of the source files will compile witho
44. atrix which is then revised during the SQP iterations by appropriate update pro cedures described in section that keep Hj positive definite Alternatively an exact Hessian matrix can be calculated numerically in each iteration as positive definiteness of Hp is not guaranteed in this case a trust region i e a bounded Q in Equation 6 has to be specified to have a well defined QP Remark Some specifications concerning the SQP algorithm as warm starts final accuracy maximum number of iterations can be given as optional arguments to the executable See the expla nations in 7 4 The software package MUSCOD II The MUSCOD II package is delivered together with the linear algebra library LIBLAC Leinewe ber and Jost 1996 LJ96 and with our ODE DAE solver DAESOL Bauer et al 1997 BFD 97 BBKS00 However for MUSCOD II to be fully functionable some extra software is required e Linear algebra packages and subroutines BLAS routines Lawson et al 1979 LHKK 9 Dongarra et al 1988 DCHH88 and 1990 DCDH90 The ATLAS library Whaley Petitet Dongarra 2005 of optimized BLAS routines may be used LAPACK routines DGETRF DGETRS Anderson et al 1995 ABB 95 Harwell MA48 direct linear solvers Reid and Duff 1993 RD93 and 1996 DR96 Harwell TD12 HSL archive sparse numerical derivative subroutine Reid 1972 e Visualization packages PGPLOT 5 2 Pearson 1997 Pea97 is a graphics p
45. be compiled as a dynamic library as described below 2 Data File The contents of this ASCII keyword file and its syntax are described below 5 1 Running an existing problem from the test set The directories MUSCOD SUITE Apps TEST and MUSCOD_SUITE Apps MIP contain sample prob lems which lend themselves to being used as reference and templates To launch one of these problems change to a binary directory e g Debug and inspect the files in the DAT subdirec tory Each of these files describes a combination of a dynamic optimization problem and the variant of the direct multiple shooting SQP algorithm to be used for the solution To launch one of these e g DAT reentry dat create a symbolic link in MUSCOD SUITE Apps TEST Debug by entering user machine TEST Debug gt 1n s MUSCOD SUITE MC2 Debug bin muscod of course this has to be done only once and call user machine TEST Debug gt muscod reentry Alternatively one may create an alias or to add the MC2 bin directory to the PATH environ ment variable cf your shell s manual e g man bash to avoid the need of typing the prefix MUSCOD_SUITE MC2 Debug bin of the muscod executable Please note that when using a different MUSCOD II binary e g from a Release build you have to adapt the symbolic link or any other of the described shortcuts 5 2 Setting up a new problem We recommend to add new problems to the existing MUSCOD_SUITE Apps TEST Src or MIP Src
46. ce file as a template to create new problem source files 6 1 The parts of the model dynamic equations constraints and objective functions All functions explained below are defined in def usrmod hpp so this file must be included in every new model source file To relate the function and variable names used in this section to the nomenclature of the theoretical part of the manual the user may refer to Table ffcn t xd xa u p rhs rwh iwh info This function describes the differential right hand side of an ODE or DAE system Argu ments t xd xa u and p are double pointers to the current time differential and algebraic states controls and model parameters respectively Upon return of the function call the double pointer res should have been filled with the requested function values Double pointer rwh and long pointer iwh are auxiliary real and integer working arrays and long pointer info should return an error code indicating the status of the function evaluation gfcn t xd xa u p rhs rwh iwh info This function describes the algebraic right hand side of a DAE system The arguments are exactly the same as for the differential right hand side afcn t xd xa u p amat lda rwh iwh info This function describes the left hand side of a DAE system Double pointer amat should be filled with the left hand side matrix upon return of the function call Long pointer 1da holds the leading dimension of amat as input The o
47. cmup astruc afcn ffcn gfcn rwh iwh Call to define a model stage with index I where NXD is the differential state dimension 25 NXA the algebraic state dimension and NU is the control dimension mfcn is a pointer to a Mayer term function or NULL to be evaluated at the end of the stage and lfcn a pointer to a Lagrange term or NULL For documentation of the left hand side matrix function afcn and of the integers jacmlo jacmup and astruc that provide structural matrix information please consult the DAESOL manual BBS99 setting the integers to zero is equivalent to not defining any structural information ffcn is a pointer to the differential right hand side function gfcn the pointer to the algebraic right hand side function or NULL rwh iwh are real and integer work arrays which can be used to pass a common workspace to the stage functions def mpc I SCOPE NPR NRD NRDE rdfcn rcfcn optional Call def mpc to define interior point constraints i p c on a stage I is the stage index SCOPE is a string whose first character should be one of s i e or x case insensitive indicating if the following constraint functions shall be evaluated at the start point of the stage only s at the interior multiple shooting nodes i at the end point e or at all multiple shooting nodes of the stage together Note The end point can only appear in the final model stage otherwise the start point of th
48. command line using the h option options frstart and options frmax Allows to freeze the integrator discretization after frstart SQP iterations to possibly enable better convergence to the solution The value can be overridden on the command line using the f option If the termination criterion is not satisfied after the mf following steps the integrator is once again given full freedom to adapt the discretization to be maintained for the following mf SQP iterations etc Currently works only for RKF integrators Default no freezing sf 0 mf 0 Syntax fsf omf Example 110 5 options bflag Sets the MS MIN TOC strategy code see section The value can be over ridden on the command line using the b option options cflag Cold start after a previous run of the problem Uses only the attained state and control variable values Note that it is possible to perform small changes in the DAT file between restarts e g concerning bounds or output specifications Dimensional changes are not allowed however Default no cold start The value can be overridden on the command line using the c option options itmax Sets the maximum number of SQP iterations The default is 100 The value can be overridden on the command line using the i option options qp expand Sets the expansion factor of the EXPAND strategy of the QP solver QPOPT EXPAND is a strategy to avoid cycling in the active set Useful values range from about 5 to 100 values greater
49. contributions is that this allows to obtain a Gauss Newton approximation of the second derivative e g oun 9706 Os Os Os which is good for small residuals If a continuous least squares function lf has to be integrated on a multiple shooting stage this integral is in the current version of MUSCOD II approximated by a sum using the trape zoidal rule as follows ia stop i j 1 nij fize wi g t zij t PP dt Y wigati tiyr Lig lige Zis 5 tiltas k 0 tij where the grid points t j are equally spaced between o tij and t so t 1 and the ij weights wij are set to Wije tij41 ham for k 1 a 1 and half this value for k 0 ns Wij Wi isst I tijj1 t n The la has to stop at the grid points to evaluate the objective contribution and its derivative Note that the approximation of the integral least squares terms by a sum of intermediate points allows to compute a Gauss Newton approximation of the second derivatives analogously to the case of point wise defined least squares terms Remark All features specific to the multiple shooting method i e the numbers m of multiple shooting intervals on the stages upper and lower bounds scales and initial guesses for the multiple shooting variables and some output specifications have to be provided by the user in the data file described in section For correspondence of the data file notation to the n
50. control problems Proceedings of the 9th IFAC World Congress Budapest 1984 e watson Nonlinear Complementary Problem restricted version Watson Solving the nonlinear complementary problem by a homotopy method SIAM J Cont Appl 17 1979 e wood Unconstrained minimization example Wood s function Reklaitis G V Ravindran A Ragsdell K M Engineering Optimization Methods and Applications 1983 e oven Model Equations according to Bertsekas Dimitri Dynamic Programming and Optimal Control Vol I Belmont MA 1995 pp 21ff Discrete dynamical system of material passed through two ovens minr zo T uz stp 1 2 zy t a y k 0 1 analytical solution for feedback laws r 1 a a T 1 a xp l r a 1 1 a Lo xo r a T 1 a zi 1 r 02 pa x1 References ABB 95 E Anderson Z Bai C Bischof J W Demmel J J Dongarra J Du Croz A Greenbaum S Hammarling A McKenney S Ostrouchov and D Sorensen Lapack Users Guide SIAM Philadelphia 2nd edition edition 1995 BBKS00 I Bauer H G Bock S K rkel and J P Schl der Numerical methods for optimum experimental design in DAE systems J Comput Appl Math 120 1 2 1 15 2000 BBS99 I Bauer H G Bock and J P Schl der DAESOL a BDF code for the numer ical solution of differential algebraic equations Internal report IWR SFB 359 Universitat Heidelberg 1999
51. ction uy is replenishment u is selling amount 4te constraint financial restriction where 78 bo 5 t 0 2 5 2 t 2 t 2 2 4 5 8 t 2 4 4 5 8 2 t 4 t 4 7 by bo 1 po 0 0 t 0 2 0 1 t 2 4 p 0 9 t 0 2 0 2 t 2 7 pa gt 0 1 t 0 2 0 7 t 2 7 d 0 5 t 0 2 1 5 t 2 4 1 0 0 5 t 3 0 t 4 7 a 3 0 2 t 1 0 t 0 2 1 0 t 2 1 mp e Y 0 5 ay 0 02 gt 2 20 tik gt 01 gt 2 03 3 kite Kite Tracking Problem for Stability Optimization Model as in Diehl Magni Scattolini Online NMPC of a Looping Kite using Approximate Infinite Horizon Closed Loop Cost ing Bratislava 2003 Ibat Batch reactor linear in states Ray W H Advanced Process Control New York 1981 Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci 47 p 851 864 1992 maratos Maratos example avoiding fullstep with nondifferentiable meritfunction macrol Simple consumption savings problem Maximize utility function dependent on consump tion Capital increases by a deterministic life cycle income profile macro2 Neoclassical growth model with endogeneous labor supply macro3 Neoclassical growth model macro4 Optimal growth model extended as to macro3 with additional agent government and taxing 79 spends variable amount gov u 3 thrown a
52. ctor A for the Hessian Use this to add A Id onto a Gauf Newton approximation of the Hessian matrix plevel Print level for RES 1og file ranging from 0 to 3 A print level of 0 corresponds to printing only the visible standard output into the log file whereas 3 is the maximum output If Matlab online graphics are used the Matlab output buffer is printed into the log file in case print level is greater or equal to 1 Example p0 default 39 rrfac Regularization factor rfac to make some non unique problems solvable If the original problem has a flat minimum this option may be useful as it adds a tiny quadratic term of all problem variables to the objective function to define the minimum uniquely the weighting factor is measured as a multiple of acc 1 2 rfac acc PVars Example r1 5 default 0 0 This option appears only if the global compilation flag REGOBJ is set in the MC2 makef ile s Stop after each SQP iteration and wait for a keystroke Example s tftol Sets the final integration tolerance ftol Should be lower than the termination accuracy kktacc to ensure validity of the termination criterion By default its value is acc 10 Example t1e 7 gif Enables output of the graphical visualization to GIF files in the RES directory This is only possible if the plot pgplot visualization module is loaded help Prints an extended list of all command line options their effect and their default value libcon
53. dname Override the IND module specified in the DAT file For a list of possible values of name refer to section 8 libdirpath Override the search path for dynamically loadable modules Defaults to the CMake installation directory libevalname Override the EVAL module specified in the DAT file For a list of possible values of name refer to section libhessianname Override the hessian module specified in the DAT file For a list of possible values of name refer to section 8 libindname Override the IND module specified in the DAT file For a list of possible values of name refer to section 8 libmssqpname Override the MSSQP module specified in the DAT file For a list of possible values of name refer to section libplotname Override the visualization module specified in the DAT file For a list of possible values of name refer to section B libqpsname Override the QP solver module specified in the DAT file For a list of possible values of name refer to section libsolvename Override the globalization strategy module specified in the DAT file For a list of possible values of name refer to section 8 libtchkname Override the termination check module specified in the DAT file For a list of possible values of name refer to section 40 plotadjointsname Opens a new window in which the multipliers for the continuity con ditions of the differential equations at the multiple shooting nodes are plotted Note t
54. e NLP functions ie F wx G wy and H w and their derivatives Vu F wy VuG we and V H wy with respect to w In this way linearizations of the originally nonlinear NLP functions are obtained that are used to build a quadratic programming QP subproblem Fur thermore an approximation Hy of the Hessian matrix of the Lagrangian function is calculated The quadratic programming subproblem solved at the k th SQP iteration can be written as A g 1 VF wy Aw Awk Hywr subject to 6 G wy V G w Aw 0 where Q is either the full Euclidean space JR or a suitably chosen box in JR that contains Aw 0 in the trust region approach The QP problem is then solved and results in a direction Au that helps to determine the next iterate Wri Wk Different line search strategies are implemented that determine the relaxation factor a they are described in section For the new values of the multiple shooting variables all NLP functions and derivatives are again evaluated a new Hessian matrix approximation Hj is provided and a new QP problem is solved for the next SQP iteration The iterations stop when the solution accuracy measured by the so called KKT tolerance has reached a prespecified value acc It indicates roughly spoken to how many digits the objective value is expected to be correct 11 In MUSCOD II the approximation of the Hessian matrix is either chosen as an initially diagonal m
55. e node state values s 1 control parameters q local and global parameters p and p as well as the stage durations can be specified Note that this means a slight modification of the original problem as state and control bounds may be violated between multiple shooting nodes in the solution The same applies to the decoupled path constraints described by functions rf It should be noted however that in the important case of a piecewise constant or linear control representation upper and lower control bounds are satisfied on the whole interval if and only if they are satisfied at the multiple shooting nodes 3Potential inconsistency of the algebraic equations at the m s nodes is dealt with a specific relaxed DAE formulation on the m s intervals See e g Leineweber sd i 5 E sd i 4 sd i 3 sd i 2 sd i 1 sd i 0 Multiple shooting method discontinuous initial trajec tory and continuous solution m 5 In this example initial guesses for s7 were obtained by linear interpola tion between known boundary values 3 4 Discretization of Least Squares Terms The pointwise defined least squares functions l can be evaluated at all specified multiple shooting nodes analogously to the constraint functions rg without any discretization errors The advantage of an explicit formulation of these least squares terms compared to formulating them as general Mayer objective
56. e following stage must be used PR is the number of local parameters pr used in rdfcn and rcfcnO NRD defines the dimension of the decoupled residual vector res in rdfcn NRDE leading componenents of this vector are required to be zero while the remaining ones are required to be greater than zero It should be noted here that the coupled rcfcn functions at different points have to agree in the dimension NRC of the residuals res cf section 2 2 def lsq I SCOPE NPR NLSQ lsqfcn optional may be called to define least squares terms contributing to the objective on a stage I is the stage index SCOPE selects the contributing nodes The string should contain s i e or x case insensitive as first character to define least squares terms at the corre sponding multiple shooting nodes as described in def_mpc or alternatively c to define a continous least squares term that is integrated on the model stage analogously to a Lagrange term 26 Attention The continuous least squares terms cam so far only be treated by the integrators DAESOL DDASAC RKF45ADJ and RKFSWT Also this command is only allowed if the CMake flags LSQ resp CLSQ are set NPR indicates the dimension of the vector of local parameters NLSQ defines the dimension of the residual vector res in lsqfcn The function lsqfcn obeys the same syntax as rdfcn and may depend also on the local parameters pr the dimensions of which are specif
57. e obtained with the prefix Vg e g e ge Sub and upperscripts can 3T be obtained by switching the mode with 1d and Vu e g A A u0 d If Matlab online graphics are used the name strings should be in Matlab syntax defaults Differential State Function Algebraic State Function Control Function Model Stage Duration Global Model Parameter of name objective name string Str note if Matlab online graphics are used the name strings should be in Matlab syntax default Objective xd unit ka unit fu unit h unit p unit state control duration and parameter unit strings StrVec note if Matlab online graphics are used the unit strings should be in Matlab syntax default empty string of unit objective unit string Str note if Matlab online graphics are used the unit strings should be in Matlab syntax default empty string t unit time unit string Str note if Matlab online graphics are used the unit strings should be in Matlab syntax default empty string 7 7 The Command Line After compilation and linking the executable e g target muscod can be called with a number of options The syntax is as follows muscod switch value option value problem Square backets indicate optional parts of the command line Any number of switches named with single characters and options long names may be specified Some of them may take values which may be appended immediately or after an a
58. ects the mixed integer optimal control module Defaults to mintoc and does not need to be changed 7 4 Keywords Setting Algorithmic Options The following keywords set algoritmic options All settings have default values and may also be overridden on the command line see section There is no need to specify any of the keywords of this section in the DAT file It is however good practice to do so because it s a standard way to document the ideal algorithmic options for the efficient solution of the problem you re working on options_acc Sets the termination criterion s acceptable KKT tolerance kktacc of the solution The default value is 109 The value can be overridden on the command line using the a option options ftol Sets the final integration tolerance ftol Should be lower than the termination accuracy kktacc to ensure validity of the termination criterion By default its value is acc 10 The value can be overridden on the command line using the t option options itol Sets the initial integration tolerance itol By default the value is ftol The value can be overridden on the command line using the h option options rfac Regularization factor rfac to make some non unique problems solvable If the original problem has a flat minimum this option may be useful as it adds a tiny quadratic term of all problem variables to the objective function to define the minimum uniquely the weighting factor is measured as a multiple of acc 1 2 rfac
59. ed QPs 46 8 7 Termination Check for the SQP Algorithms For the termination check of the SQP algorithm there are two possible termination criteria namely e tchk using the KKT Tolerance and e tchk loccont which is based on the local contraction theorem You might need the lagmulreg option for a regularization of the Lagrange Multipliers For a detailed description of both see Sch09 8 8 Graphical Visualization of the Results Graphical visualization of the convergence process and the optimal control problem s solution is realized by using one of the following shared objects e plot pgplot Visualization using the PGPLOT library e plot matlab Visualization using MATLAB This is variant is currently not maintained e plot noplot No visualization This is especially useful if you re going for minimum computation times many runs publication etc 8 9 Restrictions in the Choice of Modules Some combinations of algorithms are not sane from a mathematical point of view or are unsupported in the current implementation The resulting restrictions are listed in this section e With the SR1 and PSB update and with the unmodified BFGS update the hessian matrices do not need to be positive definite so that you have to use a trust region strategy Use solve 1001 if you use hess update with internally enabled SRI or PSB update or BFGS update without a modification guaranteeing positive definiteness e The exact hessian
60. efaults to hess update the BFGS update with Powell modification libsolve Selects the globalization strategy module for the SQP algorothm Defaults to solve_slse the standard line search libcond Selects the condensing algorithm module for the condensing of the block sparse QP Defaults to cond std and should not normally need to be changed libtchk Selects the termination check module for the SQP algorithm Defaults to tchk using the KKT tolerance as termination criterion libmssqp Selects the multiple shooting SQP algorithm Defaults to mssqp standard libeval Selects the EVAL module variant Defaults to eval ind libind Selects the ODE DAE solver module to use per stage of the multi stage optimal control problem All stages default to ind rkf45 the 4th 5th order Runge Kutta Fehlberg solver You will want to set this to ind daesol for DAE and stiff ODE problems Unlike all other library selection options this option takes a vector of strings as a value You need to specify an IND module per stage like in the following example 34 0 ind_daesol DAE or stiff ODE on first stage 1 ind strans transition stage 2 ind_rkf45 non stiff ODE on second stage libgps Selects the QP solver module to use for the solution of the condensed QP Defaults to qps_qpopt the C converted solver QPOPT libplot Selects the visualization module Defaults to plot pgplot You ll want to set this to plot noplot if you take timings libmintoc Sel
61. erform the full SQP step e solve_1sq for a line search via natural level functions suited for least squares problems e solve slse for a standard line search For NMPC the variants solve slse nmpc and solve_slse_fullstep_nmpc exists In contrast to the standard line search they both also includes simple bounds in the line search The fullstep variant always attempts to do a full step first e solve_tbox for a boxstep trust region technique This variant is especially required if you work with Hessians that are not guaranteed to be positive definite SR1 or PSB updates BFGS updates without modification exact Hessians by finite differences e solve_vmcwd for a line search with a watchdog technique e solve vmcwd nmpc for a line search with a watchdog technique For NMPC the variant solve_vmcwd_nmpc exists that also includes simple bounds in the line search e solve wdog A watchdog technique using Powell s penalty function e For expert users By manually changing the source code the following alternatives may be realized 44 In the slse and tbox algorithms you have the choice of using a second order correction step via the flag SUC STEP to be set in solve_slse_common cpp or solve_tboa cpp The flag LARGER ALPHA can be used in all modules to enforce the calculation of a maximum line search stepwidth The flag UPHILL MOD sets an optional uphill modification that introduces a new weighting parameter for the objective
62. ero tocarl Time optimal car I Cuthrell J E Biegler L T On the optimization of differential algebraic process sys tems AIChE J 33 p 1257 1270 1987 Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci 47 p 851 864 1992 tocar2 Time optimal car II Cuthrell J E Biegler L T On the optimization of differential algebraic process sys tems AIChE J 33 p 1257 1270 1987 Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci 47 p 851 864 1992 tocar3 Time optimal car III Cuthrell J E Biegler L T On the optimization of differential algebraic process sys tems AIChE J 33 p 1257 1270 1987 83 Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci 47 p 851 864 1992 tolinl Time optimal linear problem I fixed grid tolin2 Time optimal linear problem II model stage formulation 1008 Time optimal linear oscillating system I Plant J B Athans M An iterative technique for the computation of time optimal controls Proceedings of the 3rd International IFAC Conference London 1966 tolos2 Time optimal linear oscillating system II Plant J B Athans M An iterative technique for the computation of time optimal controls Proceedings of the 3rd International IFAC Conference Lo
63. etting the lower and upper bounds to sd arg1 arg2 lil default no differential states fixed sa sa sca sa min sa_max algebraic state start values scale factors and bounds DVec lu type control parametrization types LVec 0 piecewise constant 1 piecewise linear continuous on model stages only not between 2 piecewise continuous linear with matching across model stage boundaries external matching 3 piecewise cubic continuously differentiable on model stages 4 piecewise cubic with matching across model stage boundaries external matching default all controls piecewise constant u_midx external matching indices for controls LVec relevant only at model stage boundaries and if u_type is 2 or 4 default matching of controls with same index u u sca u min u_max control start values scale factors and bounds DVec u_fix control fixed value flags LVec if u_fix arg1 arg2 i is 1 then the corresponding control is fixed at its start value by internally setting the lower and upper bounds to u argi arg2 lil default no controls fixed ue ue_sca ue nin 92 fue_max x end of model stage control start values scale factors and bounds DVec relevant only if u_type is 1 or 3 default same values as at previous multiple shooting point udot udot_sca udot_min udot_max 32
64. g solvers are available e ind ddasac Another ODE SAE solver Use ind ddasac adf for models with derivative functions generated by ADIFOR Use ind ddasac prsqp or ind ddasac adf prsqp if you use PRSQP e ind mbsnat The multibody system solver MBSSIM Usage discourages as MBSSIM is currently unmaintained e ind metanb The METANB solver from PARFIT Solver ODE Stiff ODE DAE CLSQ SPA ADJ ADF Switches ind rkf12 e ind rkf23 e ind rkf45 e ind rkf78 ind_rkf7b e ind rkf4badj e e e e ind rkfswt e e e ind daesol e e e e ind ddasac e e e e e ind mbsnat e e a ind_metanb e e e Table 3 Available ODE DAE solvers and their capabilities 8 3 Computation of the Hessian For the computation or approximation of the Hessian the following shared objects are provided e hess_const Constant Hessian matrix for simplified Newton method Good for refinement of almost converged solutions e hess_finitediff Calculation of Hessian approximation from finite differences Very efficient for systems with few state variables and many multiple shooting intervals Needs module solve_tbox to cope with possibly non positive definite Hessian approximations e hess_gaussnewton Hessian approximation for least squares objective functionals Very efficient for problems with a solution with small objective value e hess update variable metric Hessian approximation By default BFGS updates with Powell modification are selected Fo
65. ges The following list of software should be installed by the system s native package management system e g YaST aptitude etc e boost dev e cmake gt V2 6 0 e gcc e gfortran e subversion e tcl e make Building You can now build and install the whole suite with the bootstrap script By typing bootstrap help you get a list of supported options They are related to build target Release Debug 32 64 bit compilation number of parallel build jobs and more The default settings should be reasonable for most target platforms If performance is not an issue for you it is recommended to build the suite in Debug mode which is the default After a successful installation you may want to run a sample MUSCOD II application to check if everything was built properly If you encounter problems during install which you cannot solve ask for help on the MUSCOD II mailing list or the SimOpt Wiki Local Installation The files installed by the command name machine MUSCOD_SUITE gt bootstrap stay within the suite folder as long as no ipref argument is specified This is the desirable behavior for developers It is also possible to install to a system folder which is described in the next section After successfully running bootstrap the executables provided by MUSCOD II can be found in MUSCOD_SUITE MC2 Debug bin You might want to add that path to your PATH envi ronment variable however be careful if you have several build t
66. h all start heuristics 8 9 11 12 41 Outer Approximation not yet implemented 41 42 Penalty approach default 41 quadratic penalty function exponential penalty function 5x Switching time optimization default 5816 with initialization x in 1 10 2 4x 6 64 8x 60 Adapt control discretization grid numadaptiters times Adapt c d g combined with penalty approach Integral Approximation 8l 82 83 84 85 86 Rounding default 83 Rounded relaxed solution Sum Up Rounding with specific offset Sum Up Rounding Sequentially relaxed solution on shrinking horizon with round ing on moving 1st interval Sequentially relaxed solution on shrinking horizon with enu meration on moving 1st interval Sequentially relaxed solution on shrinking horizon with SUR on moving 1st interval Table 7 Possible values for the b flag and the corresponding algorithms of MS MINTOC 11 3 MS MINTOC specific options There are several options that are only meaningful in the context of MS MINTOC They are typically specified by means of the dat file compare Section In Table 8 a list of possible options their meaning and the default value is given 59 key word mintoc description and default Penalty term parameters eps init eps_step penTolZero penIntTol penConTol penNumQPSteps penMaxSteps penMaxStuck Initialization of penalty parameter
67. hat these values can be seen as an approximation to the adjoint variables A t however they are only defined and calculated on the MS nodes pmatlablevel Sets the MATLAB logging level Possible values range from 0 to 3 and increase the amount of data written to the MATLAB log file This option only has an effect if the MATLAB header files and libraries were found at compile time when the bootstrap script was last run ps Enables output of the graphical visualization to PostScript PS files in the RES di rectory This is only possible if the plot pgplot visualization module is loaded qp expandNN Sets the expansion factor of the EXPAND strategy of the QP solver QPOPT EXPAND is a strategy to avoid cycling in the active set Useful values range from about 5 to 100 values greater than 9999999 by design of QPOPT disable the EXPAND strategy Example qp expand50 default This option only has an effect if the QP solver module qps qpopt is loaded qp featoltol Sets the feasibility tolerance of the QP solver QPOPT Example qp featolie 8 default This option only has an effect if the QP solver module qps qpopt is loaded qp itmaxitmaa Sets the maximum number of QP solver iterations per SQP iteration Ex ample qp itmax10000 default qp relaxrel Sets the constraint relaxation factor for infeasible QPs Useful values are greater than 1 0 When an infeasible QP is detected all infeasible constraints are shifted
68. ied in def _mpc OP def mio minp mout mplo optional allows for an optional definition of input output and external plot functions The input function minp is called by MUSCOD II immediately after the problem data file see subsection 7 1 has been read Data passed through minp supersedes the data read from the data file The output function mout gets is called by MUSCOD II with the final results as standard arrays and thus allows to implement a user defined output i e by printing some results into an external file def plotoptions min max 11 f2 3 14 optional allows to adjust plot options The first two arguments set the plot granularity of the above mplo function and also of the online graphics The values specify the lower and upper bound for the number of calls to mplo per multiple shooting interval The default values are min 5 and max 200 If you require more precise plot data you should increase the lower bound Excessively large values of the upper bound will damage the online graphics performance The flags 11 2 3 4 turn on or off the plotting of 1 vertical lines to indicate stage transition times f2 plotting of MS nodes 3 plotting of state bounds and 14 plotting of control bounds The default value is 1 yes for all of them def swt I NSWT swtdtcfcn swtexecfcn optional Attention Implicit switches are currently supported by the RKFSWT integrator only def swt defines NSWT implicit
69. imal car II extrosen This is another example for unconstrained minimization the Rosenbrock function in its extended version using more variables see Rosenbrock An automatic method for finding the greatest or least value of a func tion Comput J 3 1960 fedbat1 Fed batch fermentor case I Cuthrell J E Biegler L T Simultaneous optimization and solution methods for batch reactor control profiles Comp Chem Engng 13 p 49 62 1989 fedbat1m Fed batch fermentor modified case I max productivity Cuthrell J E Biegler L T Simultaneous optimization and solution methods for batch reactor control profiles Comp Chem Engng 13 p 49 62 1989 fedbat2 Fed batch fermentor case II Cuthrell J E Biegler L T Simultaneous optimization and solution methods for batch reactor control profiles Comp Chem Engng 13 p 49 62 1989 fedbat2m Fed batch fermentor modified case II max productivity Cuthrell J E Biegler L T Simultaneous optimization and solution methods for batch reactor control profiles Comp Chem Engng 13 p 49 62 1989 fedbat3 fed batch fermentor high initial substrate Lim H C Tayeb Y J Modak J M Bonte P Computational algorithms for optimal feed rates for a class of fed batch fermentation 76 numerical results for penicillin and cell mass production Biotechn Bioengng 28 p 1408 1420 1986 fedbat3m fed batch fermentor high initial substrate max produc
70. imulation_maxiter iterations has been performed To cope with special cases with shifted variables see simulate_shift_select default 0 simulation_maxiter Maximum number for repeated integration to reach steady state long relevant only if s_spec is 3 default 100 simulate_shift_select For every differential variable an index is given Any value less or equal to 2 for variables with fixed initial value the value 1 for all variables for which the initial value is replaced with the value at the end of the time horizon after integration and the index 0 i n of another differential variable if for variable 7 a periodic shift is performed as in the SMB example a tg in iteration 1 lt k Xsimulation maxiter LVec relevant only if s spec is 3 works only if number of differential states is constant default 1 s_itol s pert start integration tolerance state perturbation factor double relevant only if s spec is 2 or 3 defaults 1 0E 6 0 0 nstop C number of integrator stopping points on corresponding multiple shooting interval s only needed for continuous least squares terms long 3l sd sd sca sd min sd max differential state start values scale factors and bounds DVec sd_fix differential state fixed value flags LVec if sd_fix arg1 arg2 i is 1 then the corre sponding differential state is fixed at its start value by internally s
71. ing to Matlab at the end of the fifth iteration one calls gt gt iterations 5 newvar sd 3 in Matlab 3 Log most of the intermediate data The names in the iterations cell array will be close to or the same as in the MUSCOD IT source code which shall serve as a reference here In this print level there can be a lot of warnings in the output for values which are written several times in one iteration e g when line search damping has to be performed 10 Interactive MUSCOD II MUSCOD II incorporates an interactive mode that can be initiated by wither the s command line flag or by pressing simultaneously the Ctrl and the c key at runtimd The result will be an interactive mode that waits for commands between SQP iterations The list of possible commands is given in Table 6 Note that QP data and solution are always unscaled The order of variables here is phf sd_0 qls qc sa prf gle j where j is the index over all multiple shooting nodes note that pressing Ctrl c twice aborts directly without possibility to restart in the current solution point 52 command description h help Print list of available commands s step return Calculate next SQP iteration c cont Continue in noninteractive mode q quit Quit may be restarted with c or w set List all current options set OPTION VAL output outputmode scaled unscaled tol VAL Change option to val screen log or
72. ining two arguments key arg1 arg2 where argi specifies the model stage and arg2 in addition specifies one or more multiple shooting points on this model stage Hence arg1 may be e a valid model stage index e an asterisk all model stages and arg2 may be e a valid multiple shooting point index for the model stage specified by arg1 e the letter S or s start point the letter I or i interior points the letter E or e end point valid only for final model stage an asterisk all multiple shooting points including end point on final model stage 29 Note that model stage indices and multiple shooting point indices start from zero Therefore arg2 S and arg2 0 are equivalent Example keywords with arguments sd sca x all multiple shooting points on all model stages sd S start point on all model stages u 0 all multiple shooting points on first model stage rd sca 0 9 start point on first model stage d sca 0 1 interior points on first model stage rd_sca 0 E fend point assuming there is only one model stage Some of the data items are optional if not explicitly specified an internal default is used In the following description optional data items are indicated by keywords in square brackets and the corresponding default is given 7 2 Keywords Defining the Optimal Control Problem nshoot numbers of multiple shooting inte
73. initediff libsolve solve_tbox libcond cond std libtchk tchk libmssqp mssqp standard libeval eval_ind libind 0 ind_daesol libqps aps qpopt libplot plot_pgplot ee ee ee K K K K K Setting algorithmic parameters FRAO OKO IA GR kak ak K kok options_acc 16 6 options ftol 1 0 options_itol 1 0 options rfac 0 0 options_levmar 0 0 options_qp featol 1 0e 8 options qp relax 1 1 options nhtopy 0 64 bounds options frstart 0 options_frmax 0 options itmax 100 options plevel screen 0 options_plevel_file 1 options_plevel_matlab 0 options bflag 1 options qp itmax 10000 options qp expand 99999999 options sflag 0 options wflag 0 options cflag 0 options output ps 0 options output gif 0 65 14 Example MS MINTOC Problem lotka Listing 3 lotka source file MUSCOD II Apps MIP SRC lotka cpp Sebastian Sager 2003 include lt math h gt include lt stdio h gt include def_usrmod hpp define NMOS 1 define NP 2 define NRC 0 define NRCE 0 define NXD define NXA define NU define NPR OHOW static void ffcn double t double xd double xa double xu double p double rhs double rwh long iwh long x info double ref0 1 refl 1 steady state with u 0 x rhs 0 xd 0 xd 0 xd 1 p 0 u 0 xd 0 rhs 1 xd 1 xd 0 xd 1 p 1 u 0 xd 1 rhs 2 xd 0 refO xd 0
74. integer valued functions and variables into the problem formulation Good places to look for a descrip tion of theory and algorithms are and SRBO09 The main difference compared to the MUSCOD II problem formulation is that in addition 53 to the interior point and path constraints integrality conditions on global parameters and or control functions are imposed It is expected that an outer convexification is performed by the modeler himself Hence all integer controls are expected to be of the form w t 6 we wer VEE fta ti 7 for control function j on model stage 1 11 1 Defining integer variables The feasible values for binary controls and parameters are given in the usual way as upper and lower bounds E g w a control function is an integer binary or continuous control the option u int within the is given by the corresponding value of u min To define whether dat file is used For every control function a natural number x has to be specified with the interpretation e x 0 continuous control function w t j wi e 1 binary control function w t 7 wp e x 1 integer control function w t iur uy 3 lees Ur Jang e x gt l binary control function w t w w with SOS 1 constraint j j j j gt ux t 1 Vte ti tis 8 kury mj21 that needs to be taken into account when applying e g rounding algorithms Note that several independent SOS1 con
75. is special form of an objective contribution could also be formulated by use of Mayer terms as in 1 this explicit formulation allows to exploit the structure of the least squares terms in the numerical solution procedure As an additional feature a continuous least squares function may be defined on each differ ential modelstage so that a further contribution of the following form is added to the objective 4 1 41 x fissi s utt ida 1 0 ti 2Please note that a possible use of controls and algebraic states in the coupled interior point constraints allows some point control values to enter the problem and gives them the effective influence of parameters u 6 r Gs d P Qi2 lt qi H lt qio A 0 Tio Ti Ti 2 Ti 3 Ti 4 Ti5 1 Figure 1 Piecewise constant representation of a control m 5 which again could in principle be covered by Lagrange terms as in 1 but allows a favourable numerical treatment if explicitly formulated in least squares form Remark The relevant dimensions of the problem and all functions mentioned in this section have to be provided by the user in the model source file described in section 6 A correspondence between the customary notation in the model source file and the notation used in this section is given in Table 3 The Direct Multiple Shooting Method In the direct multiple shooting method the original continuous optimal control prob
76. k Plitt Id Xo X A X HK of multiple shooting intervals Stoer Bulirsch file 1984 1992 reentry dat 651 2009 05 18 10 25 48Z ckirches on each model stage nshoot 0 6 multiple shooting grids on model stages grid x 0 0 0 1 0 25 2 0 375 3 0 5 4 0 675 5 0 75 6 1 0 model stage duration start values scales bounds h 0 230 0 h sca 0 225 0 h min 0 220 0 h max 0 240 0 mode for differential state variable start values s spec 1 differential state start values scales bounds sd 0 8 0 0 36 0 1414 2 0 01914 sd 0 E 0 0 27 440 20 2 0 01196 sd sca x 0 0 4 E Ol 2 0 02 sd min x 0 0 2 0 2 2 0 006 sd_max x 0 0 4 0 1 2 0 03 control u type x 0 parameterization types control u 0 0 5 start values scales u_sca x x 0 1 0 u_min 0 3 0 u_max 0 2 0 bounds control slope start values scales udot 0 0 0 udot_sca x 0 1 0 udot min 0 0 1 udot max 0 1 decoupled i p c scale factors rd_sca 0 S 0 0 4 1 0 2 2 0 02 rd_sca 0 E 0 0 4 1 0 2 2 0 02 objective scale and expected range of sca 0 0275 of min 0 0 of max 0 05 Number of values in history plot nhist 30 ok OOOO Rk aK kk Choosing k ck ck CK SK SK ck ck ck ck ck ck OK OK OK A OK libmodel SRC libreentry libraries x libhessian hess f
77. kefile will be used by typing cp make inc linux make inc Change to the parent folder which is LAPACK by typing cd Open the file Makefile again using your favourite editor and change the line all install lib testing blas testing timing blas timing to read all blaslib lapacklib Make LAPACK by typing make This may take some minutes When make finished the files lapack LINUX a and blas_LINUX a should have been created Move and rename them by typing 60 mv lapack_LINUX a mingw lib liblapack a mv blas_LINUX a mingw lib libblas a 4 Change to your home directory cd and create a new directory MUSCOD II there mkdir MUSCOD II Check out a current version of MUSCOD II from the workgroup s subversion repository and put it into that folder 5 Still using the MSYS shell change to the LIBLAC folder by typing cd MUSCOD II LIBLAC Open the file nakefile and make sure that the line at the very top reads MACHINE inc MINGW32 mk Look for the LIBS entry and comment it put a in front of all lines belonging to the LIBS entry Uncomment the currently commented MinGW32 version remove the appropriate signs Leave the editor and make LIBLAC by typing make Again this may take some time 6 Change to the MUSCOD II folder by typing cd MC2 Run make once to create the file user mk Open this file and make sure that MACHINE inc MINGW32 mk is set Make MUSCOD II by typing make Again this may take some time
78. l problems in DAE with application to path planning problems for satellite mounted robots PhD thesis Universitat Heidelberg 1996 V H Schulz Solving discretized optimization problems by partially reduced SQP methods Computing and Visualization in Science 1 83 96 1998 A Sch fer On scaling techniques and termination criteria for sqp methods diploma thesis Universitat Heidelbeg 2009 S Sager G Reinelt and H G Bock Direct methods with maximal lower bound for mixed integer optimal control problems Mathematical Programming 118 1 109 149 2009 published online at http dx doi org 10 1007 s10107 007 0185 6 on 14 August 2007 87
79. lation process if you don t already have a working version of WinZip installed An open source alternative to WinZip is http sourceforge net projects sevenzip 2 Before you extract the first archive launch WinZip click and make sure that the checkbox that reads Convert is unchecked 12 0 3 Installing MinGW Tcl Tk MSYS and GrWin 1 Create the folder C Program Files MinGW or C Programme MinGW etc depending on the language of your Windows XP installation For the sake of simplicity we ll just use the German path names from now on 2 Extract the files below to the folder C Programme MinGW in precisely this order a mingw runtime 3 9 tar gz b gcc core 3 4 2 20040916 1 tar gz 98 c gcc gtt 3 4 2 20040916 1 tar gz d gcc g77 3 4 2 20040916 1 tar gz e w32api 3 5 tar gz f binutils 2 15 91 20040904 1 tar gz Install the GNU Debugger GDB by executing gdb 5 2 1 1 exe When it asks for a folder to install to enter the path to MinGW C Programme MinGW Install GNU Make by executing mingw32 make 3 80 0 3 exe When it asks for a folder to install to enter the path to MinGW C Programme MinGW Install Tcl Tk by executing tcltk 8 4 1 1 exe When it asks for a folder to install to enter the path to MinGW C Programme MinGW Install MSYS by executing MSYS 1 0 11 2004 04 30 1 exe Don t install it to MinGW s folder but enter C Programme MSYS as the installation fo
80. lder instead A windows command prompt dialog will ask you several questions enter y twice When it asks for MinGW s installation folder enter C Programme MinGW Make sure to use linux style slashes this time You can ignore any Microsoft Word documents jumping at you Install GrWin by executing lGrWn0999be MinGW exe Enter C Programme GrWin as the installation folder 59 12 0 4 Compiling LAPACK LIBLAC and MUSCOD II 1 Extract the LAPACK archive lapack tgz to your home directory C Programme MSYS home lt user gt 2 Now open an MSYS shell using the new blue M icon on your desktop You re now in a linux like shell and have to use slashes instead of backslashes The Windows folder C Programme MSYS home lt user gt where lt user gt is your Windows account s user name will serve as your home directory within MSYS the command cd will bring you there The Windows drives C D etc can be found as invisible directories below the root For example within MSYS your home folder can also be accessed by typing cd c Programme MSYS home lt user gt MinGW itself can be found in the folder mingw which corresponds to c Programme MinGW 3 We re now applying some changes to several make files Should you find that these changes have already been applied in your version of these files this is fine Change to the LAPACK installation folder by typing cd LAPACK INSTALL Make sure the correct ma
81. lem is reformulated as an NLP problem which is then solved by an iterative solution procedure a specially tailored sequential quadratic programming SQP algorithm A far more complete description of the methods employed is given by Leineweber 1999 Lei99 3 1 Piecewise Control Discretization In order to reformulate the original continuous problem as an NLP problem first the control functions are approximated by a piecewise representation using only a finite set of control parameters This is done by first dividing each model stage into a number of m subintervals called multiple shooting intervals I tij tijzi 7 0 1 m 1 with intermediate time points 7 Then a piecewise approximation 4 of the control functions u on this grid is defined by t Pilt qij tE Lij J 0 1 nn m l 2 7 using local control parameters qij The functions yj are typically vectors of polynomials If for example piecewise constant approximations are used for all control functions we simply have t qij qi for t 1 see the scalar example shown in Figure In MUSCOD II five possibilities are implemented piecewise constant controls piecewise linear with continuitiy on the corresponding stages but not between different stages linear with overall continuity cubic with continuous differentiability again stagewide or overall The user can explicitly specify the locations of the multiple shooting grid
82. mbers of equality and inequality constraints in the NLP problem nin includes lower and upper bounds on all variables mc2 specifies the variant of MUSCOD II used for the solution of the problem way of Hessian approximation globalization strategy ch constant diagonal Hessian fd forward difference Hessian approximation Im limited memory BFGS Hessian approximation um standard BFGS Hessian approximation bt boxstep trust region strategy with SOC sl standard line search strategy without SOC wl watchdog line search strategy int specifies the ODE or DAE integrator employed within MUSCOD II itr is the number of SQP iterations cpu is the CPU time in seconds excluding graphics on an SGI Indy workstation MIPS R4000 CPU with 100Mhz speed MIPS R4010 FPU running IRIX Version 5 3 obj is the value of the objective function at the solution inf is the scaled norm of the constraint infeasibilities at the solution lag is the scaled norm of the Lagrangian gradient at the solution 70 brgri brgr2 rosen eason wood nlpi nlp2 nlp3 nlp4 Stpi stp2a stp2b stp2c stp2d stp2e stp3 stp4a stp4b qlin tolini tolin2 ftlosi ftlos2 ftlos3 ftlos4 101081 tolos2 tolos3 tolos4 1 1 1 2 1 1 1 1 1 1 1 3 1 8 8 8 1 8 8 8 2 lt Ot lt KKK Ree Ah eee ee et re mi CO B2 4
83. n case you use other software from the SimOpt repository which uses common packages e g both MUSCOD II and VPLAN both use COM MON CODE it may be advisable to have the common packages installed only once on your system This can be achieved by creating a symlink called Packages with exactly that name in the MUSCOD SUITE dir to the single common Packages directory before the checkout e g user machine MUSCOD_SUITE gt ln s Packages Then the packages will actually be checked out to the packages directory on the suites level Using the same technique on your other projects ensures that you only have one actual location for the sources of common packages You are expected to encounter problems with this approach if you try to mix branches tags trunk versions of different suites e g a special MUSCOD II tag with MUSCOD II trunk In this case MUSCOD II will try to check out a tagged version of the package and MUSCOD II will try to check out the trunk version of the package to the same directory In this case the use of suite packages is not advisable and you are encouraged to perform the recursive checkout manually Since revision 6 there is only one executable which links dynamically shared object files at runtime corresponding to algorithmic settings 17 4 2 Making Changes to the Installation 4 2 1 Organization of the Source Code The directory MC2 contains a number of subdirectories organizing the source code into specific
84. ndon 1966 tolos3 Time optimal linear oscillating system III Plant J B Athans M An iterative technique for the computation of time optimal controls Proceedings of the 3rd International IFAC Conference London 1966 tolos4 Fixed time linear oscillating system IV indirect approach maximum principle Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci 47 p 851 864 1992 twobat1 Two stage batch reactor system I Vassiliadis V S Sargent R W H Pantelides C C Solution of a class of multistage dynamic optimization problems 1 Problems without path constraints Ind Eng Chem Res 33 p 2111 2122 1994 twobat2 Two stage batch reactor system II Vassiliadis V S Sargent R W H Pantelides C C Solution of a class of multistage dynamic optimization problems 2 Problems with path constraints Ind Eng Chem Res 33 p 2123 2133 1994 unload1 Ore unloading system Plitt K J Ein superlinear konvergentes Mehrzielverfahren zur direkten Berechnung beschrnkter optimaler Steuerungen Diploma thesis University of Bonn 1981 unload2 Ore unloading system Plitt K J Ein superlinear konvergentes Mehrzielverfahren zur direkten Berechnung beschrnkter optimaler Steuerungen Diploma thesis University of Bonn 1981 84 e vdpol Van der Pol problem Bock H G Plitt K J A multiple shooting algorithm for di rect solution of optimal
85. node value at time point t on model stage 1 sa i j 5j algebraic multiple shooting node value at time point t on model stage 1 7 1 1 Data items in DAT Files Each data item has the form key associated data The keyword must start at the beginning of a line and must be terminated by a white space character the rest of the line is ignored and can be used e g for comments The following line s must then contain the data associated with the keyword Six different types of data may occur namely long scalar long long vector LVec double scalar double double vector DVec string Str and string vector StrVec Comments can follow any line exept those containing a string or an element of a string vector Note that vectors are written one element a line with element indices starting from zero Example data items S Spec long 2 start integration nshoot LVec with three elements 0 4 initial stage 1 6 intermediate stage 2 4 final stage 28 of_sca double 1 0 unscaled p_sca DVec with one element 0 1 0E 8 catalyst concentration of unit Str g h xd name StrVec with three elements 0 Substrate Concentration 8 1 Product Concentration P 2 Volume V sd 1 1 DVec with arbitrary number of elements ALL 1 0 All keywords are explained in the next section 7 1 2 Keywords in DAT Files There are keywords containing one argument key arg1 and keywords conta
86. of MUSCOD II on a Unix workstation is described in detail in Section Ml You will find information on necessary and useful third party software on obtaining the source code on the file structure of the software on the installation process and on details about the location of the algorithmic modules How to set up and run a problem is described in Section 5 Setting up a problem involves creating a model source file and a data file A description of the model source file is given in Section 6 In Section 7 a description of the data file as well as command line options are given An overview of the available dynamically loadable algorithmic modules is given in Sec tion Screen and file output of MUSCOD II is explained in Section 9 The interactive mode which allows to view and log data during the optimization run is described in Section 10 The mixed integer extension of MUSCOD II which is called MS MINTOC is described in Section An example source and data file for standard MUSCOD II is given in Section An example for MS MINTOC can be found in Section Multistage Optimal Control Problems in DAE Many dynamic process optimization problems of practical relevance can be expressed as multi stage optimal control problems in DAE MUSCOD II is able to treat the following general class of multistage optimal control problems where the time horizon of interest to ty is divided into M model stages corresponding to
87. optimal control problems with general constraints Automatica 24 p 3 18 1988 e stp2d Simple test problem IId Goh C J Teo K L Control parametrization a unified ap proach to optimal control problems with general constraints Automatica 24 p 3 18 1988 82 stp2e Simple test problem Ile Goh C J Teo K L Control parametrization a unified ap proach to optimal control problems with general constraints Automatica 24 p 3 18 1988 stp3 Simple test problem III Goh C J Teo K L Control parametrization a unified ap proach to optimal control problems with general constraints Automatica 24 p 3 18 1988 stp3_f77 Simple test problem III Fortran 77 version Goh C J Teo K L Control parametriza tion a unified approach to optimal control problems with general constraints Automatica 24 p 3 18 1988 stp4a Simple test problem IVa DAE extension of simple test problem III stp4b Simple test problem IVb DAE extension of simple test problem III with Mayer objective instead of Lagrange objective swtball This is a test for the sensitivity updates on switches implemented in RKF45SWT The bouncing ball s energy loss upon contact with the floor is to be adjusted so that the ball hits the ground exactly at the end of the stage In between it bounces several times Without sensitivity updates there would be no advance in the objective since the derivatives with respect to the responsible parameter are z
88. otation used in this section see also Table 3 5 The resulting Nonlinear Programming Problem If we subsume all multiple shooting variables i e 57 s qij hi p and pz to a single vector w of large dimension n we can write the objective function as F w IR gt IR Similarly we can subsume all equality constraints in particular the continuity and consistency conditions and 3 to a vector valued function G w and the inequality constraints in a vector valued function H w Then the parametrized optimal control problem can be written as a finite 4Note that this feature is so far only implemented in the integrators DAESOL and adfDAESOL 10 dimensional Nonlinear Program min F w subject to 5 G w 0 H w gt 0 where the inequalities hold componentwise 3 6 The SQP Algorithm The SQP algorithm deals with the NLP problem where all functions are explicitly or implicitly defined as functions of the multiple shooting variables only The numerical DAE solution on the multiple shooting intervals is performed in an underlying evaluation module and has to be carried out with sufficiently high integration tolerance Starting with an initial guess wo provided by the user the SQP algorithm iterates Wh Wk A Aw with step directions Aw and relaxation factors a 0 1 until a prespecified convergence criterion is satisfied At the k th SQP iteration with multiple shooting variables wg the algorithm evaluates th
89. owing e Locate the Matlab installation on your file system We assume here that Matlab has been installed to usr loca1 matlab e Reconfigure the COMMON CODE package in the suite by calling the CMake GUI e g with user machine MUSCOD_SUITE Packages COMMON_CODE Debug gt ccmake Enable the options PROVIDE_LOGGING_TO_MATLAB and PROVIDE_TYPE_CONVERSION_MATLAB Press c to configure the package CMake will try to find your Matlab installation Sometimes you have to help manually by setting the advanced variable MATLAB_DIR to your Matlab installation path Even that may not be enough It is a known problem of CMake at least for version 2 6 and earlier that libraries ending in a version number e g so 1 0 instead of so will not be found automatically In Matlab 7 6 the following needed libraries have that problem MATLAB ICUDATA LIBRARY usr local matlab bin glnxa64 libicudata so 36 MATLAB ICUI18N LIBRARY usr local matlab bin glnxa64 libicuii8n so 36 MATLAB ICUIO LIBRARY usr local matlab bin glnxa64 libicuio so 36 MATLAB ICUUC LIBRARY usr local matlab bin glnxa64 libicuuc so 36 You can either create symbolic links e g via user machine usr local matlab bin glnxa64 gt ln s libicuuc so 36 libicuuc so which is only possible if you have root access on your machine Alternatively you have to type in the proper locations in the CMake GUI If you work in a 32bit environment you Ga will have to exchange g1nxa
90. pe objective function Note that the actual objec tive function value is the integral over time of this function Double pointer 1val should return the value of the Lagrange term at time t All other arguments are the same as in the differential right hand side 6 2 Putting the model together the model definition function The essential function in the model source file is def modelO without arguments that formally defines the optimization problem by calling internal MUSCOD II functions declared and documented in def usrmod hpp or def usrmod f77 hpp Here the pre viously defined model functions are assigned their role in the optimization problem If any of the model functions does not exist for a given problem the NULL pointer must be passed instead of the function pointer In def_model the following internal MUSCOD II functions must be called appropriately def mdims NMOS NP NRC NRCE must be used to specify the global model dimensions where NMOS is the number of model stages NP the number of global parameters NRC the total number of coupled interior point constraints i p c and NRCE is the number of those that are equality constraints thus NRCE lt NRC By con vention the first NRCE components of the res vector in the coupled i p c functions rcfcnXX are interpreted as equalities the remaining ones are required to be greater than zero Cf section 2 2 def mstage I NXD NXA NU mfcn lfcn jacmlo ja
91. ple either w or c e Evaluate twice Use of two gradient evaluations per SQP iteration to better approxi mate the partially reduced Hessian There exists a proof for asymptotically superlinear convergence Sch96 Sch98 Example e This option only appears if PRSQP is employed fsf mf Allows to freeze the integrator discretization after sf SQP iterations to possibly enable better convergence to the solution If the termination criterion is not satisfied after the mf following steps the integrator is once again given full freedom to adapt the discretization to be maintained for the following mf SQP iterations etc Currently works only for RKF integrators Default no freezing sf 0 mf 0 Syntax fsfomf Example 110 5 hitol N Allows to employ a homotopy strategy beginning with a lower initial integration tolerance tol and thus faster SQP iterations the current integration tolerance ctol is tightened until after N steps ftol is attained The steps in ctol interpolate logarith mically between tol and ftol A homotopy step is performed during the SQP iterations whenever the current accuracy cacc is attained It is determined as cacc ctol acc ftol By default no homotopy is employed Example h1e 3 1 iitmaz Maximum number of SQP iterations Example i100 default jcores Sets the number of CPU cores on multicore machines Currently without effect limreg Sets the Levenberg Maquardt regularization fa
92. points relative to the model stage duration or instead use a uniform grid If the model stage duration varies the multiple shooting sub intervals are scaled proportionally and accordingly the piecewise control representations 3 2 Multiple Shooting State Parametrization The basic concept of the multiple shooting method is to solve the differential algebraic equa tion independently on each of the multiple shooting intervals On interval 7 of the ith model stage j 0 L n7 Y the initial value for the DAE solution is given by the so called node x values sj sj for differential and algebraic states Consistency of the algebraic equations bigs Sijs Sij 00 5 D 0 3 and particularly continuity of the state trajectory at the multiple shooting grid points Sija Vigo 4 where z t denotes the differential part of the DAE solution on Interval t I with initial ij Sig only at the solution of the problem not during the SQP iterations This allows to easily values s7 57 are incorporated as constraints into the NLP They are required to be satisfied incorporate information about the trajectory behaviour into the initial guess and it leads to good convergence properties of the multiple shooting method For more details see e g Bock and Plitt BP84 or Leineweber Lei99 3 3 Discretization of Bounds Interior Point and Path Constraints Upper and lower bounds for all multiple shooting variables i
93. programming volume SOL 83 7 of Technical Report Stanford University Systems Optimization Laboratory De partment of Operations Research 1983 D B Leineweber Efficient reduced SQP methods for the optimization of chemical processes described by large sparse DAE models volume 613 of Fortschritt Berichte VDI Reihe 3 Verfahrenstechnik VDI Verlag D sseldorf 1999 C Lawson R Hanson D Kincaid and F Krogh Basic linear algebra subrograms for fortran usage ACM Trans on Math Soft 5 308 325 1979 D B Leineweber and J A Jost Liblac structured data types and basic operations for numerical linear algebra in an ansi c fortran 77 environment IWR Preprint 96 56 Universit t Heidelberg Heidelberg 1996 T J Pearson PGPLOT Graphics Subroutine Library California Institute of Tech nology Pasadena 1997 J K Reid and LS Duff MA48 A fortran code for direct solution of sparse un symmetric linear systems of equations Technical Report RAL 93 072 Rutherford Appleton Laboratory 1993 J K Reid Fortran subroutines for the solution of sparse systems of nonlinear equations volume R 7293 of Harwell Report Harwell Laboratory Harwell 1972 86 Sag09 Sch96 Sch98 Sch09 510309 3 Sager Reformulations and algorithms for the optimization of switching decisions in nonlinear optimal control Journal of Process Control accepted 2009 V H Schulz Reduced SQP methods for large scale optimal contro
94. r expert users By manually changing the source code in hess_update cpp the following alternatives may be realized Update formula 43 BFGS updates by defining BFGS_UPDATE DFP updates by defining PSB_UPDATE PSB updates by defining PSB_UPDATE SR1 updates by defining SR1_UPDATE For the BFGS update there exist modifications to keep the Hessian matrices positive definite which may be selected by manually changing the source code in hess update cpp x Powell modification of the BFGS update by defining MOD_BFGS POWELL Swaney modification of the BFGS update by defining MOD_BFGS_SWANEY Nocedal modification of the BFGS update by defining MOD_BFGS_NOCEDAL e hess_limitedmemoryupdate Limited memory version of hess_update Only BFGS up dates are realized for this module For expert users You can choose the update modification and the initial scaling of the Hessian matriz by modifying the file hess_limitedmemoryupdate cpp in the same way as described for the module hess update Here you have the additional option whether the number of update vectors is set adaptively via the flag VARIABLE MEMORY or if a fixed maximum number is used The macros HAP LLIMIT and HAP ULIMIT provide lower and upper limits 8 4 Globalization Strategy For the calculation of SQP correction step the following shared objects are provided e solve_alf for the Schittkowski augmented line search e solve_fullstep to disable globalization and always p
95. refO xd 1 ref1 xd 1 ref1 j static void mfcn double ts double xsd double sa double xp double mval long dpnd long xinfo 1 if dpnd dpnd MFCN DPND 0 sd 0 0 return mval 80 2 extern C void def_model void def_mdims NMOS NP NRC NRCE def_mstage 0 NXD NXA NU mfcn NULL 0 0 0 NULL ffcn NULL NULL NULL def mio NULL NULL NULL j static void rdfcn e double ts double xsd double sa double xu double xp double pr double res long x dpnd long xinfo 1 if dpnd dpnd RFCN DPND ts 0 0 0 0 0 return res 0 ts 12 j extern C void def_model_ct void 1 long i LVec newnmos getNmos NMOS long nmos V EACC newnmos NMOS def mdims nmos NP NRC NRCE for i 0 i lt nmos 1 i 1 def_mstage i NXD NKA NU NULL NULL 0 0 0 NULL ffen NULL NULL NULL 7 def_mstage nmos 1 NXD NXA NU mfcn NULL 0 0 0 NULL ffcn NULL NULL NULL def_mpc nmos 1 End Point NPR 1 1 rdfcn e NULL def mio NULL NULL NULL j 66 Listing 4 MUSCOD II Apps MIP DAT lotka dat c Sebastian Sager 2003 X X of multiple intervals nshoot 0 60 shooting parameters P 0 0 4 0 2 p int 0 0 40 2 0 p sca 0 1 0 120 2 1 0 p min 0 0 0 0 0 2 0 0 p max 0 1 0 t 1 0 228 10 p fix 0 1 eI 2 1 model stage duration start values h 0 12
96. rvals on model stages LVec grid multiple shooting grids on model stages DVec default equal spacing of grid points nos start nsn start model stage start index and multiple shooting point start index for partial reoptimization long defaults O p 9 sca p min p max global model parameter start values scale factors and bounds DVec p fix global model parameter fixed value flags LVec if p fix i is 1 then parameter p i is fixed at its start value default no global model parameters fixed h h sca h min h max model stage duration start values scale factors and bounds DVec 30 h_fix model stage duration fixed value flags LVec if h_fix i is 1 then duration h i is fixed at its start value default no model stage durations fixed Is spec specification mode for state variable start values 1ong O all values sd sa specified in data file 1 only values sd S sa S and sd M 1 E sa M 1 E specified other values automatically generated by linear interpolation M denotes the number of model stages 2 only values sd 0 S sa 0 S specified other values automatically generated by integration 3 only values sd 0 S sa 0 S specified other values automatically generated by integration The integration will be repeated with the initial values replaced by the values at the end of the time horizon until a steady state is reached or the maximum number of s
97. ssian mssqp mhe gn Moving horizon estimation with a Gauf Newton approximation of the Hessian mssqp picard A Newton Picard algorithm Alpha stage usage strongly discouraged ODE DAE Solvers To control the solution of the ODE DAE system the following shared objects are provided Their individual capabilities are summarized in table ind daesol Our preferred variable order variable step size BDF method for stiff and non stiff ODE and DAE systems Use ind daesol spa for the sparse variante of DAESOL Use ind daesol prsqp or ind daesol spa prsqp if you use PRSQP ind rkf12 The 1st 2nd order Runge Kutta Fehlberg method ind rkf23 The 2nd 3rd order Runge Kutta Fehlberg method ind rkf45 Our preferred Runge Kutta solver the 4th 5th order Runge Kutta Fehlberg method ind rkf45adj The 4th 5th order Runge Kutta Fehlberg method currently the only solver capable of computing adjoint sensitivities Use ind rkf45adj spa for a sparse variant using TD12 ind rkf78 The 7th 8th order Runge Kutta Fehlberg method ind rkf7b A 7th 8th order Runge Kutta method by H G Bock ind rkfswt The 4th 5th order Runge Kutta Fehlberg method currently the only solver capable of treating implicitly discontinuous ODE systems ind strans Stage transition solver for multistage optimal control problems ind nullslv Null solver does nothing It can be used to define NLP Problems without any underlying dynamic system 42 In addition the followin
98. ssignment sign Only the last argument problem is mandatory as it determines the files to be used e DAT lt problem gt dat is the DAT file see section 7 1 e RES lt problem gt txt output files for detailed solution information e RES lt problem gt log chronological history of solution process e RES lt problem gt bin binary solution information for warm starts potentially incom patible across machines 38 The list of possible options depends on the global compilation flags cf appendix 4 2 2 When calling the executable muscod without any argument a brief list of possible options is shown The command line option help prints a detailed list of switches and options together with a quick reference and the default values Furthermore option values specified on the command line have precedence over those set in the DAT file akktacc Sets the termination criterion s acceptable KKT tolerance kktacc of the solution Example aie 6 which gives the default acc 1079 bcode Sets the MS MIN TOC strategy code see c w Warm Cold start after previous run of same problem Warm start uses all information from the previous RES bin file including the Hessian approximation The cold start uses only the attained variable values Note that it is possible to perform small changes in the DAT file between restarts e g concerning bounds or output specifications Di mensional changes are not allowed however Exam
99. straints can be specified by choosing different values for 2 e x lt l as in the case x gt 1 but the modeler replaced by 1 wy A similar formulation however model stage independent is used for global parameters via the flag p_int 11 2 Available algorithms Table 7 lists all possibilities to select different algorithms to solve a MIOCP The general concept is a little uncommon digits correspond to algorithms and their order determines the order of their execution from right to left For example 5 corresponds to a switching time optimization and 8 to the default rounding procedure Hence method 58 will first solve a relaxed problem that will always be done then apply the rounding procedure 8 to the result and use the rounded solution as starting value and fixed structure for the switching time optimization 10 As there are not enough digits for all algorithms this system is not always consistent unfortunately 586 means first 6 then 8 then 5 however 581 means first 81 then 5 54 column description Relaxed solution writes result into DAT opt dat Enumeration 10 Random integer solution 11 Lower bound solution 12 Upper bound solution 13 Internal use simulation modify mintoc cpp 20 2x 21 Branch and Bound default 241 without start heuristics with start heuristics x in 8 81 82 83 84 85 41 42 Wit
100. switches discontinuities in the states and or right hand side on model stage I swtdtcfcn is a mandatory pointer to the switch detection function called to detect switch conditions during integration while swtexecfcn is a mandatory pointer to the switch execution function called only if a switch actually happens 7 Data and Options MUSCOD II uses a keyword based data file for problem data input Furthermore this file is also used to override default values for algorithmic settings and options which in turn can again be overridden by command line options The order of data items in the problem data 5For the continuous least squares terms the local parameters mean an additional argument in contrast to the formulation used in subsections 2 4 and 3 4 now the local parameters are treated like piecewise constant controls each one used on the multiple shooting interval after the point it is originally defined for 27 file is relevant only in the sense that the first keyword match from the beginning of the file determines the data item which is read i e possible further keyword matches are ignored 7 1 Data and the DAT File Table 2 Correspondence between MUSCOD II data file notation and manual notation data file manual mathematical content nshoot Mi number of multiple shooting nodes on model stage i nstop i j n number of integrator stopping points on m s interval I sd i j Si differential multiple shooting
101. t level for printout to the screen or console Defaults to 0 options plevel file Sets the print level for printout to the text files Defaults to 1 The value can be overridden on the command line using the p option options plevel matlab Sets the print level for printout to the MATLAB log file Defaults to 0 The value can be overridden on the command line using the pmatlab option 7 6 Keywords for Visualization The following keywords influence the visualization of the optimal control problem s solution and of the solution progress There is no need to specify any of the keywords of this section in the DAT file if you don t want to options output ps Enables or disables the output of PGPLOT graphics to PostScript files options output gif Enables or disables the output of PGPLOT graphics to GIF files nhist number of values in objective parameter history plots long default O i e no objective parameter history plots plot first plot last index of first and last model stage to be visualized long defaults 0 and number of model stages minus one i e all model stages are visualized xd name xa name fu name h name p name state control duration and parameter name strings StrVec note if the first nonspace character of the string is the corresponding variable will not be plotted if it is gt a new graphics window will be opened a leading switches to logarithmic plotting Greek letters can b
102. t of the optimization as starting point This file is generically named DAT name_opt dat Note that also several opt may be concatenated This file may then in turn be used for restarts possibly with slightly modified bounds e g in homotopies for a repetition of plotting the optimal solution in a time efficient manner and the like 9 4 Matlab Logging MUSCOD II can export internal data to Matlab This includes not only the results of the computations but also most of the intermediate steps for each iteration of the full computation The main purpose of the Matlab logging capabilities is to exploit the flexibility of Matlab for investigating bad convergence behavior in the Multiple Shooting SQP method The full range of numerical tools can be exploited e g to calculate projected Hessians and their eigenvalues which can lead to insight about violated assumptions like LICQ or positive definiteness of the projected Hessian This may give rise to clues for a reformulation of the underlying optimization problem Additionally the user may also find the flexibility of Matlab s visualization tools helpful However MUSCOD II can slow down considerably when large amounts of data have to be logged which is why Matlab logging is disabled by default in the MUSCOD II suite 50 Reconfiguring the suite We assume that you have checked out a fresh suite and have it configured and compiled with bootstrap The procedure to enable Matlab logging is the foll
103. t pgplot An even more flexible way to plot any function of states and controls possibly also in a time dependent movie like manner is given by a problem dependent usage of the PLOT module We refer here to examples that serve best to illustrate the broad applicability e MIP lotkaindirekt additional plotting of a switching function and an implicitely de 49 termined control e MIP robotpath 2d spatial and time dependent visualization of robot positions with underlying prescribed trajectories output to movie e MIP smb super 1d spatial and time dependent visualization of concentration profiles with text and numbers output to movie e MIP urethan and MIP vpbimolcat plotting of optimum experimental design sampling decisions on a discrete time grid transition stages only e MIP oberle zoom into small region in time of interest e TEST chainid 1d spatial and time dependent visualization of controlled chain of masses e TEST parest Visualization of fitting a model to measurement data 9 3 Result Files By default several files will be written to the RES subdirectory e RES name txt detailed solution information e RES name log chronological history of solution process e RES name bin binary solution information for warm starts e RES name ps if switched on a postscript or gif file of the online graphics Furthermore by using any b option compare Section for example b0 a new dat file will be written with the resul
104. tain value a 0 for each conventional value rob_may Selects the Mayer type objective functions one per model stage to be robustified against uncertainty of the selected initial values and or parameters Set a 1 if the Mayer type objective on the selected stage is to be robustified a 0 if not Default 0 rob_rd 33 Selects the decoupled point constraints to be robustified against uncertainty of the selected initial values and or parameters Set a 1 for each constraint on the selected stage and node that is to be robustified Default all 0 rob_cov_sd0 rob_cov_sd0_p rob_cov_p Sets the covariance submatrices 2 RM Drop IR and Xp that form the overall covariance matrix 2 gt y XO L0 T0 p a op Default X Id i e Les Id 2pp Id rob_gamma Set the overal scale factor for the penalties on objective and residuals computed from the linearizations double Defaults to 1 0 7 3 Keywords Selecting Dynamically Loadable Modules The following keywords define the algorithm used to solve the solve the optimal control problem For the names and a description of all available modules refer to section 8 All settings may be overridden on the command line see section 7 7 libmodel Selects the model library compiled from the model source file Defaults to the name of the DAT file libhessian Selects the hessian algorithm module D
105. than 9999999 by design of QPOPT disable the EX PAND strategy This option only has an effect if the QP solver module qps qpopt is loaded options qp itmax Sets the maximum number of iteration of the QP solver per SQP itera tion Defaults to 10000 The value can be overridden on the command line using the qp itmax option options sflag Stop after each SQP iteration and wait for a keystroke The value can be overridden on the command line using the s option options wflag Warm start after previous run of same problem Warm start uses all informa tion from the previous RES bin file including the Hessian approximation Note that it is possible to perform small changes in the DAT file between restarts e g concerning 36 bounds or output specifications Dimensional changes are not allowed however Default no warm start The value can be overridden on the command line using the w option options iest hess plitt Another choice to be taken by the user is the initial scaling of the Hessian matrix either according to Plitt by setting the value to true or as a unit matrix by setting it to false Default true 7 5 Keywords Setting Output Options Keywords from this section control how much information is written to the console and to text files in the RES directory during the solution process There is no need to specify any of the keywords of this section in the DAT file if you don t want to options plevel screen Sets the prin
106. the differential states themselves modify them from within swtexecfcn rfcn ts sd sa u p pr res dpnd info This function describes the decoupled and coupled interior point constraints Double pointer ts contains the time point at the multiple shooting node where the function is evaluated Double pointers sd sa u and p hold the differential and algebraic node values the control node values and the parameter values respectively Interior point constraints may use separate local parameter values which are provided by double pointer pr Upon return of the function call double pointer res should be filled with the interior point constraint residuals Double pointer dpnd holds information about the dependencies of the functions w r t the input variables The user should start each implementation of an interior point constraint with 24 if dpnd dpnd RFCN DPND ts sd sa u p pr return where arguments of RFCN_DPND which are not used in the function should be set to NULL Long pointer info should contain the error code after evaluation as usual mfcn ts sd sa p mval dpnd info This function represents a Mayer type objective function Double pointer mval should contain the Mayer objective value after evaluation The other arguments have the same meaning and usage as the corresponding arguments in the interior point constraints lfcn t xd xa u p lval rwh iwh info This function represents a Lagrange ty
107. the subintervals t t 1 7 0 1 M 1 On each of these intervals the corresponding system state is described by the differential and algebraic state vectors z f IR and z t IR The system behaviour is controlled by the control vectors u t IR and the global design parameter vector p R 4 On each of the model stages the system obeys a differential algebraic equation Bi t xi t zi t w t quilt filt a t z t u t p te TERNI 0 3 e gt Pr 3 ES PA cK nn N RS mn S S lt cK wn 3 Nr 00 with the matrix function B in IR and the derivative IR YN invertible such that the linear implicit DAE is of semi explicit type and of index One The duration h tizi t of model stage may be variable The end value of the differential state on stage i z t 1 is determined completely by the initial value z t the control trajectory u and the global parameters p and the duration h 2 1 Transition between Model Stages Between model stages continuity of the differential states is required by default Tigi tit1 vita Therefore the differential dimensions do not change n7 nj Jumps in the differential states and even dimension changes can be implemented by a special type of model stage called transition stage A transition stage with index 7 replaces the DAE integration for the determination of the final state
108. ther arguments are the same as for the differential right hand side 22 source file manual mathematical content NMOS M number of model stages NP n number of global parameters NRC mie number of global coupled constraints NRCE nee number of global coupled equality constraints The first NRCE of the total number NRC of coupled constraints are de fined to be equality constraints rcfcn T coupled multi point constraint function NXD ns number of differential states on model stage 1 xd Ti differential state vector on model stage i sd Si differential node value on model stage 1 at node 7 NXA n number of algebraic states on model stage 1 xa Zi algebraic state vector sa Si algebraic node value on model stage 1 at node j NU n number of controls on model stage 1 NRD nt number of decoupled constraints for specific constraint func tion at time tz NRDE pres number of decoupled equality constraints at time tg The first NRDE of the total number NRD of decoupled constraints are defined to be equality constraints rdfcn ri decoupled interior point constraint function NPR ny number of local constraint parameters for constraint point fj pr Di local constraint parameter vector afcn Di invertible matrix in semi explicit DAE formulation on model stage 1 By default B z II ffcn fi differential right hand side function on model stage 1 ftrans Ci transition function on model stage i Same syntax as ffcn gfcn gi algebr
109. tivity Lim H C Tayeb Y J Modak J M Bonte P Computational algorithms for optimal feed rates for a class of fed batch fermentation numerical results for penicillin and cell mass production Biotechn Bioengng 28 p 1408 1420 1986 fedbat4 Fed batch fermentor case IV Cuthrell J E Biegler L T Simultaneous optimization and solution methods for batch reactor control profiles Comp Chem Engng 13 p 49 62 1989 freudenstein This is a modell of the Freudenstein Roth function see Fletcher Roger Practical methods of optimization Chichester et al 1987 p 120 ftlos1 Fixed time linear oscillating system I Logsdon J S Biegler L T Decomposition strate gies for large scale dynamic optimization problems Chem Engng Sci 47 p 851 864 1992 ftlos2 Fixed time linear oscillating system II Logsdon J S Biegler L T Decomposition strate gies for large scale dynamic optimization problems Chem Engng Sci 47 p 851 864 1992 ftlos2 nlp The problem ftlos2 in NLP formulation eliminated states ftlos3 Fixed time linear oscillating system III Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimization problems Chem Engng Sci 47 p 851 864 1992 ftlos4 An indirect approach maximum principle to the fixed time linear oscillating system Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci
110. tuff The name of the target dir here MUSCOD SUITE can be chosen arbitrarily If you cannot access the SimOpt subversion server either contact our system administrator in the case you are a group member or your SimOpt cooperation partner if you are not a group member 4 1 3 Structure In its minimal version the suite has the following directory structure e MUSCOD_SUITE Root folder of the MUSCOD II suite name arbitrary Apps MUSCOD II applications problem dependent code and data AuxScripts Auxiliary shell scripts Packages Software packages used by MUSCOD II MC2 The package MUSCOD II itself problem independent code bootstrap Installation script for the whole MUSCOD II Suite cleanup Convenience script for removing files created by bootstrap make clean LICENSE License README Basic information VERSION Version The directories MC2 Packages Apps all have a similar structure to facilitate the separation of source files which are also in the repository and configuration and compiled files also called binary files which only exist on the local machines Thus one can have one source but several differently configured or compiled versions of MUSCOD II generated from the same source The source files are all contained in the Src subdirectory e g MUSCOD_SUITE MC2 Src Typically binary files are in directories Debug in the case of a compilation with debug in formation
111. ut an compiler warning These warnings are not of importance neither for the developers nor for the users and can some times be quite disturbing Therefor the compiler warnings for these individually checked files can be deactitaved by setting the MC2_FORGET_KNOWN_COMPILER_WARNINGS in the file user mk to YES This is also the default behavior 4 4 Compatibility of Compilation Flags Here are listed some known imcompatibilities between different compilation flags e NC Are incompatible and will not compile together e PW Partially working Will compile together but some functionality of either of one is not provided in some cases List of Imcompatibilities NC PRSQP and EXTPRSQP PW CLSQ and EXTPRSQP eval_clsq not evaluated in rkfXX and DAESOL II 20 5 How to set up a problem In order to solve an optimal control problem with the stand alone version of MUSCOD II two files have to be prepared by the user a C or Fortran 77 file which defines the model equations objective differential equations constraints and an ASCII file which contains the correponding problem data e g initial guesses scaling factors bounds 1 Model Source File Here the model equations are defined either as ANSI C functions or as Fortran 77 subroutines In addition to these routines a function or subroutine def model must be provided in which the multistage optimal control problem is for mally defined The model file must
112. way takes 7 p 6 percent tax of everything capital and labour bonds influence government capital Make sure you modify NSHOOT in both DAT and C file macro Optimal growth model extended as to macro4 with split up of the worker now two generations young and old Make sure you modify NSHOOT in both DAT and C file nlbat Batch reactor nonlinear in states Ray W H Advanced Process Control New York 1981 Renfro J G Morshedi A M Asbjornsen O A Simultaneous optimization and solu tion of systems described by differential algebraic equations Comput Chem Engng 11 p 503 517 1987 Logsdon J S Biegler L T Decomposition strategies for large scale dynamic optimiza tion problems Chem Engng Sci 47 p 851 864 1992 nlp1 Standard NLP test example I Gill P E Murray W Wright M H Practical Opti mization London et al 2006 nlp2 Standard NLP test example II See Harwell Subroutine Library Specification subroutine VF13 nlp3 Standard NLP test example III Reklaitis G V Ravindran A Ragsdell K M Engi neering Optimization Methods and Applications 1983 nlp4 Standard NLP test example IV Reklaitis G V Ravindran A Ragsdell K M Engi neering Optimization Methods and Applications 1983 nmpcl Simple NMPC problem optcar lego Optimal control for little car built with LEGO Results can be obtained by calling first mc2ts optcar and then mc2ts c optcar
113. ypes in parallel by adding export PATH PATH HOME MUSCOD_SUITE MC2 Debug bin to your bashrc mailto agbock_mc2_developerCiwr uni heidelberg de To remove the files of a lt build_type gt installation just type nameOmachine MUSCOD SUITE cleanup btype build type Install To System It is possible to install the packages to subfolders of a central location from where it can be used by every regular user The install procedure is identical to the one described above except that the installation path prefix e g use local has to be specified nameGmachine MUSCOD SUITE bootstrap ipref lt prefix gt Depending on their type files are installed to different subfolders gt lt prefix gt bin executables gt lt prefix gt lib static a and shared so libraries on 32 bit platform gt lt prefix gt 1ib64 static a and shared so libraries on 64 bit platform gt lt prefix gt share lt package gt other data related to lt package gt Attention Applications for MUSCOD II and MUSCOD II itself are never installed to a dir other than MUSCOD_SUITE Apps lt app gt lt build_type gt After a successful installation the suite dir could be removed But mind the note above and do not delete your applications Deinstallation has to be done manually Installation logs are provided at least by the CMake packages in their respective binary dirs Usage with other Software Suites I
114. z files you need to install WinZip Download a free eval uation version of WinZip from http www winzip com if necessary As of writing this document the file in question is named winzip100 exe MinGW and MSYS The GNU toolsets headers and libraries as well as a linux like shell are freely available from http www mingw org Download from the following files or their appropriate newer releases from the Current section binutils 2 15 91 20040904 1 tar gz gcc core 3 4 2 20040916 1 tar gz gcc gtt 3 4 2 20040916 1 tar gz gcc g77 3 4 2 20040916 1 tar gz 1 2 3 4 9 gdb 5 2 1 1 exe 6 ningw runtime 3 9 tar gz 7 mingw32 make 3 80 0 3 exe 8 w32api 3 5 tar gz 9 tcltk 8 4 1 1 exe 10 MSYS 1 0 11 2004 04 30 1 exe from the Snapshot section 57 GrWin PGPLOT support for Windows download from http spdgi sci shizuoka ac jp grwinlib english download html the file 1 1GrWn0999be MinGW exe or an appropriate newer release LAPACK Download the LAPACK archive from http www netlib org lapack lapack tgz MUSCOD II MUSCOD II can be found in the workgroup s subversion repository Follow the steps precisely as listed below Especially make sure to e properly distinguish slashes from backslashes V e perform all the actions using Windows unless you re told to launch an MSYS shell and do things from there 12 0 2 Installing WinZip 1 Download and start the WinZip executable and follow the instal
Download Pdf Manuals
Related Search
Related Contents
2014年3月 公開 Dataflex ViewMate-i Pole Extension Samsung SP-43L2HX/HAC راهنمای محصول SE-S10 - Support SoftWall Finishing Systems SW323077010 Instructions / Assembly Conceptronic USB Multi Tip Power Pack 2200mAh Mode d`emploi OSM Combined Brochure OSM15-27-38 (Spanish) Copyright © All rights reserved.
Failed to retrieve file