高等应用数学问题的MATLAB求解06_第1页
高等应用数学问题的MATLAB求解06_第2页
高等应用数学问题的MATLAB求解06_第3页
高等应用数学问题的MATLAB求解06_第4页
高等应用数学问题的MATLAB求解06_第5页
已阅读5页,还剩133页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、星期四, 2008-4- 24, 22:08:13 Slide 1 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Chapter 6Nonlinear Equations and Optimization ProblemsSolving Applied Mathematical Problems with MATLABCRC/Taylor & Francis PressChinese version by Tsinghua

2、University PressPPT by Wenbin Dong and Jun Peng, Northeastern University, PRCProofread by Dingyu Xue & YangQuan Chen 星期四, 2008-4- 24, 22:08:13 Slide 2 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Chapter 6 Nonlinear Equations and Optimi

3、zation ProblemsSolutions to Nonlinear Algebraic EquationsSolving Unconstrained Optimization ProblemsSolving Constrained Optimization ProblemsSolving Mixed Integer Programming ProblemsLinear Matrix Inequalities星期四, 2008-4- 24, 22:08:13 Slide 3 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mat

4、hematical Problems with MATLAB, CRC Press, 2008 6.1 Solutions to Nonlinear Algebraic EquationsGraphical method for solving nonlinear equationsQuasi-analytical solutions to polynomial-type equationsNumerical solutions to ordinary nonlinear equationsSolutions to nonlinear matrix equations星期四, 2008-4-

5、24, 22:08:13 Slide 4 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.1.1 Graphical method for solving nonlinear equationsGraphically solving nonlinear equations of a single variableGraphically solving nonlinear equations of two variablesNot

6、suitable more equations with more variables星期四, 2008-4- 24, 22:08:13 Slide 5 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Graphically solving nonlinear equations of a single variableThe function ezplot() can be used to draw the curves from

7、the implicit function . The real solutions to the equations can be retrieved from the intersections of the curves with 星期四, 2008-4- 24, 22:08:13 Slide 6 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.1Graphically solve :MATLAB comma

8、nds:Verification:星期四, 2008-4- 24, 22:08:13 Slide 7 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Graphically solving nonlinear equations of two variablesUse ezplot() function to draw the all the equations. The intersections of the curves are

9、 then the solutions to the original simultaneous equations星期四, 2008-4- 24, 22:08:13 Slide 8 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.2Graphically solve the following:Plot of the first function:Plot of the second function:星期四,

10、2008-4- 24, 22:08:13 Slide 9 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The rectangular region can be selected星期四, 2008-4- 24, 22:08:13 Slide 10 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC

11、Press, 2008 6.1.2 Quasi-analytical solutions to polynomial-type equationsSpecial equations such as polynomial equations, may be of high orderAbel-Ruffini Theorem claim that no analytical solution method for 5+th order equationNumerical solution not accurateHigh precision methods existMany equations

12、can be converted into polynomial equations星期四, 2008-4- 24, 22:08:13 Slide 11 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.3Graphically solveMATLAB command solutions:星期四, 2008-4- 24, 22:08:13 Slide 12 (of 138) Dingy Xue and YangQua

13、n Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The syntax to solve polynomial-type equationsthe simplestdirect solutionsvariables specified星期四, 2008-4- 24, 22:08:13 Slide 13 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press

14、, 2008 Example 6.4Applying solve() function to solveMATLAB command solutions:Verification:星期四, 2008-4- 24, 22:08:13 Slide 14 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.5Solve MATLAB command solutions:Verification:星期四, 2008-4- 24

15、, 22:08:13 Slide 15 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 When the last equation is changed intoMATLAB command solutions:星期四, 2008-4- 24, 22:08:13 Slide 16 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems w

16、ith MATLAB, CRC Press, 2008 Example 6.6SolveMATLAB command solutions: 星期四, 2008-4- 24, 22:08:13 Slide 17 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Verification:星期四, 2008-4- 24, 22:08:13 Slide 18 (of 138) Dingy Xue and YangQuan Chen, Solv

17、ing Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.7Solve the equations with constantsMATLAB command solutions:星期四, 2008-4- 24, 22:08:13 Slide 19 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.1.3 Numerical solutions t

18、o ordinary nonlinear equationsThe syntax of getting real numerical solutions to given nonlinear equationssimple syntaxformal syntax星期四, 2008-4- 24, 22:08:13 Slide 20 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The syntax of selecting metho

19、ds and control accuraciesget default control templateset control parametersOr 星期四, 2008-4- 24, 22:08:13 Slide 21 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Procedures in Solving Numerically Algebraic EquationsSet the variables, so that th

