User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET...

54
T ECHNISCHE U NIVERSIT ¨ AT DARMSTADT FACHGEBIET S IMULATION UND S YSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method for the Numerical Solution of Optimal Control Problems Oskar von Stryk Version 2.1 of November 1999

Transcript of User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET...

Page 1: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

TECHNISCHE UNIVERSITAT DARMSTADT

FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM)

User’s Guidefor�A Direct CollocationMethodfor theNumericalSolutionof

OptimalControlProblems

OskarvonStryk

Version2.1 of November1999

Page 2: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method
Page 3: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

i

Abstract

Thisreportformstheuser’sguidefor Version2.1of ��������� , asetof Fortransubroutinesdesignedto solve optimal control problemsof systemsdescribedby (first order)ordinarydifferential equationssubjectto generalinequality or equality constraintson the controland/orstatevariables. Discontinuitiesin the right handsideof the differentialequationscanbe treatedas well asmulti-phaseproblems. The usermust provide subroutinesthatdefinetheobjective andtheconstraintfunctions.Subroutinesfor derivativesof theproblemfunctionsarenot required.������� �� is a directcollocationmethod[39]: By a discretizationof stateandcontrolvariablesthe infinite dimensionaloptimal control problemis transcribedinto a sequenceof (finite dimensional)nonlinearlyconstrainedoptimizationproblems(NLPs). OptimalControl Theory and adjoint differential equationsare not requiredin order to apply thealgorithm. The NLPs aresolved eitherby the denseSequentialQuadraticProgramming(SQP)methodNPSOL (Gill, Murray, Saunders,and Wright [12]) or by the sparseSQPmethodSNOPT(Gill, Murray, andSaunders[11], Version5.3-4or higher).������� �� alsocomputesreliableestimatesof theadjointvariables,themultiplier func-tionsof stateconstraintsandtheswitchingstructure.Thereforethemethodcanconvenientlybecombinedwith anindirectmethodsuchasmultiple shooting[40].

Supplementaryprogramsareprovided for supportinga visualizationof the numericalresults.

A Note for Potential Users

Theuser’s guidedoesnot replacecoursesin OptimalControlTheoryandNumericalAnal-ysis.As any othernumericalmethodfor optimalcontrol, ������� �� will beusedmosteffi-cientlyby a userhaving backgroundknowledgein OptimalControlTheoryandNumericalAnalysis,especially, numericalsolution of ordinarydifferential equationsandnumericalnonlinearlyconstrainedoptimization.

Bugsand Comments

Pleasereportbugsor commentsto stryk@informatik .t u- darms ta dt .d e. Alsoany reportsonexperiences(goodor bad),suggestionsfor improvementsor complaintscon-cerningtheprogramor thisuser’s guidearewellcome!

Address

TechnischeUniversitat DarmstadtFachbereichInformatik (Departmentof ComputerScience)FachgebietSimulationundSystemoptimierung(SimulationandSystemsOptimizationGroup)Prof. Dr. Oskarvon StrykD-64283Darmstadt,GermanyPhone:Germany + 6151-16-4899Fax: Germany + 6151-16-6648Electronic-mail:stryk@informat ik .t u- dar msta dt .d eWorld Wide Web: http://www.sim.informatik.tu-darmsta dt.de /sw/d ircol/

DIRCOL-2.1User’s Guide November1999

Page 4: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

ii

�����������LicenseTermsand Conditions

Thesoftware ������� �� is not in thepublicdomain.However, it is availablefor licensesubjecttothefollowing terms.

(i) The ”Software”, below, refersto ������� �� (in eithersource-code,object-codeor execu-table-codeform) which includesall supplementarysoftwareprovided, ”work basedon theSoftware” meansa work basedon either the Software,on part of the Software,or on anyderivativework of theSoftwareundercopyright law: thatis,awork containingall or aportionof ��������� , eitherverbatimor with modifications.Eachlicenseeis addressedas”you”or ”Licensee”.

(ii) This licenseappliesto you only if you are a memberof a noncommercialand academicinstitution,e.g.,a university. The licenseexpiresassoonasyou areno longera memberofthis institution.

The Softwaremay be usedfor for academicpurposesonly, suchasresearch.You arenotallowedto youuseit for any commercialpurposes.

(iii) All copyrights are reserved by TechnischeUniversitat Darmstadt,the FachgebietSimula-tion undSystemoptimierung,andtheauthorsexceptthoseexpresslygrantedto theLicenseeherein.

(iv) LicenseeshallusetheSoftwaresolelywithin Licensee’sorganization.Permissionto copy theSoftwarefor usewithin Licensee’s organizationis herebygrantedto Licensee,providedthatthe copyright noticeandthis licenseaccompany all suchcopies. Licenseeshall not permitthe Software,or sourcecodegeneratedusing the Software, to be usedby personsoutsideLicensee’sorganizationor for thebenefitof third parties.Licenseeshallnot have theright torelicenseor sell theSoftwareor to transferor assigntheSoftwareor sourcecodegeneratedusingtheSoftware.

(v) If youmodify acopy or copiesof theSoftwareor any portionof it, thusformingawork basedon the Software,andmake and/ordistribute copiesof suchwork within your organization,you mustmeetthefollowing conditions:

a) You must causethe modified Software to carry prominentnoticesstating that youchangedspecifiedportionsof theSoftware.

b) If you make a copy of theSoftware(modifiedor verbatim)for usewithin your organi-zationit mustincludethecopyright noticeandthis license.

(vi) NeitherTechnischeUniversitatDarmstadt,theFachgebietSimulationundSystemoptimierung,nor any of their employeesmake any warranty, expressor implied, or assumesany legal li-ability or responsibilityfor the accuracy, completeness,or usefulnessof any information,apparatus,product,or processdisclosedandcoveredby a licensegrantedunderthis licenseagreement,or representsthatits usewouldnot infringe privatelyownedrights.

(vii) In noeventwill TechnischeUniversitatDarmstadt,theFachgebietSimulationundSystemop-timierung,norany of their employeesbeliable for any damages,includingdirect,incidental,special,or consequentialdamagesresultingfrom exerciseof this licenseagreementor theuseof thelicensedsoftware.

(viii) Licenseeagreesto acknowledgeuseof theSoftwarein any documentreferencingwork basedon theSoftware,suchaspublishedresearch.

Also, you areto notify TechnischeUniversitat Darmstadt,FachgebietSimulationundSyste-moptimierung,of publisheddocumentsreferencingwork basedonthesoftware,andsupplyacopy of thedocumentto TechnischeUniversitat Darmstadt,FachgebietSimulationundSys-temoptimierung.

DIRCOL-2.1User’s Guide November1999

Page 5: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

Contents iii

Contents

Abstract i����� �"!$#LicenseTermsand Conditions ii

1 Purpose 11.1 Basicoptimalcontrolproblem . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Generalproblemformulation . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2.1 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2.2 Differentialequations. . . . . . . . . . . . . . . . . . . . . . . . . 51.2.3 Conditionsat initial, final andswitchingtimes. . . . . . . . . . . . 6

1.2.3.1 Explicit formulation . . . . . . . . . . . . . . . . . . . . 61.2.3.1.1 Explicit formulationof thefirst kind . . . . . . 61.2.3.1.2 Explicit formulationof thesecondkind . . . . . 7

1.2.3.2 Implicit formulation . . . . . . . . . . . . . . . . . . . . 71.2.4 Inequalityconstraints. . . . . . . . . . . . . . . . . . . . . . . . . 8

1.2.4.1 Upperandlowerbounds. . . . . . . . . . . . . . . . . . 81.2.4.2 Nonlinearinequalityconstraints. . . . . . . . . . . . . . 9

1.2.5 Equalityconstraints. . . . . . . . . . . . . . . . . . . . . . . . . . 91.3 Otherproblemformulations . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3.1 BolzaandLagrange-typeobjectives . . . . . . . . . . . . . . . . . 101.3.2 Integral-typeconstraints . . . . . . . . . . . . . . . . . . . . . . . 101.3.3 Min-maxobjectives. . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.4 Higherorderdifferentialequations. . . . . . . . . . . . . . . . . . 111.3.5 DAEsandimplicit differentialequations. . . . . . . . . . . . . . . 12

2 ExampleProblems 132.1 Survey of theexampleproblems . . . . . . . . . . . . . . . . . . . . . . . 132.2 A minimumenergy problem . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.2.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 152.2.2 minimum energy : thestandardformulation . . . . . . . . . . . 162.2.3 minimum energy demo: formulationfor demonstration. . . . . 17

2.3 One-dimensionalascentof a rocket . . . . . . . . . . . . . . . . . . . . . . 182.3.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 182.3.2 onedim rocket : thestandardformulation . . . . . . . . . . . . 192.3.3 onedim rocket demo: formulationfor demonstration . . . . . 20

2.4 Catalystmixing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.4.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 212.4.2 catalyst mixing ode : theODEformulation . . . . . . . . . 222.4.3 catalyst mixing dae : theDAE formulation. . . . . . . . . . 23

2.5 Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.5.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 252.5.2 pendulum : thestandardformulation . . . . . . . . . . . . . . . . 26

2.6 Minimum noisedesignof anoscillator . . . . . . . . . . . . . . . . . . . . 282.6.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 282.6.2 oscillator : thestandardformulation . . . . . . . . . . . . . . 29

2.7 Optimalpathtrackingfor asimplerobot . . . . . . . . . . . . . . . . . . . 31

DIRCOL-2.1User’s Guide November1999

Page 6: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

iv Contents

2.7.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 312.7.2 robot i2 : thestandardformulation . . . . . . . . . . . . . . . . 31

2.8 Abort landingin thepresenceof awindshear . . . . . . . . . . . . . . . . 332.8.1 Problemdescription . . . . . . . . . . . . . . . . . . . . . . . . . 332.8.2 windshear : thestandardformulation . . . . . . . . . . . . . . . 36

2.9 Optimalpoint-to-pointtrajectoriesof a3-d.o.f. industrialrobot . . . . . . . 382.9.1 Minimum time trajectory:problemdescription . . . . . . . . . . . 382.9.2 manutec minimum time : thestandardformulation . . . . . . . 382.9.3 Minimum energy trajectory:problemdescription . . . . . . . . . . 382.9.4 manutec minimum energy : thestandardformulation . . . . . 38

2.10 Referencesto otherapplicationsof DIRCOL . . . . . . . . . . . . . . . . . 39

3 Brief Description of the Algorithm 403.1 Discretization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403.2 Nonlinearoptimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

3.2.1 First orderoptimality conditions . . . . . . . . . . . . . . . . . . . 443.2.2 Brief descriptionof SQPmethods . . . . . . . . . . . . . . . . . . 453.2.3 Terminationcriteriaof NPSOL. . . . . . . . . . . . . . . . . . . . 463.2.4 Terminationcriteriaof SNOPT. . . . . . . . . . . . . . . . . . . . 46

3.3 Accuracy checksandgrid refinement. . . . . . . . . . . . . . . . . . . . . 473.3.1 Objective andoptimalityerror . . . . . . . . . . . . . . . . . . . . 473.3.2 Errorsin thedifferentialequations. . . . . . . . . . . . . . . . . . 483.3.3 Errorsin thenonlinearconstraints . . . . . . . . . . . . . . . . . . 493.3.4 Grid refinement. . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.3.5 Movablegrid points . . . . . . . . . . . . . . . . . . . . . . . . . 49

3.4 Flow chartof DIRCOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513.5 Estimatesof adjointvariables. . . . . . . . . . . . . . . . . . . . . . . . . 53

4 How to UseDIRCOL 544.1 Preparingtheproblem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

4.1.1 Formulationof theoptimalcontrolproblem . . . . . . . . . . . . . 544.1.2 Additional boxconstraintson % , & , ' , and ( . . . . . . . . . . . . . 544.1.3 Scalingof variablesandfunctions . . . . . . . . . . . . . . . . . . 55

4.1.3.1 Why scalingcanbeimportant . . . . . . . . . . . . . . . 554.1.3.2 How scalingby lineartransformationsdoeseffecttheprob-

lem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554.1.3.2.1 Scalingof ) , * and +-, . . . . . . . . . . . . . 554.1.3.2.2 Scalingof theobjective . . . . . . . . . . . . 564.1.3.2.3 Scalingof thenonlinearconstraintfunctions/ ,0

, and 1 . . . . . . . . . . . . . . . . . . . . . 574.1.3.3 Availableoptionsfor scaling . . . . . . . . . . . . . . . 58

4.2 User-suppliedsubroutinesandinput files . . . . . . . . . . . . . . . . . . . 594.2.1 Input files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

4.2.1.1 Input file DATDIM . . . . . . . . . . . . . . . . . . . . 604.2.1.2 Input file DATLIM . . . . . . . . . . . . . . . . . . . . . 684.2.1.3 Input file DATGIT (optional) . . . . . . . . . . . . . . . 714.2.1.4 Input file DATSKA (optional) . . . . . . . . . . . . . . . 724.2.1.5 Input filesGDATX andGDATU (optional) . . . . . . . . 74

DIRCOL-2.1User’s Guide November1999

Page 7: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

Contents v

4.2.2 Subroutines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754.2.2.1 SubroutineDIRCOM for initializing user-suppliedCom-

monblocks. . . . . . . . . . . . . . . . . . . . . . . . . 764.2.2.2 SubroutineUSRDEQfor thedifferentialequations2%�3547698;: 774.2.2.3 SubroutineUSROBJfor theobjective < . . . . . . . . . 784.2.2.4 SubroutineUSRNBCfor thenonlinearboundaryandswitch-

ing conditions . . . . . . . . . . . . . . . . . . . . . . . 794.2.2.5 SubroutineUSRNICfor thenonlinearinequalityconstraints= 6>%@?A&B?C'B?AD�:FEHG . . . . . . . . . . . . . . . . . . . . . . 814.2.2.6 SubroutineUSRNECfor thenonlinearequalityconstraintsI 6>%@?A&B?C'B?AD�:J3KG . . . . . . . . . . . . . . . . . . . . . . 824.2.2.7 SubroutineUSRSTVfor the initial estimatesof % , & , ' ,

and ( . . . . . . . . . . . . . . . . . . . . . . . . . . . 834.3 Outputfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

4.3.1 Outputfile DATRESfor a resume andprotocolof theoptimization. 854.3.2 Output file DATGIT for the (normalized)grid points of the dis-

cretization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864.3.3 Outputfile DATSKA for thelineartransformationsusedfor internal

scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 864.3.4 Outputfile GDATX for thestateapproximation)ML�NON . . . . . . . . 874.3.5 Outputfile GDATU for thecontrolapproximations*PL�NON , Q . . . . 874.3.6 Outputfile GDATD for thecomputedlocalerrorestimates. . . . . 874.3.7 Outputfile GDATL for theestimatesR7L�NON of adjointvariables . . . 874.3.8 Outputfile GDATM for the estimatesSTL�NON of multipliers of con-

straints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874.4 Thefirst approximationof thesolution . . . . . . . . . . . . . . . . . . . . 88

4.4.1 Preliminariesandfirst stepsusingDIRCOL . . . . . . . . . . . . . 884.4.1.1 Understandingtheexampleproblems. . . . . . . . . . . 884.4.1.2 Formulatingandimplementingtheproblemto besolved . 884.4.1.3 Testingtheinitial estimatesof ) , * , Q , and U . . . . . . 894.4.1.4 Checkingtheinternaldimensions. . . . . . . . . . . . . 90

4.4.2 Thefirst optimizationrunandtheinformationparameterIFAIL . . 914.4.2.1 Interpretingtheresultof thecall to NPSOL. . . . . . . . 914.4.2.2 Interpretingtheresultof thecall to SNOPT. . . . . . . . 92

