DingyüXue SolvingOptimizationProblemswithMATLAB® Also of Interest Fractional-OrderControlSystems,FundamentalsandNumerical Implementations DingyüXue,2017 ISBN978-3-11-049999-5,e-ISBN(PDF)978-3-11-049797-7, e-ISBN(EPUB)978-3-11-049719-9 MATLAB®Programming,MathematicalProblemSolutions DingyüXue,2020 ISBN978-3-11-066356-3,e-ISBN(PDF)978-3-11-066695-3, e-ISBN(EPUB)978-3-11-066370-9 CalculusProblemSolutionswithMATLAB® DingyüXue,2020 ISBN978-3-11-066362-4,e-ISBN(PDF)978-3-11-066697-7, e-ISBN(EPUB)978-3-11-066375-4 LinearAlgebraandMatrixComputationswithMATLAB® DingyüXue,2020 ISBN978-3-11-066363-1,e-ISBN(PDF)978-3-11-066699-1, e-ISBN(EPUB)978-3-11-066371-6 DifferentialEquationSolutionswithMATLAB® DingyüXue,2020 ISBN978-3-11-067524-5,e-ISBN(PDF)978-3-11-067525-2, e-ISBN(EPUB)978-3-11-067531-3 Dingyü Xue Solving Optimization Problems with MATLAB® | Author Prof.DingyüXue SchoolofInformationScienceandEngineering NortheasternUniversity WenhuaRoad3rdStreet 110819Shenyang China [email protected] MATLABandSimulinkareregisteredtrademarksofTheMathWorks,Inc.Seewww.mathworks.com/ trademarksforalistofadditionaltrademarks.TheMathWorksPublisherLogoidentifiesbooksthat containMATLABandSimulinkcontent.Usedwithpermission.TheMathWorksdoesnotwarrantthe accuracyofthetextorexercisesinthisbook.Thisbook’suseordiscussionofMATLABandSimulink softwareorrelatedproductsdoesnotconstituteendorsementorsponsorshipbyTheMathWorksof aparticularuseoftheMATLABandSimulinksoftwareorrelatedproducts.ForMATLAB®and Simulink®productinformation,orinformationonotherrelatedproducts,pleasecontact: TheMathWorks,Inc. 3AppleHillDrive Natick,MA,01760-2098USA Tel:508-647-700 Fax:508-647-7001 E-mail:[email protected] Web:www.mathworks.com ISBN978-3-11-066364-8 e-ISBN(PDF)978-3-11-066701-1 e-ISBN(EPUB)978-3-11-066369-3 LibraryofCongressControlNumber:2020931460 BibliographicinformationpublishedbytheDeutscheNationalbibliothek TheDeutscheNationalbibliothekliststhispublicationintheDeutscheNationalbibliografie; detailedbibliographicdataareavailableontheInternetathttp://dnb.dnb.de. ©2020TsinghuaUniversityPressLimitedandWalterdeGruyterGmbH,Berlin/Boston Coverimage:DingyüXue Typesetting:VTeXUAB,Lithuania Printingandbinding:CPIbooksGmbH,Leck www.degruyter.com Preface Scientificcomputingiscommonlyandinevitablyencounteredincourselearning,sci- entificresearchandengineeringpracticeforeachscientificandengineeringstudent andresearcher.Forthestudentsandresearchersinthedisciplineswhicharenotpure mathematics,itisusuallynotawisethingtolearnthoroughlylow-leveldetailsofre- latedmathematicalproblems,andalsoitisnotasimplethingtofindsolutionsofcom- plicatedproblemsbyhand.Itisaneffectivewaytotacklescientificproblems,with highefficiencyandin accurateand creativemanner,withthe mostadvancedcom- putertools.Thismethodisespeciallyusefulinsatisfyingtheneedsforthoseinthe areaofscienceandengineering. Theauthorhadmadesomeefforttowardsthisgoalbyaddressingdirectlytheso- lutionmethodsforvariousbranchesinmathematicsinasinglebook.Suchabook, entitled“MATLABbasedsolutionstoadvancedappliedmathematics”,waspublished firstin2004byTsinghuaUniversityPress.Severalneweditionsarepublishedafter- wards: in 2015, the second edition in English by CRC Press and in 2018, the fourth editioninChinesewerepublished.BasedonthelatestChineseedition,abrandnew MOOCprojectwasreleasedin2018,1 andreceivedsignificantattention.Thenumber oftheregisteredstudentswasaround14000inthefirstroundoftheMOOCcourse, andreachedtensofthousandsinlaterrounds.Thetextbookhasbeencitedtensof thousandstimesbyjournalpapers,books,anddegreetheses. Theauthorhasover30yearsofextensiveexperienceofusingMATLABinscien- tificresearchandeducation.Significantamountofmaterialsandfirst-handknowl- edgehasbeenaccumulated,whichcannotbecoveredinasinglebook.Aseriesenti- tled“ProfessorXueDingyü’sLectureHall”ofsuchworksarescheduledwithTsinghua UniversityPress,andtheEnglisheditionsareincludedintheDGSTEMserieswithDe Gruyter.Thesebooksareintendedtoprovidesystematic,extensiveanddeepexplo- rationsinscientificcomputingskillswiththeuseofMATLABandrelatedtools.The authorwantstoexpresshissincerethankstohissupervisor,ProfessorDerekAtherton ofSussexUniversity,whofirstbroughthimintotheparadiseofMATLAB. TheMATLABseriesisnotasimplerevisionoftheexistingbooks.Withdecades ofexperienceandmaterialaccumulation,theideaof“revisiting”isadoptedinau- thoringthesebooks,incontrasttoothermathematicsandMATLAB-richbooks.The viewpointofanengineeringprofessorisestablishedandthefocusisonsolvingvar- iousappliedmathematicalproblemswithtools.Manyinnovativeskillsandgeneral- purposesolversareprovidedtosolveproblemswithMATLAB,whichisnotpossible byanyotherexistingsolvers,soastobetterillustratetheapplicationsofcomputer toolsinsolvingmathematicalproblemsineverymathematicsbranch.Italsohelps 1 MOOC(inChinese)address:https://www.icourse163.org/learn/NEU-1002660001 https://doi.org/10.1515/9783110667011-201 VI | Preface thereadersbroadentheirviewpointsinscientificcomputing,andevenfindinginno- vativesolutionsbythemselvestoscientificcomputingwhichcannotbesolvedbyany otherexistingmethods. ThefirsttitleintheMATLABseries:“MATLABProgramming”,canbeusedasan entry-level textbook or reference book to MATLAB programming, so as to establish asolidfoundationanddeepunderstandingfortheapplicationofMATLABinscien- tificcomputing.Eachsubsequentvolumestriestocoverabranchortopicinmathe- maticalcourses.Bearinginmindthe“computationalthinking”inauthoringthese- ries, deep understanding and explorations are made for each mathematics branch involved.TheseMATLABbooksaresuitableforthereaderswhohavealreadylearnt therelatedmathematicalcourses,andwanttorevisitthecoursestolearnhowtosolve theproblemsbyusingcomputertools.Itcanalsobeusedasacompanioninsynchro- nizingthelearningofrelatedmathematicscourses,andviewingthecoursefromadif- ferentangle,sothatthereadersmayexpandtheirknowledgeinlearningtherelated courses,soastobetterlearn,understandandpracticethematerialsinthecourses. ThisbookisthefourthoneintheMATLABseries.Twomaintopics–nonlinear equationsolutionsandoptimizationtechniques–arecoveredinthisbook.Wecon- centrateonsolvingtheproblemsinthesetwofields.Analyticalandnumericalsolu- tions of various nonlinear algebraic equations are discussed first, and solution ap- proachesareprovidedtoequationswithmultiplesolutions.Thesubsequentchapters are devoted to introducing unconstrained optimization, linear and quadratic, con- strainednonlinear,mixed-integer,multiobjectiveanddynamicalprogramming.Prac- ticalattemptsaremadeforfindingglobaloptimumsolutions.Someintelligentopti- mizationmethodsareintroduced,andstrictcomparisonsaremadetoassessthebe- haviorsofconventionalandintelligentsolvers,andusefulconclusionsarereached. Atthetimethebooksarepublished,theauthorwishestoexpresshissinceregrat- itudetohiswife,ProfessorYangJun.Herloveandselflesscareoverthedecadespro- vided the author immense power, which supports the authors’ academic research, teaching,andwriting. September2019 XueDingyü Contents Preface|V 1 Anintroductiontoequationsandoptimizationproblems|1 1.1 Equationsandtheirsolutions|1 1.2 Originsanddevelopmentofoptimizationproblems|2 1.3 Structureofthebook|3 1.4 Exercises|4 2 Solutionsofalgebraicequations |7 2.1 Solutionsofpolynomialequations|7 2.1.1 Polynomialequationsofdegrees1and2|8 2.1.2 Analyticalsolutionsofcubicequations|9 2.1.3 Analyticalsolutionsofquarticequation|10 2.1.4 Higher-degreeequationsandAbel–Ruffinitheorem|13 2.2 Graphicalmethodsfornonlinearequations|13 2.2.1 Smoothgraphicsforimplicitfunctions|13 2.2.2 Univariateequations|15 2.2.3 Equationswithtwounknowns|17 2.2.4 Isolatedequationsolutions|20 2.3 Numericalsolutionsofalgebraicequations|20 2.3.1 Newton–Raphsoniterativealgorithm|20 2.3.2 DirectsolutionmethodswithMATLAB|25 2.3.3 Accuracyspecifications|28 2.3.4 Complexdomainsolutions|29 2.4 Accuratesolutionsofsimultaneousequations|31 2.4.1 Analyticalsolutionsoflow-degreepolynomialequations|32 2.4.2 Quasianalyticalsolutionsofpolynomial-typeequations|35 2.4.3 Quasianalyticalsolutionsofpolynomialmatrixequations|37 2.4.4 Quasianalyticalsolutionsofnonlinearequations|40 2.5 Nonlinearmatrixequationswithmultiplesolutions|41 2.5.1 Anequationsolutionideaanditsimplementation|41 2.5.2 Pseudopolynomialequations|46 2.5.3 Aquasianalyticalsolver|48 2.6 Underdeterminedalgebraicequations|49 2.7 Exercises|51 3 Unconstrainedoptimizationproblems|55 3.1 Introductiontounconstrainedoptimizationproblems|55 3.1.1 Themathematicalmodelofunconstrainedoptimizationproblems|55 3.1.2 Analyticalsolutionsofunconstrainedminimizationproblems|56 VIII | Contents 3.1.3 Graphicalsolutions|56 3.1.4 Localandglobaloptimumsolutions|58 3.1.5 MATLABimplementationofoptimizationalgorithms|60 3.2 Directsolutionsofunconstrainedoptimizationproblemwith MATLAB|62 3.2.1 Directsolutionmethods|62 3.2.2 Controloptionsinoptimization|65 3.2.3 Additionalparameters|69 3.2.4 Intermediatesolutionprocess|70 3.2.5 Structuredvariabledescriptionofoptimizationproblems|72 3.2.6 Gradientinformation|73 3.2.7 Optimizationsolutionsfromscattereddata|77 3.2.8 Parallelcomputationinoptimizationproblems|78 3.3 Towardsglobaloptimumsolutions|79 3.4 Optimizationwithdecisionvariablebounds|83 3.4.1 Univariateoptimizationproblem|83 3.4.2 Multivariateoptimizationproblems|85 3.4.3 Globaloptimumsolutions|87 3.5 Applicationexamplesofoptimizationproblems|87 3.5.1 Solutionsoflinearregressionproblems|88 3.5.2 Least-squarescurvefitting|89 3.5.3 Shootingmethodinboundaryvaluedifferentialequations|93 3.5.4 Convertingalgebraicequationsintooptimizationproblems|96 3.6 Exercises|97 4 Linearandquadraticprogramming|103 4.1 Anintroductiontolinearprogramming|104 4.1.1 Mathematicalmodeloflinearprogrammingproblems|104 4.1.2 Graphicalsolutionsoflinearprogrammingproblems|105 4.1.3 Introductiontothesimplexmethod|106 4.2 Directsolutionsoflinearprogrammingproblems|110 4.2.1 Alinearprogrammingproblemsolver|110 4.2.2 Linearprogrammingproblemswithmultipledecisionvectors|116 4.2.3 Linearprogrammingwithdoublesubscripts|117 4.2.4 Transportationproblem|118 4.3 Problem-baseddescriptionandsolutionoflinearprogramming problems|122 4.3.1 MPSfileforlinearprogrammingproblems|122 4.3.2 Problem-baseddescriptionoflinearprogrammingproblems|124 4.3.3 Conversionsinlinearprogrammingproblems|129 4.4 Quadraticprogramming|130 4.4.1 Mathematicalquadraticprogrammingmodels|131 Contents | IX 4.4.2 Directsolutionsofquadraticprogrammingproblems|131 4.4.3 Problem-basedquadraticprogrammingproblemdescription|132 4.4.4 Quadraticprogrammingproblemwithdoublesubscripts|136 4.5 Linearmatrixinequalities|138 4.5.1 Descriptionoflinearmatrixinequalityproblems|138 4.5.2 Lyapunovinequalities|139 4.5.3 ClassificationsofLMIproblems|141 4.5.4 MATLABsolutionsofLMIproblems|142 4.5.5 OptimizationsolutionswithYALMIPtoolbox|144 4.5.6 Trialsonnonconvexproblems|146 4.5.7 Problemswithquadraticconstraints|147 4.6 Exercises|149 5 Nonlinearprogramming|153 5.1 Introductiontononlinearprogramming|153 5.1.1 Mathematicalmodelsofnonlinearprogrammingproblems|154 5.1.2 Feasibleregionsandgraphicalmethods|154 5.1.3 Examplesofnumericalmethods|157 5.2 Directsolutionsofnonlinearprogrammingproblems|159 5.2.1 DirectsolutionusingMATLAB|159 5.2.2 Handlingofearlierterminationphenomenon|165 5.2.3 Gradientinformation|166 5.2.4 Solvingproblemswithmultipledecisionvectors|168 5.2.5 Complicatednonlinearprogrammingproblems|169 5.3 Trialswithglobalnonlinearprogrammingsolver|171 5.3.1 Trialsonglobaloptimumsolutions|171 5.3.2 Nonconvexquadraticprogrammingproblems|174 5.3.3 Concave-costtransportationproblem|176 5.3.4 Testingoftheglobaloptimumproblemsolver|178 5.3.5 Handlingpiecewiseobjectivefunctions|179 5.4 Bilevelprogrammingproblems|181 5.4.1 Bilevellinearprogrammingproblems|182 5.4.2 Bilevelquadraticprogrammingproblem|183 5.4.3 BilevelprogramsolutionswithYALMIPToolbox|184 5.5 Nonlinearprogrammingapplications|185 5.5.1 Maximuminnerpolygoninsideacircle|185 5.5.2 Semiinfiniteprogrammingproblems|189 5.5.3 Poolingandblendingproblem|193 5.5.4 Optimizationdesignofheatexchangenetwork|196 5.5.5 Solvingnonlinearequationswithoptimizationtechniques|199 5.6 Exercises|201