20、e equations areDescribe the equations withM-functionAnonymous functionInline function, again not recommendedSolve the equations Verify the solutions星期四, 2008-4- 24, 22:08:13 Slide 22 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.8G

21、iven select variables and convert the original ODEs toMatrix form星期四, 2008-4- 24, 22:08:13 Slide 23 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Ways of describing the equation M-functionAnonymous functionInline function星期四, 2008-4- 24, 22:

22、08:13 Slide 24 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 When the initial values areWhen another initial search point usedNOTE: the selection of different initial values may lead to different solutions. 星期四, 2008-4- 24, 22:08:13 Slide 25

23、 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.9Lambert function , is variable, is the solution of . For different , solve and plot .Solution tactics and procedureUse for loopUse anonymous function to describeGenerate w vectorPlot

24、the curve of the functionMATLAB solutions:星期四, 2008-4- 24, 22:08:13 Slide 26 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 MATLAB statementsDirect solution, with lambertw function:星期四, 2008-4- 24, 22:08:13 Slide 27 (of 138) Dingy Xue and Yan

25、gQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.10Solve numericallyUsing the solve() functionUsing graphical method for initial value:星期四, 2008-4- 24, 22:08:13 Slide 28 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, C

26、RC Press, 2008 Re-setting the relevant precision control variablesThe expected precision may not be reachedHowever the best result under double-precision scheme can be obtained星期四, 2008-4- 24, 22:08:13 Slide 29 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB,

27、CRC Press, 2008 Summary of three types of algebraic equation solution methodsGraphical methods, ezplotAdvantages: all real solutions within a region can be found; good overview for the solutionsDisadvantages: Only applicable to 1D and 2D equations; not accurate; only real solutions Quasi-analytical

28、methods, solveAdvantages: Real/imaginary, more accurateDisadvantages: Only applies to polynomial type equations; not allowed to select initial point星期四, 2008-4- 24, 22:08:13 Slide 30 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Pure numeric

29、al methods fsolveAdvantages: Can be used to solve multi-dimensional nonlinear equations; freely select initial search point, accurate than graphical methodDisadvantages: Imaginary solutions cannot be found; for polynomial type equations, not so goodCombination of algorithms, hintsFor 1D and 2D equat

30、ions, use graphical method to spot an approximate solutionUse the solution as an initial point, search for more accurate solutions with fsolve星期四, 2008-4- 24, 22:08:13 Slide 31 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.1.4 Solutions to

31、 nonlinear matrix equationsRiccati equation in Chapter 4, explorationMore nonlinear matrix equations, e.g.,Generalized Riccati equationModified Riccati equationMany many more matrix equations星期四, 2008-4- 24, 22:08:13 Slide 32 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problem

32、s with MATLAB, CRC Press, 2008 fsolve() can only solve , not vector , vector , no matrices involvedConvert matrix equation into vector equationsVector to matrix math MATLABMatrix to vector mathMATLAB Riccati equation solver星期四, 2008-4- 24, 22:08:13 Slide 33 (of 138) Dingy Xue and YangQuan Chen, Solv

33、ing Applied Mathematical Problems with MATLAB, CRC Press, 2008 M-function to describe Riccati equation in vector formA new function to solve Riccati equation星期四, 2008-4- 24, 22:08:13 Slide 34 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Exa

34、mple 6.11Solve the following Riccati equations: with星期四, 2008-4- 24, 22:08:13 Slide 35 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 are() function may find oneRepeated use of MATLAB commands:Another solution星期四, 2008-4- 24, 22:08:13 Slide 3

35、6 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.12Givenwhere find and verify all the possible solutions星期四, 2008-4- 24, 22:08:13 Slide 37 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC

36、Press, 2008 For the Riccati-like equationAnother M-functionAnother matrix equation solver星期四, 2008-4- 24, 22:08:13 Slide 38 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Repeated MATLAB command:Be patient, some of the solutions may be diffic

37、ult to find. Run the function multiple times星期四, 2008-4- 24, 22:08:13 Slide 39 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Possible solutions, all passed verifications 星期四, 2008-4- 24, 22:08:13 Slide 40 (of 138) Dingy Xue and YangQuan Chen

38、, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.2 Solving Unconstrained Optimization ProblemsAnalytical solutions and graphical solution methodsNumerical solution using MATLABGlobal minima and local minimaSolving optimization problems using gradient informationOptimization pro

39、blems with boundary constraints星期四, 2008-4- 24, 22:08:13 Slide 41 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The mathematical description to unconstrained minimization problemsObjective function is a scalar onevector decision variables, o

40、r optimum variables Physical meaning: find the vector that minimizes the objective functionMaximization problem, Mathematical description星期四, 2008-4- 24, 22:08:13 Slide 42 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.2.1 Analytical soluti