4.4.3 Interpretingtheprintedoutputof theSQPmethod. . . . . . . . . . 934.4.3.1 Printedoutputof NPSOL . . . . . . . . . . . . . . . . . 934.4.3.2 Printedoutputof SNOPT . . . . . . . . . . . . . . . . . 94

4.4.4 Whatcango wrongandwhy andhow to resolve it . . . . . . 954.4.4.1 Checkpointsfor troubleshooting . . . . . . . . . . . . . 954.4.4.2 Additional features: feasibility phaseand variablegrid

points . . . . . . . . . . . . . . . . . . . . . . . . . . . 974.4.4.3 Tabulardataandfinite differencegradientapproximations 98

4.5 Improving thesolutionby grid refinement . . . . . . . . . . . . . . . . . . 994.6 Visualizationof results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

4.6.1 ProgramDGNU: VisualizationusingGnuplot . . . . . . . . . . . . 1024.6.2 ProgramDGRAF:VisualizationusingtheLRZ-graphicslibrary . . 1034.6.3 SubroutineUSRFCNfor visualizinguser-definedfunctions. . . . . 104

4.7 Advancedfeatures,supplementaryprograms. . . . . . . . . . . . . . . . . 106

DIRCOL-2.1User’s Guide November1999

Page 8: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

vi Contents

4.7.1 Optimizingtheswitchingstructureof inequalityconstraints . . . . 1064.7.2 SubroutinesDIROLDX, -U, -L for readingfrom filesGDATX, -U, -L1074.7.3 ProgramDIRPATCH for patchingseveral GDATX (or GDATU)

files into asingleone . . . . . . . . . . . . . . . . . . . . . . . . . 1084.7.4 ProgramDIRCAD for computingestimatesof adjointvariableson

stateconstrainedsubarcs. . . . . . . . . . . . . . . . . . . . . . . 109

References 110

A Installing DIRCOL on local systemsand hardware 115A.1 Systemrequirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115A.2 InstallingtheDIRCOLfiles . . . . . . . . . . . . . . . . . . . . . . . . . . 116A.3 Systemdependentconstantsandsubroutines. . . . . . . . . . . . . . . . . 117

A.3.1 Machineconstantsandinput/outputunits . . . . . . . . . . . . . . 117A.3.2 Environmentvariables,compilersandpaths . . . . . . . . . . . . . 117A.3.3 Timeanddate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

A.4 Installingandlinking theSQPmethod(s). . . . . . . . . . . . . . . . . . . 119A.4.1 Both SNOPTandNPSOLsourcecodesavailable . . . . . . . . . . 119

A.4.1.1 Changesin theNPSOLinstallation . . . . . . . . . . . . 119A.4.1.2 Changesin theSNOPTinstallation . . . . . . . . . . . . 121

A.4.2 UsingtheNAG versionE04UCFof NPSOL. . . . . . . . . . . . . 122A.4.3 Only NPSOL(or E04UCF)available,SNOPTnotavailable . . . . 123A.4.4 Only SNOPTavailable,NPSOL(or E04UCF)notavailable . . . . 123A.4.5 Linking andcallingbothSNOPTandNPOPT. . . . . . . . . . . . 124