41、ons and graphical solution methodsThe necessary conditions for an unconstrained optimization problemwhere is the optimum pointEquation solution may be more difficult, also second-order derivatives needed星期四, 2008-4- 24, 22:08:13 Slide 43 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathemat

42、ical Problems with MATLAB, CRC Press, 2008 Example 6.13Study the optimality of Plot of the first order derivative function of 星期四, 2008-4- 24, 22:08:13 Slide 44 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Draw the first-order derivative an

43、d verify positive 2nd-order derivative星期四, 2008-4- 24, 22:08:13 Slide 45 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.2.2 Numerical solution using MATLABThe syntax of finding numerical solutionsimplest statementOr more general formOr 星期四,

44、 2008-4- 24, 22:08:13 Slide 46 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Describing the objective functionM-function, Anonymous functionInline function, again not recommendedNo intermediate variable allowed in anonymous function or inlin

45、e function星期四, 2008-4- 24, 22:08:13 Slide 47 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.14Given , find its minimum. Using fminsearch():Using fminunc():星期四, 2008-4- 24, 22:08:13 Slide 48 (of 138) Dingy Xue and YangQuan Chen, Solv

46、ing Applied Mathematical Problems with MATLAB, CRC Press, 2008 Draw the searching trajectory:星期四, 2008-4- 24, 22:08:13 Slide 49 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 星期四, 2008-4- 24, 22:08:13 Slide 50 (of 138) Dingy Xue and YangQuan

47、Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.2.3 Global minimums and local minimumsThe necessary condition for a minimum point to exist is that .Using search method, only one such a point may be found from a given initial point. It is the global minimum.星期四, 2008-4- 24,

48、 22:08:13 Slide 51 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.15Givenobserve that different initial values give different minima.Construct objective functionThe initial search point is星期四, 2008-4- 24, 22:08:13 Slide 52 (of 138)

49、Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The initial search point isPlot of for :Plot of for :星期四, 2008-4- 24, 22:08:13 Slide 53 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.2.4 Solvi

50、ng optimization problems using gradient informationThe optimums may not be obtained using the information provided in the objective function alone, since the convergence speed for solving optimization problems may be very low.The gradient information can be used to solve the problem.星期四, 2008-4- 24,

51、 22:08:13 Slide 54 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.16Solving unconstrained optimization problem for the Rosenbrock function:Plotting the 3D contour map:星期四, 2008-4- 24, 22:08:13 Slide 55 (of 138) Dingy Xue and YangQua

52、n Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Without the gradient informationDetermine the gradient matrix星期四, 2008-4- 24, 22:08:13 Slide 56 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Prepare the objective fu

53、nction:Solve the optimization problem星期四, 2008-4- 24, 22:08:13 Slide 57 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.2.5 Optimization problems with boundary constraintsThe mathematical description to boundary constraints problem is where

54、the notation s.t. means subject toJohn DErrico, fminsearchbnd function, on CD星期四, 2008-4- 24, 22:08:13 Slide 58 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The syntax of finding optimization problems with boundary constraintssimplest state

55、ment more general form星期四, 2008-4- 24, 22:08:13 Slide 59 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.17Solving Rosenbrock problemwhere and .MATLAB command solutions:星期四, 2008-4- 24, 22:08:13 Slide 60 (of 138) Dingy Xue and YangQu

56、an Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.3 Solving Constrained Optimization ProblemsConstraints and feasibility regionsSolving linear programming problemsSolving quadratic programming problemsSolving general nonlinear programming problems星期四, 2008-4- 24, 22:08:13

57、 Slide 61 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.3.1 Constraints and feasibility regionsThe general description of constrained nonlinear optimization problems:whereAll x satisfying the constraints form the so-called feasible region.

58、星期四, 2008-4- 24, 22:08:13 Slide 62 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 Example 6.18Graphically solve:The objective functionThe feasible region星期四, 2008-4- 24, 22:08:13 Slide 63 (of 138) Dingy Xue and YangQuan Chen, Solving Applied

59、Mathematical Problems with MATLAB, CRC Press, 2008 Illustration of feasible region星期四, 2008-4- 24, 22:08:13 Slide 64 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 6.3.2 Solving linear programming problemsThe general mathematical description

60、to linear programming (LP) problemsAll linearNote, standard form 星期四, 2008-4- 24, 22:08:13 Slide 65 (of 138) Dingy Xue and YangQuan Chen, Solving Applied Mathematical Problems with MATLAB, CRC Press, 2008 The syntaxes of solving LP problems:星期四, 2008-4- 24, 22:08:13 Slide 66 (of 138) Dingy Xue and YangQuan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论