A.5 Tailoring theinternaldimensionsof DIRCOL(thefile dircol.h ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

A.6 Compilingthesourcecodeof DIRCOL. . . . . . . . . . . . . . . . . . . . 125

B Running DIRCOL 126B.1 Runningtheexampleproblems. . . . . . . . . . . . . . . . . . . . . . . . 127B.2 Preparinganew problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

C Notifyable changesto earlier versionsof DIRCOL 129

DIRCOL-2.1User’s Guide November1999

Page 9: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

List of Tables vii

List of Tables

2.1 Dimensionsof theexampleproblems. . . . . . . . . . . . . . . . . . . . . 13

4.1 Survey of theuser-suppliedinputfilesof ������� �� . . . . . . . . . . . . . 604.2 Survey of theuser-supplied(problemdependent)subroutinesof �����V� �� ,

DGRAF, DGNU, andDIRCAD (providedin file user.f ). . . . . . . . . . 754.3 Survey of theoutputfilesof ������� �� . . . . . . . . . . . . . . . . . . . . 854.4 Survey of theproblemdependentsubroutinesandinput filesof DGNU and

DGRAF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

List of Figures

1.1 A problemwith WVXY3KZ phasesand W[35\ events. . . . . . . . . . . . . . 2

2.1 Optimalstate%]6>D�: of theminimumenergy problemin thecaseof anupperboundof ^B3�_a`cbd35Ge8f_O_O_O_M8-8-8 . . . . . . . . . . . . . . . . . . . . . . . . 15

2.2 Theone-dimensionalascentof asimplerocket. . . . . . . . . . . . . . . . 182.3 �����V� �� solutionof the catalystmixing problemfor 51 equistantgrid

points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.4 Statevariablesof thependulum. . . . . . . . . . . . . . . . . . . . . . . . 252.5 �����V� �� solutionto thependulumproblemfor 51equistantgrid points. . 272.6 Equivalentcircuit of thevan-der-Pol-oscillator. . . . . . . . . . . . . . . . 282.7 Historyof thealtitude

I 6>D�: of thepassengeraircraftversusrange%]6>D�:(computed solutions of ������� �� (– g – g –) and multiple shooting(———)) [39]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

2.8 Horizontalandverticalcomponentsof thewind velocity. . . . . . . . . . . 35

3.1 Grid points 6>D9hiO: , jk3l_c?-8-8-8a?AmBn@o h , p�3q_c?srt?sZ , of the discretizationof aproblemwith threephases.. . . . . . . . . . . . . . . . . . . . . . . . . . 40

3.2 Discretizationof controlandstatevariablesby piecewisepolynomialfunc-tions.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

3.3 An exampleof thedefectsuv6Cw�: of thedifferentialequations. . . . . . . . . 483.4 Flow chartof �����V� �� . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

4.1 User-suppliedsubroutinesandinputfiles of ��������� . . . . . . . . . . . 59

DIRCOL-2.1User’s Guide November1999

Page 10: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

Significantchangesaswell asnew optionsin boththeprogramandtheuser’sguidenewly availablewith Ver-sions2.0 and2.1 whencomparedto Versions1.2 and1.3

areemphasizedin thetext by amark xzy|{~}A} at theleft orright margin of thecorrespondingpageof theuser’sguide.

Page 11: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

1 Purpose 1

1 Purpose

�����V� �� is a collectionof Fortran77 subroutinesfor solvingoptimalcontrolproblems.Thecodeis suppliedwith a mainprogram.To tackleanoptimalcontrolproblemnumeri-cally using ������� �� , alreadypreparedproblemdependentsubroutinesandinputfilescanbeused(seeSection4.2for details).

Beforethe generaldescriptionof optimal control problemstreatableby the algorithmis given in Section1.2, a basicproblemdescriptionin Section1.1 introducestheproblemstatement.

1.1 Basicoptimal control problem

Find the control variable &]6>D�: , the control (or design) parameter' , andthe possiblyfreefinal time D�� thatminimizethefunctional(i e.,theobjective or theperformanceindex)�P� &@?AD��c� 3�<�6>%M6>D���:�?ADA�|: (1.1)

subjectto thestateequation

2%]6>D�:V3 d%]6>D�:dD 3q476>%]6>D�:�?A&]6>D�:�?C'B?AD�:�? D�����D���DA�t? (1.2)

wherethe initial time D9� is givenandfixed. Thefunction 4 is calledtheright handsideofthedifferentialequations.

Thestatevariable %]6>D�: hasto satisfyinitial andfinal (terminal) conditions, i. e.,condi-tionsat initial andfinal time, %]6>D���:P3�%v��? %]6>DA��:P3�%T�Y8 (1.3)

An inequalityconstrainton thestatevariable(stateconstraint)= 6>%]6>D�:A:�E�G (1.4)

or acontrolconstraint = 6>%]6>D�:�?A&]6>D�:A:~E�G (1.5)

mayalsohave to besatisfiedfor all D�� � D9�c?ADA��� .

DIRCOL-2.1User’s Guide November1999

Page 12: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2 1.2General problemformulation

1.2 General problemformulation

In thegeneralproblemformulation,piecewisedefinedright handsidesor constraintscanbetreatedby switchingpoints DA� thatmaybefreeor fixed.Thenthewholetimeinterval canbesplittedup into severalphases. Thephasesareconnectedby phaseconnectingconditionsimposedon theleft andright sidelimits of thestatevariablesat theswitchingpoint andontheswitchingpoint itself.

�D � DA��o�X D���o � D��(�X (�� (�� ($� time D2%�3K4 X 2%�3K4 � 2%�3K4 �= X EHG = � E�G = � E�Gfirst phase secondphase third phase

Figure1.1: A problemwith WVX�3KZ phasesand W[3�\ events.

For example,considera problemwith threephasesas depictedin Figure 1.1 and apiecewisedefinedright handside 4vh�6>%M6>DA:�?A&M6>DA:�?C'B?AD�: , pJ3�_c?srt?sZ . Theswitchingpoints D �Oo�Xand DA��o � and the initial andfinal times canbe collectedinto a vector of W events ( by(�X�3�D9� , (���3�DA�Oo�X , (���3�DA�Oo � , ($��3�D�� . In this example,thereare W 3�\ events,WVX��;3KW¡ ~_�3KZ phases,and W¢ �rd3kr switchingpoints.In general,thevectorof eventsreadsas ( �;3 6C(�X�?�(��£?-8-8-8a?�(�¤$¥¦X�?�(�¤":�;3 6>D��£?AD���o�X-?-8-8-8a?ADA�Oo ¤�¥��£?AD��|:�8 (1.6)

Hint: Use problemformulationswith a single phase� ( X ?�( ¤ ��3 � D � ?AD��£� ,W[3Kr , WVXY3�_ , wheneverpossible!Introducingswitchingpointscomplicatestheproblem

formulationandincreasesthepossibility of errorsby theuserin thecorrectproblempro-gramminganduseof ������� �� enormously. Usingmulti-phaseproblemformulationsisonly recommendedto reallyadvancedusers.

DIRCOL-2.1User’s Guide November1999

Page 13: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

1.2 General problemformulation 3

Notation: For thegeneralproblemformulation,thefollowing definitionsandnotationsareused

%]6>D�:73¨§©ª %BX�6>D�:8-8-8%�«£¬­6>D�:®s¯° ? &]6>D�:P3¨§©ª &±Xa6>D�:8-8-8&³²µ´]6>DA:

®s¯° ?¶'�3¨§©ª '±X8-8-8'³²¸·®s¯° 8

Constantcontrols ' (so-calledcontrol parametersor designparameters) aretreatedsepa-ratelyfrom thetimedependentvariables& in thegeneralproblemformulation.� D��£?AD��c� : thetime interval considered:D���¹�DA� , � D���?ADA�£�Bº�»½¼D�� : thefixedinitial timeDA� : thefixedor freefinal time%@?@%M6>DA: : thestatevariables,%�� � D � ?AD����¦¾¿»½¼ «£¬&@?@&M6>DA: : thecontrolvariables,&�� � D��c?ADA���T¾¿»½¼ ²µ´' : thecontrol(or design)parameters,'���»½¼ ²¸·( : the W events: (�X$�;3�D�� , . . . , (�¤À�;3KD��m¦Á : numberof statevariables( m¦ÁÂEk_ )^Cà : numberof controlvariables( ^CÃÄEHG )^ÆÅ : numberof controlparameters( ^ÇÅ�EHG )W : numberof events 6>WÈE�r )WVX : WVXF�;3�W�  _dEk_ is thetotalnumberof phases

� ( h ?�( hfÉ XA�Ê?TpM3Ë_c?-8-8-8a?AWVX< : therealvaluedobjective function(to beminimized)4 : theright handsideof thedifferentialequations2%]6>D�:P3K476>%]6>D�:�?A&]6>D�:�?C'B?AD�:4vh : theright handsideof thedifferentialequations2%]6>D�:73K4vhA6>%]6>D�:�?A&]6>D�:�?C'B?ADA:in the p -th phase:( h �HDY�H( hfÉ X , p���Ì|_c?-8-8-8£?AW X-Í= : all nonlinearinequalityconstraints= 6>%M6>DA:�?A&M6>DA:�?C'@?ADA:�EHG= h : all nonlinearinequality constraints= h�6>%]6>D�:�?A&]6>D�:�?C'B?AD�:�EÎG in the p -thphase:( h ��D��H( hfÉ X , pJ�ÏÌ|_c?-8-8-8�?AWVX Í= hi : the j -th nonlinearinequalityconstraint= hi 698;:�E�G in the p -th phasem¦Ð o « ² «|o h : thenumberof nonlinearinequalityconstraints= hi 698;:FEHG ,j 3�_c?-8-8-8a?Am¦Ð o « ² «|o h , in the p -th phase,pM3�_c?-8-8-8�?AWVX , ( m¦Ð o « ² «|o h EHG )I

: all nonlinearequalityconstraintsI 6>%]6>D�:�?A&]6>D�:�?C'B?ADA:Y35GI h : all nonlinearequalityconstraintsI h 6>%]6>D�:�?A&]6>D�:�?C'B?AD�:�3KG in the p -th phase:( h ��D��H( hfÉ X , p��ÏÌ|_c?-8-8-8a?AWVX ÍI h i : the j -th nonlinearequalityconstraint

I h i 698;:P35G in the p -th phasem±Ñ o « ² «|o h : thenumberof nonlinearequalityconstraintsI h i 35G , j 3�_c?-8-8-8a?Am±Ñ o « ² «Òo h ,

in the p -th phase,p]3�_c?-8-8-8�?AW X ( m±Ñ o « ² «Òo h EHG )Ó h : theimplicit boundaryor phaseconnecting(i. e.,switching)conditionsm¦Ô o « ² «Òo h : p]3�_ : thenumberof implicit boundaryconditionsat D�� , DA�p]3Krt?-8-8-8�?AWVX : thenumberof implicit phaseconnectingconditionsat theswitchingpoint DA�Oo h ¥¦XJ35( h ( m¦Ô o « ² «Òo h E�G )%M6>D] �G|: �;3 ÕfÖf×ÙØÛÚ��ÜoÜØÞÝ��v%]6>DM �ßÜ: (left sidelimit of % at D )%M6>D¦à�G|: �;3 ÕfÖf×ÙØÛÚ��ÜoÜØÞÝ��v%]6>D±à�ßÜ: (right sidelimit of % at D )

In thesequel,referencesto user-suppliedinput files andsubroutinesaregiven in com-binationwith theproblemformulation. Thedetailsof thefiles thathave to besuppliedbytheuseraredescribedlateron in Section4.2.

DIRCOL-2.1User’s Guide November1999

Page 14: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

4 1.2General problemformulation

1.2.1 Objective

In general,thereal-valuedMayer-typeobjective < maydependoná valuesof thestatevariables% at the initial time D9� and/orat thefinal time D�� and/oron theleft and/orright sidelimits of % at theswitchingpoints,á thefinal time DA� itself and(or) theswitchingpoints(collectedin thevectorof events( ), andá thecontrol(or design)parameters' , i. e.,�J� &B?C'â��3 < ã�%]6>D���:�?%]6>D �Oo�X  �G|:�?AD ��o�X ?A%]6>D �Oo�X àzG|:�?8-8-8�?%]6>DA�Oo ¤�¥��� �G|:�?AD���o ¤$¥��c?A%M6>D���o ¤$¥��Jà�G|:�?%]6>DA�|:�?ADA�t?O'³äv8 (1.7)

In the currentversionof �����V� �� , the additionalassumptionon the structureof <hasbeenmadefor simplificationof theuser-suppliedsubroutineUSROBJfor computing<(seeSection4.2.2.3)

< 3 <�X@à�8-8-8£àH< h à�8-8-8£à�<Y¤$å�3 ¤$åæhfç X < h ? (1.8)

where < X 3 < X 6>%]6>D � :�?A&]6>D � :�?C'B?AD � ?A%M6>D��Ò:�?A&]6>DA�Ò:�?ADA�|:3 <�Xa6>%]6C(�XÜ:�?A&M6C(�Xè:�?C'@?�(�X�?A%]6C(�¤�:�?A&M6C($¤�:�?�($¤�:�?and < hµÉ X 3 < h 6>%M6>D ��o h  �G|:�?A&]6>D �Oo h  �G|:�?C'@?AD ��o h ?A%M6>D ��o h àzG|:�?A&]6>D ��o h à�G|:�?AD��|:3 < h 6>%M6C( hfÉ XJ �G|:�?A&M6C( hfÉ X� �G|:�?C'B?�( hfÉ Xa?A%]6C( hµÉ X]à�G|:�?A&]6C( hfÉ XMà�G|:�?�($¤�:�?p]3�_c?-8-8-8a?AW[ �rt8This assumptionmay bedropped.However, this will requirea few changesin thesourcecodeof �����V� �� .

DIRCOL-2.1User’s Guide November1999

Page 15: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

1.2.2 Differential equations 5

1.2.2 Differ ential equations

Thefirst orderordinarydifferentialequationsmaybepiecewisedefinedby

2%M6>DA:�3 éêêêë êêêì 4 X 6>%]6>D�:�?A&]6>D�:�?C'B?ADA:�? Dí� � D � ?AD ��o�X � 3 � ( X ?�( � �Ê?4 h 6>%M6>DA:�?A&M6>DA:�?C'B?AD�:�? Dí� � D���o h ¥¦X-?AD���o h �î3 � ( h ?�( hfÉ XA�Ê?p]3Krt?-8-8-8�?AWï �rt?4 ¤$¥¦X 6>%]6>D�:�?A&]6>D�:�?C'B?AD�:�?ðDí� � D���o ¤$¥��£?ADA�£�q3 � ($¤�¥¦X�?�($¤$�Ê? (1.9)

wheretheright handsidein eachphaseis

4 h 6>%B?A&@?C'B?ADA:�3 éêë êì 4vhX 6>%@?A&B?C'B?AD�:8-8-8 , i. e., 4vh@�­» ¼ «£¬ É ²ñ´ É ²¸· É X ¾�» ¼ «£¬ ?4vh«£¬ 6>%B?A&@?C'B?AD�: pM3�_c?-8-8-8�?AWð H_c8Theright handside 4 hi|?Yj�3ð_c?-8-8-8�?Am¦Ád?Jp$3ï_c?-8-8-8a?AWVX-? of eachphasehasto beprovidedby theuser-suppliedsubroutineUSRDEQ(seeSection4.2.2.2).

DIRCOL-2.1User’s Guide November1999

Page 16: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

6 1.2General problemformulation

1.2.3 Conditions at initial, final and switching times

Explicit andimplicit formulationsof boundaryandphaseconnectingconditionsaredistin-guished.

Explicit conditionswill alwaysbefulfilled ateveryiterationof theoptimizationmethodbecausethediscretizationof theoptimalcontrolproblemis tailoredto them.

Implicit conditionswill usuallyonlybefulfilled attheendof anoptimizationrunbut notat intermediateiterationsasthey appearasnonlinearequalityconstraintsin the nonlinearoptimizationproblem.

Hint: Whenever thereis a choicein theproblemformulation,anexplicit for-mulationshouldbepreferredoveranimplicit one.

Note: Although it is possibleby the software to imposeconditionson thecontrol variables&M6>DA: at initial andfinal time andat switchingpoints,this usuallydoesn’tmakesenseandmayevenbeharmful concerningtheexistenceof asolutionof theoptimalcontrolproblemandits computability. Thus,becarefulwhenusingthisoption.

1.2.3.1 Explicit formulationTwo kindsof explicit formulationsaredistinguishedin thisuser’s guide.

The constantvaluesof the first kind (concerningthe valuesof the statevariablesatinitial time %M6>D9�a: andof the left side limits of the statevariablesat the switchingpoints%]6>D �Oo i  �G|: , j3�_c?-8-8-8�?AW �r ) have to beprovidedby theuser-suppliedinputfile DATLIM(seeSection4.2.1.2).

The functionsof the secondkind (concerningthe valuesof the statevariablesat thefinal time %]6>DA��: andof the right side limits of the statevariablesat the switchingpoints%]6>D �Oo i à�G|: , jò3�_c?-8-8-8a?AW� ­r ) havetobeprovidedby theuser-suppliedsubroutineUSRNBC(seeSection4.2.2.4).

Informationabouteachtypeof conditionshasto beprovidedby theuser-suppliedinputfile DATLIM (seeSection4.2.1.2).

1.2.3.1.1 Explicit formulation of the first kind: Thevariablesat initial time aswell astheir left sidelimits at switchingpointsmaybesetexplicitly to a givenconstant(providedby theuser-suppliedinput file DATLIM, Section4.2.1.2)as%tó|6>D9�a: 3 %tóso � (a givenconstant)&³²Û6>D9��: 3 &³² o � (a givenconstant)%tó|6>D ��o i  �G|: 3 % óso ��o i (a givenconstant)&³²Û6>D ��o i  �G|: 3 &³² o �Oo i (a givenconstant)j3Krt?-8-8-8a?AWVX (only possibleif WVXFE�r )ã9ô�ÏÌ|_c?-8-8-8a?Am¦Á Í ? ^]�ÏÌ|_c?-8-8-8�?�^ Ã Í äT8

(1.10)

DIRCOL-2.1User’s Guide November1999

Page 17: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

1.2.3 Conditionsat initial, final andswitching times 7

1.2.3.1.2 Explicit formulation of the secondkind: Thevariablesat final time aswellastheir right sidelimits at switchingpoints maybesetexplicitly to a givenconstantor afunction õ of thevaluesat initial time or of theleft sidelimits at switchingpoints,respec-tively, %eó|6>DA��: 3 õ Xö o ó 6>%M6>D9�a:�?A&M6>D9�a:�?C'@?AD9�c?ADA�|:&v²÷6>D��Ò: 3 õ Xø o ² 6>%M6>D9�a:�?A&M6>D9�£:�?C'B?AD9�c?ADA��:%eó|6>D �Oo i àzG|: 3 õ i É Xö o ó 6>%]6>D �Oo i  �G|:�?A&M6>D ��o i  ÏG|:�?C'B?AD ��o i :&v²÷6>D ��o i à~G|: 3 õ i É Xø o ² 6>%]6>D �Oo i  �G|:�?A&M6>D ��o i  ÏG|:�?C'B?AD ��o i :j 3krt?-8-8-8a?AWVX (only possibleif WVX�E�r )ã�ôò��Ì|_c?-8-8-8�?Am¦Á Í ? ^M�VÌ|_c?-8-8-8�?�^ Ã Í äT8

(1.11)

Someexamplesof suchfunctionsõ ih are% ó 6>D �Oo i àzG|:�3 _-GOGe8½G (a givenconstant)?%eó�6>D �Oo i àzG|:�3 %eó�6>D �Oo i  �G|: (continuityof % h 6>DA: at D ��o i ) ?% ó 6>DA�|: 3 % ó 6>D � : (periodicityof % h 6>DA: ) 8 (1.12)

Thefunctionsõ iö o ó and õ iø o ² have to beprovidedby theuser-suppliedsubroutineUSRNBC(seeSection4.2.2.4).Informationabouteachtypeof conditionshasto beprovidedby theuser-suppliedinput file DATLIM (seeSection4.2.1.2).

1.2.3.2 Implicit formulation Ó Xh 6>%M6>D9�a:�?A&M6>D9�a:�?C'@?AD9�O?A%M6>D���:�?A&M6>D��t:�?AD��Ò:Î3 Gp]3�_c?-8-8-8�?Am¦Ô o « ² «|o�X 6>m¦Ô o « ² «Òo�X EHG|:Ó i² 6>%]6>D �Oo i ¥¦X  �G|:�?A&M6>D ��o i ¥¦X  �G|:�?C'B?AD �Oo i ¥¦X ?A%]6>D �Oo i ¥¦X àzG|:�?A&M6>D ��o i ¥¦X à�G|:�?AD��t:Î3 G^±3�_c?-8-8-8a?Am¦Ô o « ² «Òo i 6>m¦Ô o « ² «Òo i EHG|:for j 3Krt?-8-8-8�?AWVX�8

(1.13)The functions Ó defining implicit boundaryand phaseconnectingconditionshave to beprovidedby theuser-suppliedsubroutineUSRNBC(seeSection4.2.2.4).Thenumbersofeachtype of conditionshave to be provided by theuser-suppliedinput file DATDIM (seeSection4.2.1.1).

DIRCOL-2.1User’s Guide November1999

Page 18: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

8 1.2General problemformulation

1.2.4 Inequality constraints

In orderto improve robustnessandefficiency, upperandlower boundson all variablesaretreatedseparatelyfrom generalinequalityconstraints.

1.2.4.1 Upper and lower boundsUpperandlower bounds(so-calledbox constraints) have to beprovidedfor all of thestatevariables% , thecontrolvariables& , thecontrolparameters' , andtheevents( .

Theboxconstraintsof stateandcontrolvariablesmaydiffer from onephaseto another

1stphase: DY� � (�X�?�(��Ü�Ê? % Xóso ù7ú�û � %eó�6>D�:í� % Xó�o ùPü9ý ?Ëô�3Ë_c?-8-8-8a?Am¦Á�?& X² o ù7ú�û � &v²÷6>D�: � & X² o ùPü9ý ?ï^B3�_c?-8-8-8a?�^ à ?8-8-8WVX -th phase: DY� � (�¤$å�?�(�¤$�Ê?¢% ¤$åóso ù7ú�û � %eó�6>D�:í� % ¤$åó�o ùPü9ý ?Ëô�3Ë_c?-8-8-8a?Am¦Á�?& ¤ å² o ù7ú�û � &v²÷6>D�: � & ¤ å² o ùPü9ý ?ï^B3�_c?-8-8-8a?�^ à 8(1.14)

Theboxconstraintsof thecontrolparametersreadas'³² o ù7ú�û � '³²�� '³² o ùPü9ý ?þ^±3�_c?-8-8-8a?�^ÆÅY? (1.15)

andfor theevents (��Üo ù7ú�û � (�� � (��Üo ùPü9ý�?8-8-8($¤$o ù7ú�û � ($¤ � (�¤$o ùPü9ý�8 (1.16)

Theinitial time (�XY3�D9� is keptfixed.Thereforeno boxconstraintson D�� areneeded.á All upper and lower boundshave to be provided by the user-supplied input fileDATLIM (seeSection4.2.1.2).á Unconstrained variables: If a variablehasno upperbound,i. e., is unconstrainedfrom above, thena valuegreateror equalto +1.E+10 3�àÙ_-G X÷�Vÿ3 à�� (which istreatedasa placeholderfor infinity) hasto be setasupperbound. Vice versa,if avariablehasno lower bound,a valuelessor equalto   1.E+10 3¢ d_-G X÷� ÿ3  �� hasto bespecifiedin DATLIM (cf. optionalparameterinfinite boundsizeof NPSOL[12]or optionalparameterinfinite boundof SNOPT[11]).á Problemswith a fixed final time or fixed switching points are treatedby settinglower andupperboundsof thecorrespondingevent to thesamevalue.For example,for afixedfinal timeof DA�d3Kbt8½G onesets($¤$o ù7ú�û�3Kbt8½G and ($¤�o ùPü9ý"35bt8½G�8 (1.17)

DIRCOL-2.1User’s Guide November1999

Page 19: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

1.2.5 Equalityconstraints 9

1.2.4.2 Nonlinear inequality constraintsNumberandtypeof thenonlinearinequalityconstraintsmaydiffer from onephaseto an-other

1stphase: DY� � (�X-?�(��Ü�Ê? = Xit6>%@?A&B?C'B?AD�:�EHGe? j 3�_c?-8-8-8�?Am¦Ð o « ² «Òo�X 6>m¦Ð o « ² «|o�X EHG|:8µ8µ8WVX -th phase: DY� � ($¤$å-?�(�¤$�Ê? = ¤$åi 6>%@?A&B?C'B?AD�:FEHGe?ðj 3�_c?-8-8-8�?Am¦Ð o « ² «Òo ¤$å 6>m¦Ð o « ² «Òo ¤$å EHG|:(1.18)

Thereal-valuedconstraintfunctions= hi have to beprovidedby theuser-suppliedsubroutineUSRNIC(seeSection4.2.2.5).The numbersm¦Ð o « ² «Òo h , p­3 _c?-8-8-8a?AWVX have to be providedby theuser-suppliedinputfile DATDIM (seeSection4.2.1.1).

1.2.5 Equality constraints

Numberandtypeof thenonlinearequalityconstraintsmaydiffer from onephaseto another

1stphase: D�� � (�X�?�(��Ü�Ê? I Xie6>%B?A&@?C'B?ADA:�35Ge? j 3�_c?-8-8-8a?Am±Ñ o « ² «Òo�X 6>m±Ñ o « ² «Òo�X EHG|:8µ8µ8WVX -th phase: D�� � ($¤�åè?�(�¤��Ê? I ¤�åi 6>%B?A&@?C'B?ADA:J35Ge?ðj 3�_c?-8-8-8a?Am±Ñ o « ² «Òo ¤$å 6>m±Ñ o « ² «|o ¤�å E�G|:(1.19)

Thereal-valuedconstraintfunctionsI h i have to beprovidedby theuser-suppliedsubroutine

USRNEC(seeSection4.2.2.6).Thenumbersm±Ñ o « ² «Òo h , pF3ï_c?-8-8-8a?AWVX have to beprovidedby theuser-suppliedinputfile DATDIM (seeSection4.2.1.1).

DIRCOL-2.1User’s Guide November1999

Page 20: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

10 1.3Otherproblemformulations

1.3 Other problem formulations

Several other problemformulationscan be transformedinto the problemformulation ofSection1.2.

1.3.1 Bolzaand Lagrange-typeobjectives

BolzaandLagrange-typeobjectiveswith anintegral termcanbetransformedto Mayer-typeproblemsby introducinganadditionalstatevariable.

For example,considertheBolzaproblemwith theobjective�P� &@?AD��c� 3�<�6>%M6>D���:�?ADA�|: à �������� 6>%M6>DA:�?A&M6>DA:�?AD�: dDÜ8 (1.20)

TheMayerform is obtainedby introducing%³«�¬ É X andoneadditionalstateequation2%�«£¬ É X�6>D�:�3 6>%]6>D�:�?A&]6>D�:�?ADA:�? %�«£¬ É X�6>D��a:�3 Ge? %�«£¬ É X�6>DA��: free? (1.21)

in orderto obtainthe“new” objective�P� &@?AD��c�3q<�6>%M6>D��|:�?ADA�|: àî%�«£¬ É X�6>DA��:�3�< �Ò6>%��t6>DA�|:�?ADA�|: (1.22)

with the“new” statevariable % � 3ð6>% X ?-8-8-8a?A% « ¬�?A% « ¬ É X :�� which is of dimensionm Á � 3m¦Ázà5_ .Examples: This transformationis usedin theminimumenergy problemof Section2.2

andtheoscillatorproblemof Section2.6.

1.3.2 Integral-type constraints

Integral-typeconstraints��������� 6>%]6>D�:�?A&]6>D�:�?ADA: dD�3ÎG 6 or E�G|: (1.23)

canbetreatedin thesamewayasintegral-typeobjectivesby introducinganadditionalstatevariable 2%�«£¬ É X�6>D�:�3 � 6>%M6>DA:�?A&M6>DA:�?AD�:�? %�«£¬ É Xa6>D��a:�3ÎG (1.24)

resultingin the“new” endpointconstraint% « ¬ É X 6>DA�|:�3ÎG 6 or E¿G|:�8 (1.25)

DIRCOL-2.1User’s Guide November1999

Page 21: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

1.3.3 Min-maxobjectives 11

1.3.3 Min-max objectives

Min-maxobjectivessuchas�P� &@?C'â�ò3Î× Ö�ø o � ×��������� �� o � ���! 6>%]6>D�:�?A&]6>D�:�?ADA:�? (1.26)

canbetransformedinto constrainedMayer-typeproblemsby introducinganadditionalcon-trol parameter'³² · É X satisfying'³² · É X 3ï×"���³Ì 6>%]6>D�:�?A&]6>D�:�?ADA:��MDò� � D���?ADA�£� Í . ThentheresultingconstrainedMayer-typeproblemis�J� &B?C'#���v3k< �Ò6>%]6>DA�|:�?C'��|?ADA�|:73Ä'³²;· É X ¾ × Ö��%$ (1.27)

subjectto theadditionalinequalityconstraint'v² · É X   6>%]6>D�:�?A&]6>D�:�?ADA:zE¿Ge8 (1.28)

Example: Thistransformationis usedin theproblemof theflight of apassengeraircraftthroughadownburstwindsheardescribedin Section2.8.

1.3.4 Higher order differential equations

Higherorderdifferentialequationsmaybetransformedto first ordersystemsby introducingadditionalstatevariables.

For example,considerthesecondordersystem&%�3 476>%@?A&B?C'B?AD�:�8 (1.29)

Thissystemis equivalentto thefirst ordersystem2% 3 '�?2' 3 476>%B?A&@?C'B?ADA: (1.30)

which is of thedoublesize.The“new” statevariableis % � 3Ë6>%B?(' : .Example: This transformationtechniqueis appliedto theminimumenergy problemof

Section2.2andto therobottrajectoryoptimizationproblemsof Section2.9.

DIRCOL-2.1User’s Guide November1999

Page 22: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

12 1.3Otherproblemformulations

1.3.5 DAEs and implicit differential equations

Implicit differential equationsanddifferential-algebraicequations(DAEs) may be trans-formed to explicit first ordersystemswith equality constraintsby introducingadditionalcontrolvariables.

For example,considerthefirst order implicit systemI 6>%B?@2%]?A&B?C'@?ADA:V3ÎGe8 (1.31)

This implicit systemis equivalent to the first order systemwith nonlinearequality con-straints 2% 3 '³?G 3 I 6>%B?('�?A&@?C'B?AD�:�8 (1.32)

The“new” controlvariableis & � 3Ë6>&B?(' : .Anotherexamplearesemi-explicitDAEs of theform2% 3 476>%B?()v?A&B?C'@?ADA:�?G 3 I 6>%@?()³?A&@?C'B?AD�: (1.33)

wheredimension6Þ4±: 3 dimension6>%T: 3[m¦Á anddimension6 I : 3 dimension6*) : 3[m,+ ,i. e., % denotethe differentialstateand ) the algebraicstatevariables.For the numericalsolutionusing ������� �� thealgebraicequation

I 698;:�3�G ist treatedasnonlinearequalityconstraint(seeSection1.2.5)andthealgebraicstatevariable) is consideredto beacontrolvariable. Thus,the “new” control variableis & � 3¿6>&B?()â: of dimension>Ã.-�3[^>ÃÏà�m + .Thus,thealgebraicstatevariable ) is approximatedby piecewiselinearfunctions.

Examplesarethe index-1 DAE formulationof thecatalystmixing problemdescribedin Section2.4.3andthe index-3 DAE formulationof the pendulumproblemdescribedinSection2.5.

DIRCOL-2.1User’s Guide November1999

Page 23: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2 ExampleProblems 13

2 ExampleProblems

In this chaptertheformulationsof theexampleproblemsaredescribed,whichareprovidedin thesubdirectoriesof dircol-2.0/ex with thesourcecode.

2.1 Survey of the exampleproblems

problem/directory m¦Á ^ à ^ÇÅ WVX m¦Ð o « ² «Òo�X m¦Ð o « ² «Òo � m±Ñ o « ² «|o�X m±Ñ o « ² «|o � m¦Ô o « ² «Òo�X m¦Ô o « ² «|o �minimum energy 3 1 0 1

(standard) 0 — 0 — 0 —demo 1 — 0 — 2 —

onedim rocket 2 1 0 2(standard) 0 0 0 0 0 0demo 1 1 0 0 3 2

catalyst mixingode 2 1 0 1 0 — 0 — 0 —dae 2 2 0 1 0 — 1 — 0 —

pendulum 4 1 1 1 0 — 1 — 2 —oscillator 5 0 2 1 0 — 0 — 1 —robot i2 5 2 0 1 0 — 0 — 0 —windshear 5 1 1 1 1 — 0 — 0 —manutec

minimum time 6 3 0 1 0 — 0 — 0 —minimum energy 7 3 0 1 0 — 0 — 0 —

Table2.1: Dimensionsof theexampleproblems.

Brief commentson theexampleproblems:

1. Minimum energy:A classicalminimum energy problemfrom Bryson, Denham,and Dreyfus with asecondorderstateconstraint.

2. One-dimensionalrocket:Ascentoptimizationof asimplerocket in two phases.

3. Catalystmixing:Optimalmixing policy of two catalystsof a plugflow reactor(index-1 DAE).

4. Pendulum:Parameteridentificationfor apendulum(index-3 DAE, multiple solutions).

5. Oscillator:Optimaldesignparametersfor minimumnoisedesignof a microwave oscillator.

DIRCOL-2.1User’s Guide November1999

Page 24: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

14 2.1Survey of theexampleproblems

6. Roboteri2:Optimalpathtrackingfor asimplerobotmodel.

7. Windshear:Min-maxoptimalcontrolproblemof abortlandingof apassengeraircraftin thepres-enceof adownburstwindshearsubjectto severalconstraints.

8. Manutecminimumtime:Theminimumtimepoint-to-pointtrajectoryof anindustrialrobotwith threedegrees-of-freedomwhosedynamicsis describedrealisticallyby ahighly nonlinearsystemofdifferentialequations.Thetrajectoryis subjectto (active)boxconstraintsonthestatevariables,i. e.,theanglesandtheangularvelocities.

9. Manutecminimumenergy:A minimumenergy trajectoryfor thesamerobotwith prescribedfinal time.

For all exampleproblemsa referencefor thesolutionis availableeitherasan explicitsolution,anotherapproximatesolution,or anidealreferencepath.

Remark: Many of theexampleproblemsarediscussedin detail in [39].

DIRCOL-2.1User’s Guide November1999

Page 25: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.2 A minimumenergy problem 15

2.2 A minimum energy problem

2.2.1 Problem description

This well-known problemhasoriginally beensuggestedby JohnV. Breakwellandits ana-lytical solutionhasbeenreportedby Bryson,Denham,andDreyfus [5]. It is alsodiscussedin Sec.3.11,Example2, of Bryson,Ho [6] andhasbeeninvestigatedin Sec.5.3.1of [39].Thetaskis to minimize �J� &â�3 _r � X�0/ � 6>DA:21 D (2.1)

subjectto thedifferentialequationwith boundaryconditions&%]6>D�: = / 6>DA: , %]6CG|: = 0, %]6�_a: = 0,2%]6CG|: = 1, 2%]6�_a: =  �_ (2.2)

andtheconstraint %]6>D�:���^ (2.3)

for agivenconstant .

Figure2.1: Optimal state %]6>D�: of the minimum energy problemin the caseof an upperboundof ^±3�_a`cb�35Ge8f_O_O_O_M8-8-8

DIRCOL-2.1User’s Guide November1999

Page 26: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

16 2.2A minimumenergy problem

2.2.2 minimum energy : the standard formulation

Accordingto the terminologyof Section1.2 the Lagrange-typeobjective hasto be trans-formedinto aMayer-typeoneby introducinga third statevariable.Obviously, theproblemconsistsof onephaseonly, i. e., WVX 3¿_ and

� (�X�?�(��Ü��3 � D9�£?ADA�£��3 � Ge?�_Ü� . AccordingtoSection1.2we have thefollowing dimensionsm¦Á ^ à ^ÆÅ WVX m¦Ð o « ² «|o�X m±Ñ o « ² «Òo�X m¦Ô o « ² «Òo�XZ _ G _ G G G

Thestateandcontrolvariablesare

§©ª %±X%³�%³�® ¯° 3 §©ª % 2%X� 3 �� / � 6Cw�:21âw

® ¯° ? ã &BXòä3ðã / ä"8 (2.4)

Theobjective accordingto Section1.2.1is< 3 <­Xwhere <�Xí3 %v��6>D���:�8 (2.5)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsnow readsas 4 X 3 §©ª 4 XX4 X�4 X�

®s¯° 3 §©ª %³�&±XX� & � X®s¯° 8 (2.6)

Theconditionsattheinitial time D��$35G areexplicit conditionsof thefirst kind accordingto Equation(1.10)of Section1.2.3.1 % X 6>D � :q3 Ge?%v�c6>D��a:q3 _c?%v�c6>D��a:q3 Ge8 (2.7)

The conditionsat the final time D���3 _ areexplicit conditionsof the secondkind ac-cordingto Equation(1.11)of Section1.2.3.1%BXa6>D��|:q3 õ Xö o�X 698;:�3 Ge?%v�O6>D��|:q3 õ Xö o � 698;:�3  �_c?%v�O6>D��|: is free.

(2.8)

As theupperandlower boundsof Section1.2.4.1oneobtainsfor thestateandcontrolvariablesin the

1stphase: D�� � (�X�?�(��Ü�Ê?  �_-G X÷� 3 % XXAo ù7ú�û � %±Xa6>D�: � % XXAo ùPü9ý 3 ^±3 X4 ? �_-G X÷� 3 % X�Üo ù7ú�û � % � 6>D�: � % X�Üo ùPü9ý 3 àÙ_-G X÷� ? �_-G X÷� 3 % X�Üo ù7ú�û � %³�O6>D�: � % X�Üo ùPü9ý 3 àÙ_-G X÷� ? �_-G X÷� 3 & XXAo ù7ú�û � &±Xa6>D�: � & XXAo ùPü9ý 3 àÙ_-G X÷�(2.9)

Control parametersdo not appearin this problem(i. e., ^ÇÅ�3 G ) andthe final time isfixed.Thereforethelower andupperboundsfor (�� are_ 3 (��Üo ù7ú�û � (�� � (��Üo ùPü9ý 3 _c8 (2.10)

Nonlinearinequalityor equalityconstraintsasdescribedin Sections1.2.4and1.2.5donotappearin thisproblem: m¦Ð o « ² «Òo�X 35G , m±Ñ o « ² «Òo�X 35G .

DIRCOL-2.1User’s Guide November1999

Page 27: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.2.3 minimum energy demo: formulationfordemonstration 172.2.3 minimum energy demo: formulation for demonstration

For the purposeof demonstrationonly, another, usually lessefficient formulationof theproblemfor numericalsolutionis alsoprovided:á Here,theupperboundconstrainton %±X is treatedasa nonlinearinequalityconstraint

accordingto Section1.2.4.2.Thereforem¦Ð o « ² «Òo�X 3Ë_ and= XX 6>%B?A&@?C'B?ADA:V3Î^T Ï%±X�6>D�:�E¿Ge8 (2.11)á Thetwo explicit conditionsat thefinal time DA�d3�_ of Equation(2.8)arereplacedbytwo implicit conditionsaccordingto Equation(1.13)of Section1.2.3.2Ó XX 6>%]6>D��a:�?A&]6>D���:�?C'B?AD��c?A%]6>DA�|:�?A&]6>DA�|:�?ADA�|:Î3 %BX�6>D���: 3 Ge?Ó X� 6>%]6>D � :�?A&]6>D � :�?C'B?AD � ?A%]6>DA�|:�?A&]6>DA�|:�?ADA�|:Î3 % � 6>D���:±àK_ 3 Ge8 (2.12)

For thenew formulationof theproblem,thedimensionsaccordingto Section1.2arem¦Á ^ à ^ÇÅ WVX m¦Ð o « ² «Òo�X m±Ñ o « ² «Òo�X m¦Ô o « ² «|o�XZ _ G _ _ G rIn orderto investigatetheeffectsof thenew problemformulation,theexplicit upperboundon %±X�6>D�: is setto infinity:

1stphase: DY� � ( X ?�( � �Ê?  �_-G X÷� 3 % XXAo ù7ú�û � % X 6>DA:í� % XXAo ùPü9ý 3 àÙ_-G X÷� 8Everythingelsein theproblemformulationremainsthesamecomparedwith thestandardformulationof theprevioussection.

DIRCOL-2.1User’s Guide November1999

Page 28: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

18 2.3One-dimensionalascentof a rocket

2.3 One-dimensionalascentof a rocket

2.3.1 Problemdescription

This simple one-dimensionalrocket problemwith an analyticalsolution hasbeengivenby Hargraves[17]. The rocket hasno dragandconstantthrust / until a time DA� of phaseseparationandit haszerothrustafterthis time.

0

xf

x

Figure 2.2: Theone-dimensionalascentof asimplerocket.

Theproblemis to reachagivenaltitude %v� with minimumfuel consumption.Assuminga constantfuel flow rate,fuel consumptionis directly proportionalto DA� . Thuswe wanttominimizethetime DA� of phaseseparationwhile thefinal time DA� is free.

Theoriginal problemformulation[17] readsas:Minimize�J� 5 ?AD��±?AD����ò3 D�� (2.13)

subjectto thedifferentialequation &%�3 5 6>D�: /   = (2.14)

andboundaryconditions %M6CG|:q3 Ge? %]6>DA��:q3 %v�2%M6CG|:q3 ' � ? 2%]6>DA��: is free8 (2.15)

Thecontrolis givenby 5 6>D�:�3 6 _c? DY� � Ge?AD�� �Ge?þDY��6>DA�T?ADA��� (2.16)

andtheconstantsare = 3Ë_ , / 3Kr , %v��3Ë_-GOG , and ' � 35G .Severalformulationsof theproblemaccordingto Section1.2arepossible,for example,á asa problemwith onecontrol variableanddifferentcontrol constraintsin different

phases,orá by eliminatingthecontrol5

apriori usingEquation(2.16)andresultingin aproblemwith aphase-wisedefinedright handside(2.15).

Here,we will discussthefirst formulation.

DIRCOL-2.1User’s Guide November1999

Page 29: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.3.2 onedim rocket : thestandard formulation19

2.3.2 onedim rocket : the standard formulation

TheproblemhasWVXY3Kr phases,andthe W[3KZ eventsare(�XY35Ge?M(���3�DA�T?M(���3�DA�t8 (2.17)

Hence,thedimensionsaccordingto Section1.2arem¦Á ^ à ^ÇÅ WVX m¦Ð o « ² «Òo�X m¦Ð o « ² «Òo � m±Ñ o « ² «Òo�X m±Ñ o « ² «Òo � m¦Ô o « ² «|o�X m¦Ô o « ² «Òo �r _ G r G G G G G GThestateandcontrolvariablesare7 %±X%³��8 3 7 % '08 ? ã & X ä3ðã 5 ä"8 (2.18)

Theobjective accordingto Section1.2.1is< 3 <�X@àH<��where <�Xl3 Ge? <F�~3Î(��£8 (2.19)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas4 X 3 7 4 XX4 X� 8 3 7 %³�/ &±XP  = 8 ? ( X ��DY��( � ? (2.20)

4 � 3 7 4 �X4 �� 8 3 7 %³�/ &±XP  = 8 ? (���¹�DY��(��c8 (2.21)

Theconditionsat the initial time (�X­3�G areexplicit conditionsof thefirst kind in theterminologyof Section1.2.3 %±X�6>D��-:�3 Ge?%³��6>D��-:�3 Ge8 (2.22)

Theconditionat thefinal time ( � 35D�� is anexplicit conditionof thesecondkind in theterminologyof Section1.2.3 %±Xa6>DA�|:Î3 õ Xö o�X 698;:�3 %T�t8 (2.23)

Although it is not explicitly mentionedin the problemdescription,the statevariables%BX and %v� arecontinuousat the stagingpoint (��V3ÈD�� . We have to ensurethis for thediscretizedstatevariablesby explicit conditionsof the secondkind accordingto Equa-tion (1.11)of Section1.2.3.1%±Xa6C(��JàzG|:�3 õ �ö o�X 698;:�3 %±Xa6C(��$ ÏG|:�?%³�O6C(��JàzG|:�3 õ �ö o � 698;:�3 %³�O6C(��$ ÏG|:�8 (2.24)

As theupperandlower boundsof Section1.2.4.1for thestateandcontrolvariablesweobtain

1stphase: DY� � (�X�?�(��Ü�Ê?þG 3 % XXAo ù7ú�û � %BXa6>DA: � % XXAo ùPü9ý 3 àÙ_-G X÷� ?G 3 % X�Üo ù7ú�û � %v�O6>DA: � % X�Üo ùPü9ý 3 àÙ_-G X÷� ?_ 3 & XXAo ù7ú�û � &BXa6>DA: � & XXAo ùPü9ý 3 _c?2ndphase: DY� � (��c?�(��Ü�Ê?þG 3 % � XAo ù7ú�û � %BXa6>DA: � % � XAo ùPü9ý 3 àÙ_-G X÷� ?G 3 % ��Üo ù7ú�û � %v�O6>DA: � % ��Üo ùPü9ý 3 àÙ_-G X÷� ?G 3 & � XAo ù7ú�û � &BXa6>DA: � & � XAo ùPü9ý 3 Ge8

(2.25)

DIRCOL-2.1User’s Guide November1999

Page 30: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

20 2.3One-dimensionalascentof a rocket

As thelowerandupperboundsfor (�� and (��Ge8½G _ 3 (��Üo ù7ú�û � (�� � (��Üo ùPü9ý 3 àÙ_-G X÷� ?Ge8½G _ 3 (��Üo ù7ú�û � (�� � (��Üo ùPü9ý 3 àÙ_-G X÷� ? (2.26)

might beused.

2.3.3 onedim rocket demo: formulation for demonstration

For the purposeof demonstrationonly, another, usually lessefficient formulation of theproblemfor numericalsolutionis alsoprovided:á The two explicit conditionsat initial time of Equation(2.22), theexplicit condition

at final time of Equation(2.23),andthetwo explicit conditionsat thepoint of phaseseparationof Equation(2.24)arereplacedby implicit conditions:Ó XX 6>%]6>D��a:�?A&]6>D��a:�?C'B?AD9�c?A%M6>D��Ò:�?A&]6>DA�Ò:�?ADA�|:Î3 %BX�6>D��a: 3 Ge?Ó X� 6>%]6>D��a:�?A&]6>D��a:�?C'B?AD9�c?A%M6>D��Ò:�?A&]6>DA�Ò:�?ADA�|:Î3 %v�c6>D��a: 3 Ge?Ó X� 6>%]6>D��a:�?A&]6>D��a:�?C'B?AD9�c?A%M6>D��Ò:�?A&]6>DA�Ò:�?ADA�|:Î3 %BX�6>DA�|:] Ï%T� 3 Ge?Ó � X 6>%]6>DA�  �G|:�?A&]6>DA�  �G|:�?C'B?ADA�¦?A%M6>D���àzG|:�?A&]6>DA� à�G|:A:q3 %BX�6>DA�dàzG|:7 Ï%±X�6>DA�  �G|:q3 Ge?Ó �� 6>%]6>D �  �G|:�?A&]6>D �  �G|:�?C'B?AD � ?A%M6>D � àzG|:�?A&]6>D � à�G|:A:q3 % � 6>D � àzG|:7 Ï% � 6>D �  �G|:q3 Ge8

(2.27)á In eachphase,one(trivial) nonlinearinequalityconstraintis introducedwhich is notactive at thesolution:

1stphase: D�� � ( X ?�( � �Ê? = XX 6>%@?A&B?C'B?AD�:V3 % X 6>DA:ÄE�Ge?2ndphase: D�� � (��c?�(��Ü�Ê? = � X 6>%@?A&B?C'B?AD�:V3 %³�O6>DA:ÄE�Ge? (2.28)

Hence,thedimensionsaccordingto Section1.2arem¦Á ^ à ^ÆÅ WVX m¦Ð o « ² «|o�X m¦Ð o « ² «|o � m±Ñ o « ² «|o�X m±Ñ o « ² «|o � m¦Ô o « ² «Òo�X m¦Ô o « ² «Òo �r _ G r _ _ G G Z rEverythingelsein theproblemformulationremainsunchanged.

DIRCOL-2.1User’s Guide November1999

Page 31: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.4 Catalystmixing 21

2.4 Catalyst mixing

2.4.1 Problem description

This problemdueto GunnandThomas[16] (seealso[3, 25, 42]) determinestheoptimalmixing policy of two catalystsalongthelengthof a tubular, plug flow reactorinvolving thereactions 9;:=<>?9A@CBD9AEGFThe mixing ratio of the catalystsis the control variable H which hasto be determinedinorderto maximizetheproductionof species

9AE, i. e.,to minimizeI J H#KMLONQP RTS :VU*W(XZY R[S @\U*W]X\Y (2.29)

subjectto thedifferentialequationswith boundaryconditions^S :_U*W`Y = H U*W(YaU PcbdS @ZU*W(Y NeS :fU*W`Y(Y , S :fU b Y = 1, S :VU*W(XZY free,^S @\U*W`Y = H U*W(YaU S :_U*W(Y NgPcbdS @\U*W`Y(Y N U PhNeH U*W(Y(Y S @\U*W(Y , S @iU b Y = 0, S @dU*W(XZY free,(2.30)

andthecontrolconstraint b�jkH U*W`Y jlP (2.31)

for fixedfinal timeW(X LmP .

A referencevalueof Nhb F bdnZodb\pip\q for theobjective obtainednumericallyhasbeenre-portedby [42].

DIRCOL-2.1User’s Guide November1999

Page 32: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

22 2.4Catalystmixing

2.4.2 catalyst mixing ode : the ODE formulation

Obviously, theproblemconsistsof only onephase,i. e., r : LsP andJ t :cu t @ K;L J W]v_u(W(X KwLJ b u PxK . Accordingto Section1.2we have thefollowing dimensionsy{z |�} |�~ r : y{�V� �����Z� : y,�d� �d����� : y{�]� �d����� :� P b P b b b

Theobjective accordingto Section1.2.1is� L � :where

� : L NQP RTS : U*W(X\Y RTS @ U*W]XZY!F (2.32)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas� : L � � ::� :@�� L � H :_U PcbdS @ NeS :�YH :fU S : N0PcbdS @fY N U PhNeH :!Y S @ � F (2.33)

Theconditionsattheinitial timeW]v L�b areexplicit conditionsof thefirst kind according

to Equation(1.10)of Section1.2.3.1 S :VU*W]vfY L P uS @ U*W v Y L b F (2.34)

No conditionson thestatevariablesaregivenat thefinal timet @ L W(X .

As theupperandlower boundsof Section1.2.4.1oneobtainsfor thestateandcontrolvariablesin the

1stphase:W�� J t :Vu t @ K u NQPcb :�v L S :: � ����� j S :fU*W`Y j S :: � ���2� L R�Pcb :�v uNQPcb :�v L S :@ � ����� j S @iU*W`Y j S :@ � ���2� L R�Pcb :�v ub L H :: � ����� j H : U*W`Y j H :: � ���2� L R�P F

(2.35)Control parametersdo not appearin this problem(i. e., |�~ L�b ) andthe final time is

fixed.Thus,thelower andupperboundsfort @

areequalP L t @ � ����� j t @ j t @ � ���2� L P F (2.36)

Nonlinearinequalityor equalityconstraintsasdescribedin Sections1.2.4and1.2.5donotappearin thisproblem: y{�c� �d����� : L�b , y,�d� �d����� : L�b .

DIRCOL-2.1User’s Guide November1999

Page 33: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.4.3 catalyst mixing dae : theDAEformulation 232.4.3 catalyst mixing dae : the DAE formulation

An index-1 DAE formulationof the problemis describedby [3] wherea third, algebraicstatevariableS E is introducedthatmustsatisfythealgebraicequationS EiU*W`Y LmP�NeS :_U*W(Y N�S @\U*W`Y!F (2.37)

Thus,theobjective to beminimizedis rewritten asI J H#K.LmNhS E\U*W(X\Y!F (2.38)

For the numericaltreatmentof the reformulatedproblemusing ���V�¡ �¢Q£ , the alge-braicequationis treatedasanonlinearequalityconstraintaccordingto Section1.3.5.Thus,thealgebraicstatevariableis consideredto be anothercontrolvariable H @ andis approxi-matedpiecewiselinearly.

The problemstill consistsof only onephase,i. e., r : L¤P andJ t :Vu t @ K�L J W]v_u(W(X K�LJ b u PxK . Accordingto Section1.2we have thenew problemdimensionsy{z |*} |�~ r : y{�c� �d����� : y,�d� �d����� : y{�]� �����Z� :� � b P b P b

Theobjective accordingto Section1.2.1is� L � :where

� : L N�H @\U*W(X\Y!F (2.39)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas� : L � � ::� :@ � L � H :_U PcbdS @ N�S :xYH : U S : N0PcbdS @ Y N U PhN¥H : Y S @ � F (2.40)

Theconditionsattheinitial timeW2v L�b areexplicit conditionsof thefirst kindaccording

to Equation(1.10)of Section1.2.3.1 S :_U*W]vcY L P uS @\U*W]vcY L b F (2.41)

No conditionson thestatevariablesaregivenat thefinal timet @ L W(X .

As theupperandlower boundsof Section1.2.4.1oneobtainsfor thestateandcontrolvariablesin the

1stphase:W¦� J t :Vu t @ K u NQPcb :�v L S :: � ����� j S :_U*W(Y j S :: � ���2� L R�Pcb :�v uNQPcb :�v L S :@ � ����� j S @ U*W(Y j S :@ � ���2� L R�Pcb :�v ub L H :: � ����� j H : U*W(Y j H :: � ���2� L R�P uNQPcb :�v L H :@ � ����� j H @\U*W(Y j H :@ � ���2� L R�Pcb :�v F

(2.42)Control parametersdo not appearin this problem(i. e., |�~ L§b ) andthe final time is

fixed.Thus,thelowerandupperboundsfort @

areequalP¨L t @ � ����� j t @ j t @ � ���2� L P F (2.43)

Nonlinearinequalityconstraintsasdescribedin Section1.2.4donotappearin thisprob-lem: y{�c� �d����� : L©b . However, thereis y,�i� �����Z� : LmP equalityconstraint(cf. Section1.2.5)ª :: U S u H u�«wu(W(Y LOPhNeS :fU*W(Y N�S @iU*W(Y NeH @iU*W`Y LDb F (2.44)

DIRCOL-2.1User’s Guide November1999

Page 34: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

24 2.4Catalystmixing

Fig. 2.3 displaysthe numericalsolutionof the problemapplying ���V�¡ �¢Q£ with 51equidistantgrid pointsandwith option iAction = 8 for optimization(Section4.2.1.1).

For theinitial estimates(cf. Sections4.2.2.7and4.4.1.3)S ���a� ¬����]­: U*W(Y ® P u S ���x� ¬*���]­@ U*W`Y�® b u H ���a� ¬����]­: U*W`Y�® b u H ���a� ¬����]­@ U*W(Y�® b u W�� J b u PxKand the tolerances�°.±³²sL´Pcb³µ·¶ , ¯`¸%¹\²sL´Pcb³µ·º , a good approximationof the solutionwith a final valueof theobjective of Nhb F bdnZodbdnZpipi»i»i¼ is obtainedin very few seconds(forexample,in 0.8secondswith a PentiumII/266MHz underLinux 2.0.33with GNU FortranVersion0.5.19.1).

ThenumericalresultshavebeenvisualizedusingDGNUandGnuplot(cf. Section4.6.1).Thecomputedoptimalcontrol H.½ : exhibits amax-singular-min structure.

0.9

0.91

0.92

0.93

0.94

0.95

0.96

0.97

0.98

0.99

1

0 0.2 0.4 0.6 0.8 1

X 1 = x1(t)

(a) statevariable ¾³¿ 0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0 0.2 0.4 0.6 0.8 1

X 2 = x2(t)

(b) statevariable ¾\À -0.005

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

0.045

0.05

0 0.2 0.4 0.6 0.8 1

U 2 = x3(t)

(c) control variable Á À(algebraicstate¾i )

0.95

0.955

0.96

0.965

0.97

0.975

0.98

0.985

0.99

0.995

1

0 0.2 0.4 0.6 0.8 1

adjoint variable LAMBDA_ x1(t)

(d) adjointvariable à ¿ 0.7

0.75

0.8

0.85

0.9

0.95

1

1.05

0 0.2 0.4 0.6 0.8 1

adjoint variable LAMBDA_ x2(t)

(e) adjointvariable à À 0

0.2

0.4

0.6

0.8

1

0 0.2 0.4 0.6 0.8 1

U 1 = u1(t)

(f) controlvariableÁ³¿

0

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1

X 2 over X 1

(g) statespacesolution: ¾ À over ¾ ¿ 0.9

0.91

0.92

0.93

0.94

0.95

0.96

0.97

0.98

0.99

1

0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08

X 1 over X 2

(h) statespacesolution: ¾ ¿ over ¾ ÀFigure 2.3: ���V�¥ �¢Q£ solutionof thecatalystmixingproblemfor 51equistantgridpoints.

DIRCOL-2.1User’s Guide November1999

Page 35: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.5 Pendulum 25

2.5 Pendulum

2.5.1 Problem description

Considera pendulumof length | L§b F p J Ä K andmassrÅLÆb F ¼ J Ç³È K moving in a verticalplanebeingfixedat theorigin of the S - É coordinatesystem[19, 20].

ÊË?ÌÍ?ÎÏÐ

Ñ ÒÓ Ó Ó Ó Ó Ó Ó Ó Ó ÓÔ

H Õ rSÉ

Figure2.4: Statevariablesof thependulum.

Theequationsof motionmaybedescribedby asystemof DAEsof (differential)index 3[19, 20] ^S U*W(Y L H U*W`Y S U b Y L b F n J Ä K^É U*W(Y L Õ U*W`Y É U b Y L Nhb F ¼ J Ä K^H U*W(Y L Ö�S U*W(Y(× r H U b Y L b J Ä ×�Ø K^Õ U*W(Y L Ö�É U*W`Y(× rÆN¥Ù Õ U b Y L b J Ä ×�Ø Kb L S @ U*W`Y R[É @ U*W(Y N | @ (2.45)

where Ö denotestheLagrangianmultiplier beingthealgebraicstatevariable.WeassumethatthegravitationalconstantÙ is unknown andis to beestimatedusingthe

resultsof anexperiment(cf. [19, 20]). As suggestedby Kronseder[24], only theresult� S XÉ X � L � Nhb F � ¼ÚPVÛ � pNhb F ninZ¼ÚPcb\» � (2.46)

of onemeasurementatW]X L � J Ø K is usedto obtainanobjective of MayertypeI L P��Ü U S U*W(XZY NeS X\Y @ R U É U*W(XZY NeÉ X\Y @aÝ F (2.47)

Themeasurementvaluesarethenumericalsolutionof aninitial valueproblemfor the“true”gravitationalconstantÙ ½ LÞ» F oÚP J Ä ×�Ø @ K plusa white measurementnoisesimulatinga mea-surementerror.

Index reduction[34] is appliedto transformtheindex 3 into anindex 1 systemanalyt-icaly by successive total differentiationwith respectto time resultingin a “new” algebraicconstraint(on theaccelerationlevel)b©L?H @ U*W(Y R Õ @ U*W`Y R0Ö U*W`Y | @ × rÆNeÉ U*W(Y Ù (2.48)

plustwo additionalentryconditionsatW2v L�b (cf. [19, 20, 24])b L S @ U*W v Y RTÉ @ U*W v Y N | @b L S U*W2vfY H U*W2vfY R�É U*W]vVY Õ U*W]vfY!F (2.49)

DIRCOL-2.1User’s Guide November1999

Page 36: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

26 2.5Pendulum

Pleasenote that the solution to this problemis not unique! The pendulumswingsperiodically. Differentnumbersof swingsalreadycompletedat

W(X L � correspondto differentsolutionsfor Ù . Thus,thenumericalsolutiondependson the initial estimates,namely Ö ���a� ¬����]­ , Ù ���a� ¬*���]­ .2.5.2 pendulum : the standard formulation

Theproblemconsistsof onephase,i. e., r : LmP andJ t :cu t @ KAL J W2v�u(W(X KAL J b u � K .

Thestatevariables,controlvariableandcontrolparameterareSßLáàâââã S:S @S ES·äå�æææç Láàâââã S ÉH Õ

å�æææç u HßLÆÜèH : Ý LÆÜ�Ö Ý u« L Ü «,: Ý L Ü Ù Ý F (2.50)

Accordingto Section1.2we have thefollowing dimensionsy{z |�} |�~ r : y{�V� �����Z� : y,�d� �d����� : y{�]� �d����� :n P P P b P �Theobjective accordingto Section1.2.1is� L � :

where� : L :@êé U S :_U*W(XZY NeS XZY @ R U S @\U*W(XZY NeÉ X\Y @Vë (2.51)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas� : L àâââã � ::� :@� :E� :äå æææç L àâââã S ES%äH :fU*W`Y S :_U*W`Y(× rH :_U*W(Y S @\U*W(Y(× rÆN «,:

å æææç F (2.52)

The conditionsat the initial timeW2v Lìb and final time

W(X L �consistof explicit

conditionsof thefirst kind accordingto Equation(1.10)of Section1.2.3.1S :fU*W]vfY L b F n uS @iU*W]vfY L Nhb F ¼ uS E U*W v Y L b uS·ä U*W]vfY L b u (2.53)

no explicit conditionsof thesecondkind accordingto Equation(1.11)of Section1.2.3.1,but two implicit conditionsaccordingto Equation(1.13)of Section1.2.3.2í :: U S U*W]vfY!u H U*W]v_Y!u�«wu(W]vdu S U*W(XZY!u H U*W]XZY!u(W(XZY L S @ : U*W2vfY RTS @@ U*W]vfY N | @ Lîb u (2.54)í :@ U S U*W]vfY!u H U*W]v_Y!u�«wu(W]vdu S U*W(XZY!u H U*W]XZY!u(W(XZY L S :fU*W2vfY S E\U*W2vVY R�S @iU*W2vfY S%ä U*W2vVY LDb F (2.55)

As theupperandlower boundsof Section1.2.4.1oneobtainsfor thestateandcontrolvariablesin the

1stphase:W�� J t :Vu t @ K u NQPcb :�v L S :: � ����� j S :fU*W`Y j S :: � ���2� L R�Pcb :�v uNQPcb :�v L S :@ � ����� j S @iU*W`Y j S :@ � ���2� L R�Pcb :�v uNQPcb :�v L S :E � ����� j S EiU*W`Y j S :E � ���2� L R�Pcb :�v uNQPcb :�v L S :ä � ����� j S·ä U*W`Y j S :ä � ���2� L R�Pcb :�v uNQPcb :�v L H :: � ����� j H :fU*W`Y j H :: � ���2� L R�Pcb :�v u

(2.56)

DIRCOL-2.1User’s Guide November1999

Page 37: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.5.2 pendulum : thestandard formulation 27

andfor thecontrolparameterandeventPcb µ @ L «,: � ����� j «,: j «,: � ���2� L Pcbib u� L t @ � ����� j t @ j t @ � ���2� L � F (2.57)

Nonlinearinequalityconstraintsasdescribedin Section1.2.4donotappearin thisprob-lem: y{�c� �d����� : L©b . However, thereis y,�i� �����Z� : LmP equalityconstraint(cf. Section1.2.5)ª :: U S u H u�«wu(W`Y LDS @E U*W`Y RTS @ä U*W(Y R�H : U*W(Y | @ × rÆN�S @ U*W(Y�« : Lîb F (2.58)

Fig. 2.5 displaysthe numericalsolutionof the problemapplying ���V�¡ "¢ê£ with 51equidistantgrid pointsandwith option iAction = 8 for optimization(Section4.2.1.1).

For theinitial estimates(cf. Sections4.2.2.7and4.4.1.3)forW�� J b u � KS ���x� ¬*���]­: U*W(Y�® b F n u S ���a� ¬����]­@ U*W(Y�® Nhb F ¼ u S ���a� ¬����]­E U*W(Y LïS ���a� ¬����]­ä U*W`Y�® b u H ���a� ¬����]­: U*W`Y�® NCp F b u

and« ���a� ¬*���]­: L � b F b , andthe tolerances °.±�² LðPcb µ·¶ , ¯ ¸·¹Z² LðPcb µ·º , a goodapproxima-

tion of the solutionwith a final valueof the objective of b F »ipip\qdpiÛÚPanZ»ßñ·Pcb�NòÛ andof thegravitational constant

«,: LóÙ�Lô» F qiq�bdn is obtainedin very few seconds(for example,in1.2 CPU secondswith a PentiumII/266MHz underLinux 2.0.33with GNU FortranVer-sion0.5.19.1).

ThenumericalresultshavebeenvisualizedusingDGNUandGnuplot(cf. Section4.6.1).

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0 0.5 1 1.5 2

X 1 = x(t)

(a)statevariable ¾ -0.5

-0.48

-0.46

-0.44

-0.42

-0.4

-0.38

-0.36

-0.34

-0.32

-0.3

0 0.5 1 1.5 2

X 2 = y(t)

(b) statevariableõ -0.5

-0.48

-0.46

-0.44

-0.42

-0.4

-0.38

-0.36

-0.34

-0.32

-0.3

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4

X 2 over X 1

(c) statespacesolution ö÷¾³øùõ_ú-2

-1.5

-1

-0.5

0

0.5

1

1.5

2

0 0.5 1 1.5 2

X 3 = u(t)

(d) statevariableÁ�ûlü¾ -1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 0.5 1 1.5 2

X 4 = v(t)

(e) statevariableý=ûÞüõ -11

-10

-9

-8

-7

-6

-5

-4

-3

0 0.5 1 1.5 2

U 1 = lambda(t)

(f) algebraicvariable Ã-0.004

-0.003

-0.002

-0.001

0

0.001

0.002

0.003

0.004

0.005

0 0.5 1 1.5 2

1-th user-defined function in phase 1

(g) ¾ À öÿþ ú � õ À öÿþùú���� À -0.015

-0.01

-0.005

0

0.005

0.01

0.015

0 0.5 1 1.5 2

2-th user-defined function in phase 1

(h) ¾Úöÿþ ú*Á³öÿþ ú � õ\öÿþùú*ýiöÿþ ú -0.04

-0.03

-0.02

-0.01

0

0.01

0.02

0.03

0.04

0.05

0 0.5 1 1.5 2

3-th user-defined function in phase 1

(i) � ¿¿ ûôÁ À öÿþ ú � ý À öÿþùú �óöÿþ ú�� À�� ��õZöÿþùú �Figure 2.5: ���V�¡ "¢ê£ solutionto thependulumproblemfor 51 equistantgrid points.

DIRCOL-2.1User’s Guide November1999

Page 38: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

28 2.6Minimumnoisedesignof anoscillator

2.6 Minimum noisedesignof an oscillator

Thisproblemhasbeensuggestedto theauthorby W. Anzill whoalsoreportedtheanalyticalsolution.It is describedin Section8.6of [39].

2.6.1 Problemdescription

N�������� �� H �

���� H �

Figure2.6: Equivalentcircuit of thevan-der-Pol-oscillator.

The taskis to determinethedesign,e.g., the linear network, of oscillatorswith mini-mizedphasenoise.This is doneby formulatingandsolvinganappropriateoptimalcontrolproblemnumerically. Here,we will only briefly describethemodelproblemof minimumnoisedesignof a van-der-Pol-oscillatorwhich hasbeendescribedin [1, 39]. For morebackgroundon thegeneralproblemwe referto [2].

Thestatevariablesare S : L?H � u S @ L � � × � ñ � � (2.59)

whereH � describesthevoltage,�

theinductivity,�

thecapacity. Thedifferentialequationsare^S : L � � � PhN S @ : U*W(Y RTS @@ U*W`Y� @v � S : U*W`Y NeS @ U*W`Y���� R! � � S @ : U*W(Y RTS @@ U*W`Y N � v#"$" u(2.60)^S @ L � � � PhN S @ : U*W(Y RTS @@ U*W`Y� @v � S @\U*W`Y RTS :_U*W`Y���� R! � � S @ : U*W(Y RTS @@ U*W`Y N � v "$" (2.61)

with real constants� , ,� v

,�

. For computingthesingle-sidebandphasenoisetwo vari-ables

Õ :and

Õ @arerequiredwhichmustsatisfy^Õ : L N àã � � � P�N S @ : U*W(Y RTS @@ U*W(Y� @v N � S @ : U*W`Y� @v � N% S :fU*W`Y S @\U*W`Y� S @ : U*W`Y RTS @@ U*W`Y åç

Õ :_U*W`YN àã N � S :fU*W`Y S @\U*W`Y� @v R � R& � � S @ : U*W(Y R�S @@ U*W(Y N � v'" R( S @ : U*W`Y� S @ : U*W`Y RTS @@ U*W`Y åç

Õ @ U*W`Y!u(2.62)

DIRCOL-2.1User’s Guide November1999

Page 39: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.6.2 oscillator : thestandard formulation 29

^Õ @ L N àã N � S : U*W(Y S @ U*W(Y� @v N � N% � � S @ : U*W`Y RTS @@ U*W`Y N � v " N% S @@ U*W(Y� S @ : U*W(Y R[S @@ U*W(Y åçÕ :_U*W(Y

N àã � � � PCN S @ : U*W`Y RTS @@ U*W`Y� @v N �.S @@ U*W(Y� @v � R! S :_U*W(Y S @\U*W(Y� S @ : U*W(Y R�S @@ U*W`Y åçÕ @iU*W(Y!F

(2.63)

Thefiveconditionsat initial andfinal time for oneoscillationwith periodW(X

areS*) U*W(XZY LïS*) U b Y!u � LmP u � u S @ U b Y L�b u Õ : U*W(XZY L Õ : U b Y!u Õ : U b Y ^S : U b Y R Õ @ U b Y ^S @ U b Y LmP F(2.64)

Theperiod(final time)W]X

is free,i. e.,determinedby thenonlinearboundarycondition.Thedesignparameters and

� vhave to bedeterminedin away thatthenoiseI J u � v K�L � @U �,+ �.- Y @ PW(X0/2143v Õ�5 U*W`Y � U*W(Y76¦U*W(Y � 5 U*W`Y Õ U*W`Y98�W (2.65)

is minimized.Here,we consider6=U*W`Y L � P bb P � and � U*W`Y L �;: < U*W`Y bb : < U*W`Y � (2.66)

with < U*W`Y L>=#?A@ Ü S @ : U*W`Y RTS @@ U*W`Y Ý F (2.67)

Thereforetheobjective is equivalenttoI J u � v K�L � @U �,+ �.- Y @ PW(X / 1 3v < U*W`Y Ü Õ @ : U*W`Y R Õ @@ U*W(Y Ý 8�WxF (2.68)

Thesolutionhasbeengivenexplicitly by Anzill (see[1, 39]) L b u S @iU*W(Y L � v Ø�BDC,UE��W`Y!u� v L P u Õ :fU*W`Y L U(U � vf× � Y7F#G\ØdUE��W`Y N Ø�BDC,UE��W`Y(Y#×ÚU � v#�=Y!uS :fU*W`Y L � v�F#G\ØfUE��W`Y!u Õ @iU*W`Y L U(U � vf× � Y³ØHBDCwUE��W`Y R F#G\Ø_UE��W`Y(Y#×ÚU � v#�=Y!F (2.69)

TheperiodisW]X L �,+ ×I� .

For thecomputations,we usethefollowing constants� - L P u � L �,+ u � LmP F (2.70)

In thiscase,theminimumobjective valueisI L e

: ×ÚU �,+ Y @ L�b F b\Ûioioip�nZoioi¼ F÷F÷F , andthefinaltime is

W]X L P .2.6.2 oscillator : the standard formulation

Theproblemhasonephase,i. e., r : L P , J t :Vu t @ K.L J b u(W]X K .Thestatevariablesandcontrolparametersare

SßL àâââââãS :S @S ES·äS*Jå æææææç L àâââââã

S :S @Õ :Õ @K 1v < U�L·Y é Õ @ : U�L·Y R Õ @@ U�L·Y ë 8MLå æææææç u « L � «,:«%@ � L � � v � F (2.71)

DIRCOL-2.1User’s Guide November1999

Page 40: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

30 2.6Minimumnoisedesignof anoscillator

Thereareno controlvariables,i. e., |*} L�b .Theobjective accordingto Section1.2.1is� L � :

where� : L N ÀO @P X9QSR À S*J U*W(X\Y(×_W(XÚF (2.72)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas

� : L àâââââã� ::� :@� :E� :ä� :J

å æææææç L àâââââã^S :^S @^Õ :^Õ @< U*W`Y é S @E U*W(Y RTS @ä U*W`Y ë

å æææææç u (2.73)

where^S : , ^S @ , ^Õ : , ^Õ @ have to bereplacedby theexpressionsfor their right handsides.

Theconditionsat theinitial timeW]v L�b andfinal time

W(Xconsistof explicit conditions

of thefirst kind accordingto Equation(1.10)of Section1.2.3.1S @dU*W]vfY L b uSTJ U*W]vfY L b u (2.74)

explicit conditionsof thesecondkind accordingto Equation(1.11)of Section1.2.3.1S : U*W]X�Y L � :U � : U2F Y L S : U*W v Y!uS @ U*W]X�Y L � :U � @ U2F Y L S @ U*W v Y!uS E U*W]X�Y L � :U � E U2F Y L S E U*W v Y!u (2.75)

andoneimplicit conditionaccordingto Equation(1.13)of Section1.2.3.2í :: U S U*W2vfY!u H U*W2vfY!u�«wu(W]vdu S U*W(XZY!u H U*W]X³Y!u(W]XZY LìP#N�S EiU b Y ñ � :: U S U b Y!u�«AY NQS%ä U b Y ñ � :@ U S U b Y!u�«AY Lðb F(2.76)

As theupperandlower boundsof Section1.2.4.1we use

1stphase:W�� J t :Vu t @ K u NQPcb L S :: � ����� j S :_U*W(Y j S :: � ���2� L R�Pcb uNQPcb L S :@ � ����� j S @\U*W(Y j S :@ � ���2� L R�Pcb uNQPcb L S :E � ����� j S E U*W(Y j S :E � ���2� L R�Pcb uNQPcb L S :ä � ����� j S%ä U*W(Y j S :ä � ���2� L R�Pcb ub L S :J � ����� j STJ U*W(Y j S :J � ���2� L R�Pcb :�v u

(2.77)andfor thecontrolparametersandeventNQPcb µ @ L «,: � ����� j «,: j «w: � ���2� L R�Pcb µ @ uPcb³µ J L « @ � ����� j « @ j « @ � ���2� L R�Pcb :�v uPcb µ E L t @ � ����� j t @ j t @ � ���2� L R�Pcb :�v F (2.78)

Nonlinearinequalityor equalityconstraintsasdescribedin Sections1.2.4and1.2.5donotappearin thisproblem.Thereforethedimensionsaccordingto Section1.2arey{z |�} |�~ r : y{�V� �����Z� : y,�d� �d����� : y{�]� �d����� :p b � P b b P

DIRCOL-2.1User’s Guide November1999

Page 41: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.7 Optimalpathtracking for a simplerobot 31

2.7 Optimal path tracking for a simple robot

This problemhasbeensuggestedto the authorby W. Miksch andhasbeendescribedinSection6.4of [39]. Theuseof ���V�¡ �¢Q£ for optimalcontrolof a realmobilemanipulatorwith fivedegreesof freedomis describedin [29].

2.7.1 Problem description

The endeffector of a robot with two rotationaljoints andsimplified equationsof motionhasto move alonga prescribedpathwith constantvelocity. In eachjoint, thereis a motorwhichcanbecontrolled.Theprescribedreferencepathincludesanonsmoothcornerwherethereferencevelocity is discontinuous.Therefore,anerrormustoccurwhentherobottriesto track this path with constant,non-zerovelocity. The overall tracking error hasto beminimized.

Thesecondorderequationsof motion andthe initial andfinal valuesfor positionandvelocityof therobotareVW :fU*W(Y L H :fU*W`Y!u W :fU b Y L b u ^W :fU b Y L b F p u W :VU � Y L b F p u ^W :fU � Y L b uVW @iU*W(Y L H @iU*W`Y!u W @iU b Y L b u ^W @iU b Y L b u W @dU � Y L b F p u ^W @iU � Y L b F p F

(2.79)Theobjective to beminimizedis thesumof errorsin thetrackingof thereferencepathI J H·KYX L / @v � U W U*W(Y!u ^W U*W`Y(Y78�W X L / @v @Z)D[ : � ) U W ) U*W`Y N W ) � \ ]_^ U*W`Y(Y @ R @Z)D[ : � @�` ) U ^W ) U*W`Y N ^W ) � \E]_^ U*W`Y(Y @ 8�W

(2.80)with constant,non-negative, real weighting factors

� ) , � LOP u � u ¼ u n . Here, we choose� : L �;@ LmPcbib and�;E L � äòLlpdbib . As referencepathweuseW : � \E]_^ U*W(Y L a W(× � u b"j W j�P uP × � u Pcb W j � u W @ � \ ]d^ U*W(Y L a b u b j W jlP uU*W N0P Y(× � u P�b W j � u^W : � \E]_^ U*W(Y L a P × � u b"j W j�P ub u Pcb W j � u ^W @ � \ ]d^ U*W(Y L a b u b"j W j�P uP × � u Pcb W j � F

(2.81)

2.7.2 robot i2 : the standard formulation

The problemconsistsof a single phasewith a fixed final time: r : L P , J t :Vu t @ K�LJ W]v�u(W]X K.L J b u � K .Thestateandcontrolvariablesare

S�L àâââââãS :S @S ES·äS*Jå æææææç L àâââââã

W :W @^W :^W @K 1v � U W U�L·Y!u ^W U�L·Y(Y78MLå æææææç u HßL � H :H @ � F (2.82)

Theobjective accordingto Section1.2.1is� L � :where

� : L S*J U*W(XZY!F (2.83)

DIRCOL-2.1User’s Guide November1999

Page 42: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

32 2.7Optimalpathtracking for a simplerobot

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas

� : L àâââââã� ::� :@� :E� :ä� :J

å æææææç L àâââââãS ES%äH :H @� U S U*W`Y(Y

å æææææç F (2.84)

Theconditionsattheinitial timeW]v L�b areexplicit conditionsof thefirst kind according

to Equation(1.10)of Section1.2.3.1S :_U*W]vVY L b uS @ U*W v Y L b uS E\U*W]vVY L b F p uS·ä U*W]vVY L b uS*J U*W]vVY L b F (2.85)

The conditionsat the final timeW]X L P areexplicit conditionsof the secondkind ac-

cordingto Equation(1.11)of Section1.2.3.1S :fU*W]XZY L � :U � : U2F Y L b F p uS @iU*W]XZY L � :U � @ U2F Y L b F p uS EiU*W]XZY L � :U � E U2F Y L b uS%ä U*W]XZY L � :U � ä U2F Y L b F p uSTJ U*W]XZY is free.

(2.86)

Thestatevariablesareunconstrained.For thecontrol variableswe usea boundof 10for amaximumaccelerationanddeceleration.Therefore,astheupperandlower boundsofSection1.2.4.1oneobtainsin the

1stphase:W�� J t :Vu t @ K u NQPcb :�v L S :: � ����� j S :fU*W`Y j S :: � ���2� L R�Pcb :�v uNQPcb :�v L S :@ � ����� j S @iU*W`Y j S :@ � ���2� L R�Pcb :�v uNQPcb :�v L S :E � ����� j S EiU*W`Y j S :E � ���2� L R�Pcb :�v uNQPcb L H :: � ����� j H :fU*W`Y j H :: � ���2� L R�Pcb uNQPcb L H :@ � ����� j H @iU*W`Y j H :@ � ���2� L R�Pcb F

(2.87)Controlparametersdo not appearin this problem,i. e., |�~ L�b . Thefinal time is fixed.

Therefore,thelowerandupperboundsfort @

are� L t @ � ����� j t @ j t @ � ���2� L � F(2.88)

Nonlinearinequalityor equalityconstraintsasdescribedin Sections1.2.4and1.2.5donot appearin this problem.Also, thereareno implicit boundaryconditionsof theform ofSection1.2.3.2.

Hence,thedimensionsaccordingto Section1.2arey z | } | ~ r : y{�V� �����Z� : y,�d� �d����� : y{�]� �d����� :p � b P b b bDIRCOL-2.1User’s Guide November1999

Page 43: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.8 Abort landingin thepresenceof a windshear 33

2.8 Abort landing in the presenceof a windshear

“One of the mostdangeroussituationsfor a passengeraircraft in take-off and landing iscausedby the presenceof low-altitudewindshears... Even for a highly-skilled pilot, aninadvertentencounterwith a windshearcan be a fatal problem,sincethe aircraft mightencountera headwindfollowedby a tailwind, bothcoupledwith a down draft ... theabortlandingproblem... is a saferprocedurethanthepenetrationlandingif theinitial altitudeishighenough”[8].

The following statementof the problemhasbeentaken from [8], also the referencesolutionof themin-maxproblemwhich is includedin thesuppliedfiles. Theinvestigationof theproblemwashighly motivatedby thepreviouswork of [27, 28].

2.8.1 Problem descriptionª Jft K

S J ft KFigure2.7: Historyof thealtitude

ª U*W(Yof thepassengeraircraftversusrangeS U*W(Y

(computed solutions of ���V�¡ �¢Q£ (– ñ – ñ –) and multiple shooting(———)) [39].

ThefivestatevariablesarethehorizontaldistanceS , thealtitudeª, therelative velocity

Õ, the relative pathinclination � , andthe relative angleof attack e . The control variableH�L ^e is thetime derivative of theangleof attack.

Thetotal timeof theflight manoeuvreconsideredisW]X Lïn\b s.

Thegivenvaluesof thestatevariablesat initial andfinal time areS U b Y = b [ft], S U*W(XZY is free,ª U b Y = Ûdbib [ft], ª U*W(XZYis free,

Õ U b Y =� ¼i» F q [ft/s],

Õ U*W(XZYis free,� U b Y = NCb F b\¼i» � p [rad], � U*W(XZY = 0.12969[rad],e U b Y = b F P � oi¼ [rad], e U*W(XZY is free.

(2.89)

Theobjective to be maximizedis theminimum altitudeattainedduring theflight ma-noeuvre I�J H·KML Ä BDCvgf 1 f 143 ª U*W(Y N B Äih ?kj (2.90)

DIRCOL-2.1User’s Guide November1999

Page 44: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

34 2.8Abort landingin thepresenceof a windshear

Theequationsof motionof theaircraftare^S L Õ F#G\Ø � Rml :fU S Y!u^ª L Õ Ø�BDC � Rml @iU S u ª Y!u^Õ L n U Õ Yr F#G\Ø�U eßRmo Y N;p U Õ u e Yr N¥Ù Ø�B4C � N Ü ^l :fU S Y7F#G\Ø � R ^l @\U S u ª Y³Ø�BDC � Ý u (2.91)^� L n U Õ Yr Õ Ø�B4C,U eßRmo Y R � U Õ u e Yr Õ N Ù Õ F#G\Ø � R PÕ Ü ^l :VU S Y³Ø�BDC � N ^l @\U S u ª Y7F#G\Ø � Ý u^e L H FThethrust n is givenbyn U Õ Y L> U*W`YaU�q�v R q�: Õ R q�@ Õ @ Y with U*W`Y Lra v R ^ vaWxu b"j W j W�s%uP u W9s j W j W]X³u (2.92)

and v L�b F ¼io � p u ^ v L�b F � J sµ : K andW9s L U PhNt vfY(× ^ v L©¼ F b\o\qdp J sK F

For thedrag p holdsp U Õ u e Y L b F p �vu U e Yxw�9 Õ @ (2.93)

where�vu U e Y L y v R!y : e�R!y @ e @ uw L b F �i� b\¼Qñ\Pcb µ @ J lb s

@ft µ ä K u 9 Lîb F PVpiÛdbQñZPcb ä J ft @ K F

Thelift�

is describedby� U Õ u e Y L b F p � � U e Yxw�9 Õ @ (2.94)

where� � U e Y L a � v R � : e u eTjze|{ u� v R � : eßR � @\U e¡N}e|{ Y @ u e|{�bzeTjze ���2� uek{ L P � J degK ^L b F � b\»�nZ¼i»ipÚP J radK u e ���2� L?b F ¼dbib � J radK F

Thewindshearmodel,valid forª jlPcbibib J ft K , is givenby

l : U S Y L ~���� ����NCpdbòR!��S E R��!S ä u b j S�b pdbib uU SèN � ¼dbib Y(× n\b u pdbib j S�b n#Pcbib updbQNt� U nZÛdbib N¥S Y E N}� U nZÛdbib NeS Y ä u n#Pcbib j S¥j nZÛdbib updb u nZÛdbib j S u (2.95)

l @ U S u ª Y L ªPcbibib ñ ~���� ����é�� S E Rm�cS ä ë u b j S�b pdbib ué NCpÚPk=#?A@ U N�� U SèN � ¼dbib Y ä Y ë u pdbib j S�b n#Pcbib ué � U nZÛdbib NeS Y E R�� U nZÛdbib N�S Y ä ë u n#Pcbib j S¡j nZÛdbib ub u nZÛdbib b S F (2.96)

Theconstantsare(cf. [8, 30])q�v= R b F ninZpiÛ�ñ\Pcb J J lb K , y v = R b F PVpip � ¼i¼i¼i¼i¼i¼i¼ ,q�:= Nhb F � ¼i»io�ñ\Pcb @ J lb sft µ : K , y : = R b F P � ¼iÛi»ÚPan�qdÛ�n J radµ : K ,q�@= R b F Panin � ñ\Pcb µ : J lb s

@ft µ @ K , y @ = R � F n � b � ÛipdbZqdp J radµ @ K ,� v

= R b F q³P � p , � = RêÛêñ\Pcb³µ·º J sµ : ft µ @ K ,� := RêÛ F b\o\qdÛ\qdÛip\qd¼ J radµ : K , � = N�n�ñ\Pcb³µ :(: J sµ : ft µ E K ,� @= NC» F b � qiq³Pfq_nZpÚP J radµ @ K , � = N ln

U � p × ¼db F Û Y ñ\Pcb µ :�@ J ft µ ä K ,�= NCo F b � oiodb\oiÛ � p ñZPcb³µ·º J sµ : ft µ @ K , � = RêÛ F � odb\oi¼�nZoi»i» ñ\Pcb³µ :(: J sµ : ft µ E K ,Ù = Rê¼ F � Pfq � ñ\Pcb : J ft sµ @ K , rßÙ = PVpdbibibib J lb K ,o =

� JdegK ^L b F b\¼�nZ»db\Ûipioip J radK .

(2.97)

DIRCOL-2.1User’s Guide November1999

Page 45: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.8.1 Problemdescription 35

l :l @

S J ft K

Jft/sK

Figure 2.8: Horizontalandverticalcomponentsof thewind velocity.

Theangleof attackandits time derivative areconstrainedby� e U*W`Y � j e ���2� LDb F ¼dbib � J radK u (2.98)� H U*W`Y � j H ���2� Lîb F b\p � ¼iÛ J radK F (2.99)

In [8, 30] « ½ L Ä BDCT� ª ½ U*W(Y X W¦� J b u(W(X K_� Lìpdb � F PVpiÛ � qdo � » J ft K (2.100)

hasbeencomputedfor theobjective.

DIRCOL-2.1User’s Guide November1999

Page 46: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

36 2.8Abort landingin thepresenceof a windshear

2.8.2 windshear : the standard formulation

Theproblemhasonephase,i. e., r : LmP , J t :Vu t @ K.L J b u(W(X K.L J b u n\b�K .For transformationof themin-maxprobleminto standardform with a Mayer-type ob-

jectiveonecontrolparameter«w:

for theminimalaltitudeis introducedby (cf. Section1.3.3)«w: X L Ä B4Cvgf 1 f 143 ª U*W`Y!F (2.101)

Then,anadditionalstateconstrainthasto betakeninto accountÙ :: U S u H u�«wu(W(Y LDS @\U*W`Y N «,: L ª U*W`Y N «,:!� b u b�j W j W(X³F (2.102)

Thetransformedobjective to beminimizedbecomes�I J H u�« KMLÅN « : F (2.103)

Thestatevariables,controlvariables,andcontrolparametersare

SßL àâââââãS :S @S ES äSTJå�æææææç L àâââââã

S ª Õ�eå�æææææç u H�L Ü H : Ý u « L Ü «,: Ý F (2.104)

Theobjective accordingto Section1.2.1is� L � :where

� : L N «,:cF (2.105)

Accordingto Section1.2.2,theright handsideof thedifferentialequationsreadsas

� : L àâââââã� ::� :@� :E� :ä� :J

å æææææç L àâââââã^S ^ª ^Õ ^�H :å æææææç u (2.106)

where^S ,^ª,^Õ,^� have to bereplacedby theexpressionsfor their right handsides.

The conditionsat the initial timeW]v Láb and final time

W(X Lkn\b consistof explicitconditionsof thefirst kind accordingto Equation(1.10)of Section1.2.3.1S : U*W v Y L b uS @iU*W]vfY L Ûdbib uS EiU*W]vfY L � ¼i» F q uS·ä U*W]vfY L Nhb F b\¼i» � p uS*J U*W]vfY L b F P � oi¼ u (2.107)

andoneexplicit conditionof thesecondkind accordingtoEquation(1.11)of Section1.2.3.1S ä U*W(XZY L � :U � ä U2F Y L q F nZ¼ÚPhñ + × PVodb ^L b F P � »iÛi»�n � F (2.108)

DIRCOL-2.1User’s Guide November1999

Page 47: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.8.2 windshear : thestandard formulation 37

As theupperandlower boundsfor thestateandcontrolvariablesof Section1.2.4.1weuse

1stphase:W¦� J t :Vu t @ K u b L S :: � ����� j S :_U*W`Y j S :: � ���2� L R�P F pêñZPcb ä uR Pcb @ L S :@ � ����� j S @ U*W`Y j S :@ � ���2� L R�P F pêñZPcb E ub L S :E � ����� j S E\U*W`Y j S :E � ���2� L R�Pcb :�v uN�Pcb :�v L S :ä � ����� j S·ä U*W`Y j S :ä � ���2� L R�Pcb :�v uN�e ���2� L S :J � ����� j S J U*W`Y j S :J � ���2� L R�e ���2� uN�H ���2� L H :: � ����� j H :_U*W`Y j H :: � ���2� L R�H ���2� F

(2.109)ThestatevariableS%äòL � is anunconstrainedanglebut variesonly within

J N + u R + J . There-fore, theoptionfor specialtreatmentof anglesis selectedfor S%ä in theinput file DATDIM(cf. Section4.2.1.1).

Thelowerandupperboundsfor thecontrolparametersandeventsareR�Pcb L «,: � ����� j «,: j «,: � ���2� L R Pcb :�v uR�n\b L t @ � ����� j t @ j t @ � ���2� L R n\b F (2.110)

Theinequalityconstraintof Equation(2.102)is formulatedaccordingto Section1.2.4

1stphase:W¦� J t :cu t @ K u Ù :: U S u H u�«wu(W`Y LDS @dU*W`Y N «w:(� b F (2.111)

Nonlinearequalityconstraintsasdescribedin Section1.2.5do not appearin this prob-lem. Therefore,the dimensionsof this optimal control problemaccordingto Section1.2are y{z |*} |�~ r : y{�c� �d����� : y,�d� �d����� : y{�]� �����Z� :p P P P P b b

DIRCOL-2.1User’s Guide November1999

Page 48: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

382.9Optimalpoint-to-pointtrajectoriesof a 3-d.o.f.

industrial robot2.9 Optimal point-to-point trajectories of a 3-d.o.f. industrial

robot

2.9.1 Minimum time trajectory: problem description

see[39, 41]The subroutineR3M2SI is dueto Otter andTurk [31]. It is includedby friendly per-

missionof Dr.-Ing. Martin Otter[32].

2.9.2 manutec minimum time : the standard formulation

2.9.3 Minimum energy trajectory: problemdescription

2.9.4 manutec minimum energy : the standard formulation

DIRCOL-2.1User’s Guide November1999

Page 49: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

2.10 Referencesto otherapplicationsof DIRCOL 39

2.10 Referencesto other successfulapplications of �����������In this section,aselectionof referencesto successfulapplicationsof ���V�¡ "¢ê£ is given.

An optimalcontrolproblemin economicswith four linearcontrolsdescribingasophis-ticatedconcernmodelis investigatedby Koslik andBreitner[21]. Thenumericalsolutionis obtainedby a combinationof thedirect collocationmethod ���V�¡ �¢Q£ andan indirectmultiple shootingmethodfor solving the necessaryconditionsfrom optimal control the-ory. Theoptimalcontrolshave bang-bangsubarcsaswell asconstrainedandsingularsub-arcs.Here,thehighly complicatedswitchingstructurehasbeencomputedcorrectlyusing���V�¥ �¢Q£ . Also, thecomputedestimatesof adjointvariablesandthecomputedhistoriesoftheswitchingfunctionshave beenestimatedin anaccuracy of four to five decimals.Thus,the subsequentsolutionof the necessaryconditionsfrom optimal control theory, i. e., themulti-point boundaryvalueproblemfor thestateandadjointvariables,hasbeenfacilitatedenormously.

Zoelch[44, 45] applies���V�¡ "¢ê£ successfullyfor optimizingandratingof thedesignof ahybriddriveline.

DIRCOL-2.1User’s Guide November1999

Page 50: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

110 References

References

[1] Anzill, W.J.:BerechnungundOptimierungdesPhasenrauschensvon Oszillatoren.Dissertation,Fakultat fur Elektrotechnikund Informationstechnik,TechnischeUni-versitat Munchen(1994).

[2] Anzill, W.; von Stryk,O.; Bulirsch,R.; Russer, P.:Phasenoiseminimizationof microwave oscillatorsby optimaldesign.IEEE MTT-SSymposiumDigest,Orlando,Florida,USA (1995)1565-1568.World Wide Web:http://www.sim.informatik.tu-darmstadt .de/p ubl/

[3] Bell, M.:RobustOptimalRecedingHorizonControl.PhDthesis,ImperialCollege,Universityof London(1997).

[4] Betts,J.T.:Survey of numericalmethodsfor trajectoryoptimization.AIAA J.Guidance,Control,andDynamics21, 2 (1998)193-207.

[5] Bryson,A. E.; Denham,W. F.; Dreyfus,S.E.:Optimal programmingproblemswith inequalityconstraints.I: Necessaryconditionsfor extremalsolutions.AIAA J.1, 11 (1963)2544-2550.

[6] Bryson,A. E.; Ho, Y.-C.:Applied OptimalControl.Rev. Printing.(HemispherePublishingCorporation,New York, 1975).

[7] Bulirsch,R.:Die MehrzielmethodezurnumerischenLosungvonnichtlinearenRandwertproblemenundAufgabenderoptimalenSteuerung.Reportof theCarl-Cranz-Gesellschafte.V., DLR, Oberpfaffenhofen,Germany (1971).Reprints:MathematischesInstitut,TechnischeUniversitat Munchen(1985,1993).

[8] Bulirsch,R.; Montrone,F.; Pesch,H. J.:Abort landingin thepresenceof windshearasa minimaxoptimalcontrolproblem.Part1: Necessaryconditions.J.OptimizationTheoryandApplications70 (1991)1-23.Part2: Multiple shootingandhomotopy.J.OptimizationTheoryandApplications70 (1991)223-254.

[9] Bulirsch,R.; Nerz,E.; Pesch,H.J.;von Stryk,O.:CombiningdirectandindirectMethodsin optimalcontrol: Rangemaximizationof ahangglider.In: Bulirsch,R.; Miele, A.; Stoer, J.;Well, K. H. (eds.):OptimalControl— Calculusof Variations,Optimal Control TheoryandNumericalMethods,InternationalSeriesof NumericalMathematics111(Basel:Birkhauser, 1993)273-288.

[10] Fletcher, R.:PracticalMethodsof Optimization.2nded.(J.Wiley, 1987).

DIRCOL-2.1User’s Guide November1999

Page 51: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

References 111

[11] Gill, P. E.; Murray, W.; Saunders,M. A.:User’s Guidefor SNOPT5.3: a FortranPackagefor Large-ScaleNonlinearProgram-ming.ReportNA 97-5, Departmentof Mathematics,University of California, SanDiego(1997).World Wide Web: http://sdna3.ucsd.edu/˜peg/

Version5.3-4. (November/December1998).Seealso:World Wide Web:http://www-fp.mcs.anl.gov/otc/Guide/Softwa reGuid e/Blur bs/sqo pt snopt.html

[12] Gill, P. E.; Murray, W.; Saunders,M. A.; Wright, M. H.:User’s Guidefor NPSOL(Version4.0).ReportSOL 86-2.Departmentof OperationsResearch,StanfordUniversity, Califor-nia (1986).User’sGuidefor NPSOL(Version5.0): aFortranpackagefor nonlinearprogramming.NumericalAnalysisReport98-2,Departmentof Mathematics,Universityof Califor-nia,SanDiego (1998).Seealso:World Wide Web:http://www-fp.mcs.anl.gov/otc/Guide/Softwa reGuid e/Blur bs/nps ol.htm l

[13] Gill, P. E.; Murray, W.; Wright, M. H.:PracticalOptimization.(AcademicPress,1981).

[14] Gill, P. E.; Murray, W.; Saunders,M. A.; M. H. Wright:Sequentialquadraticprogrammingmethodsfor nonlinearprogramming.In NATO ASI Series,Vol. F9, ComputerAided AnalysisandOptimizationof Me-chanicalSystemDynamics.Ed.by E.J.Haug(Springer, 1984)679-700.

[15] Gill, P. E.; Murray, W.; Saunders,M. A.; Wright, M. H.:Sometheoreticalpropertiesof anaugmentedLagrangianmerit function.In: P. M. Pardalos(ed.): Advancesin OptimizationandParallelComputing(ElsevierSciencePublishers,1992)101-128.

[16] Gunn,D.J.;Thomas,W.J.:Masstransportandchemicalreactionin multifunctionalcatalystsystems.Chem.Eng.Sci.20 (1965)89-100.

[17] Hargraves,C.R.:Numericalcomputationof optimalatmosphericvehiclesinvolving stagedvehicles.AIAA Paper82-0360(1982).

[18] Hargraves,C.R.; Paris,S.W.:Direct trajectoryoptimizationusingnonlinearprogrammingandcollocation.AIAA Journalof Guidance10, 4 (1987)338-342.

[19] Heim,A.:Parameteridentifizierungin differential-algebraischenGleichungssystemen.Diplomathesis,Departmentof Mathematics,TechnischeUniversitatMunchen(1992).

DIRCOL-2.1User’s Guide November1999

Page 52: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

112 References

[20] Heim,A.; von Stryk,O.:Documentationof PAREST— A multipleshootingcodefor optimizationproblemsindifferential-algebraic equations.Report TUM-M9616, MathematischesInstitut, TechnischeUniversitat Munchen(1996)31p. World WideWeb:http://www-lit.mathematik.tu-muenchen.d e/vero eff/h tml/96 0.4900 1.html

[21] Koslik, B.; Breitner, M. H.:An optimalcontrolproblemin Economicswith four linearcontrols.J.OptimizationTheoryandApplications94, 3 (1997)619-634.

[22] Koslik, B.; Rill, G.; von Stryk,O.; Zampieri,D.:Activesuspensiondesignfor a tractorby optimalcontrolmethods.Preprint SFB-438-9801, Sonderforschungsbereich 438, Technische UniversitatMunchen– Universitat Augsburg (1998)23p. World Wide Web:http://www-lit.mathematik.tu-muenchen.d e/vero eff/h tml/SF B/982. 49003. html

[23] Kraft, D.:On convertingoptimalcontrolproblemsinto nonlinearprogrammingcodes.In NATO ASI Series,Vol. F15,ComputationalMathematicalProgramming.Ed.by K.Schittkowski (Springer, 1985)261-280.

[24] Kronseder, T.:OptimalControlof ChemicalEngineeringProcesses.Diplomarbeit,ZentrumMathematik,TechnischeUniversitat Munchen(1998).

[25] Logsdon,E.M.:Efficient Determinationof Optimal Control Profilesfor Differential-AlgebraicSys-tems.PhDthesis,Carnegie Mellon University(1990).

[26] DasLRZ-Graphiksystem.Benutzer-Manual:

(a) Weidner, K.:Teil I: Grundsoftware.LRZ-BenutzerschriftNr. 7708/12(1992).

(b) Reinsch,C.; Apostolescu,V.; Weidner, K.:Teil II: Anwendungsprogramme.LRZ-BenutzerschriftNr. 7710/10(1991).

(c) Apostolescu,V.; Weidner, K.:Teil III: “Previewing” amSichtgerat.LRZ-BenutzerschriftNr. 7904/5(1986).

[27] Miele, A.; Wang,T.; Melvin, W.W.:Optimalabortlandingtrajectoriesin thepresenceof windshear.J.OptimizationTheoryandApplications55 (1987)165-202.

DIRCOL-2.1User’s Guide November1999

Page 53: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

References 113

[28] Miele, A.; Wang,T.; Melvin, W. W.:Quasi-steadyflight to quasi-steadyflight transitionfor abortlandingin a windshear:trajectoryoptimizationandguidance.J.OptimizationTheoryandApplications58 (1988)165-207.

[29] Miksch,W.:Ein Konzeptzur optimalenSteuerungundRegelungvon mobilenManipulatoren.Fortschritt-BerichteVDI, Reihe8, Nr. 569(Dusseldorf:VDI-Verlag,1996).

[30] Montrone,F.:Berechnungder optimalenSteuerungeinerBoeing727 beim AuftreteneinesScher-windes.DiplomaThesis,MathematischesInstitut,TechnischeUniversitat Munchen(1989).

[31] Otter, M.; Turk, S.:TheDFVLR Models1 and2 of theManutecr3 Robot.ReportDFVLR-Mitteilung 88-13,Institutefor RoboticsandSystemDynamics,Ger-manAerospaceResearchEstablishment(DLR), Oberpfaffenhofen,Germany (1988).

[32] Otter, M.:Privatecommunication.(1998).

[33] Schittkowski, K.:The nonlinearprogrammingmethodof Wilson, Han andPowell with an augmentedLagrangiantypeline searchfunction.Part1: Convergenceanalysis.Numer. Math.38 (1981)83-114.Part2: An efficient implementationwith linearleastsquaressubproblems.Numer. Math.38 (1981)115-127.

[34] Simeon,B.; Fuhrer, C.; Rentrop,P.:Differential-algebraicequationsin vehiclesystemdynamics.Surv. Math. Ind. 1 (1991)1-37.

[35] Stoer, J.:Principlesof SequentialQuadraticProgrammingmethodsfor solving nonlinearpro-grams.In NATO ASI Series,Vol. F15,ComputationalMathematicalProgramming.Ed.by K.Schittkowski (Springer, 1985)165-207.

[36] Stoer, J.;Bulirsch,R.:Einfuhrungin die NumerischeMathematikII.3. erw. Auflage(Springer, 1990).Introductionto NumericalAnalysis.2nded.(Springer, 1993).

[37] von Stryk,O.:Ein direktesVerfahrenzur Bahnoptimierungvon Luft- und RaumfahrzeugenunterBerucksichtigungvon Beschrankungen.Z. angew. Math.Mech.71, 6 (1991)T705-T706.

DIRCOL-2.1User’s Guide November1999

Page 54: User’s Guide for A Direct Collocation Method for the ... UNIVERSITA¨T DARMSTADT FACHGEBIET SIMULATION UND SYSTEMOPTIMIERUNG (SIM) User’s Guide for A Direct Collocation Method

114 References

[38] von Stryk,O.:Numericalsolutionof optimalcontrolproblemsby directcollocation.In: Bulirsch,R.; Miele, A.; Stoer, J.;Well, K. H. (eds.):OptimalControl— Calculusof Variations,Optimal Control TheoryandNumericalMethods,InternationalSeriesof NumericalMathematics111(Basel:Birkhauser, 1993)129-143.World Wide Web:http://www.sim.informatik.tu-darmstadt .de/p ubl/

[39] von Stryk,O.:NumerischeLosungoptimalerSteuerungsprobleme:Diskretisierung,Parameteropti-mierungundBerechnungderadjungiertenVariablen.Fortschritt-BerichteVDI, Reihe8, Nr. 441(Dusseldorf:VDI-Verlag,1995)158p.World Wide Web:http://www.sim.informatik.tu-darmstadt .de/p ubl/

[40] von Stryk,O.; Bulirsch,R.:Directandindirectmethodsfor trajectoryoptimization.Annalsof OperationsResearch37 (1992)357-373.

[41] von Stryk,O.; Schlemmer, M.:Optimalcontrolof theindustrialrobotManutecr3.In: Bulirsch,R.; Kraft, D. (eds.):ComputationalOptimalControl,InternationalSeriesof NumericalMathematics115(Basel:Birkhauser, 1994)367-382.World Wide Web:http://www.sim.informatik.tu-darmstadt .de/p ubl/

[42] Vassiliadis,V.S.:Computational Solution of Dynamic Optimization Problems with GeneralDifferential-AlgebraicConstraints.PhDthesis,ImperialCollege,Universityof London(1993).

[43] Williams, T.; Kelley, C.:GNUPLOT — An interactive plotting program.Manualfor Version3.5,distributedwith thesoftware(1993).World Wide Web:http://www.cs.dartmouth.edu/gnuplot info.html

[44] Zoelch,U.:Ein Beitragzu optimalerAuslegungundBetriebvon Hybridfahrzeugen.Dissertation,TechnischeUniversitat Munchen(1998).

[45] Zoelch,U.; Schroder, D.:Dynamicoptimizationmethodfor designandrating of the componentsof a hybridvehicle.Int. Journalof VehicleDesign19, 1 (1998)1-13.

DIRCOL-2.1User’s Guide November1999