ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:32.96KB ,
资源ID:8050414      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8050414.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(MATLAB优化工具.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

MATLAB优化工具.docx

1、MATLAB优化工具Find minimum of constrained nonlinear multivariable functionEquationFinds the minimum of a problem specified byb and beq are vectors, A and Aeq are matrices, c(x) and ceq(x) are functions that return vectors, and f(x) is a function that returns a scalar. f(x), c(x),and ceq(x) can be nonlin

2、ear functions.x, lb, and ub can be passed as vectors or matrices; see Matrix Arguments.Syntaxx = fmincon(fun,x0,A,b)x = fmincon(fun,x0,A,b,Aeq,beq)x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub)x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)x = fmincon(proble

3、m)x,fval = fmincon(.)x,fval,exitflag = fmincon(.)x,fval,exitflag,output = fmincon(.)x,fval,exitflag,output,lambda = fmincon(.)x,fval,exitflag,output,lambda,grad= fmincon(.)x,fval,exitflag,output,lambda,grad,hessian= fmincon(.)Descriptionfmincon attempts to find a constrained minimum of a scalar func

4、tion of several variables starting at an initial estimate.This is generally referred to as constrained nonlinear optimization or nonlinear programming.Note:Passing Extra Parameters explains how to pass extra parameters to the objective function and nonlinear constraint functions, if necessary.x = fm

5、incon(fun,x0,A,b) starts at x0 and attempts to find a minimizer x of the function described in fun subject to the linearinequalities A*xb. x0 canbe a scalar, vector, or matrix.x = fmincon(fun,x0,A,b,Aeq,beq) minimizes fun subjectto the linear equalities Aeq*x=beq and A*xb. If no inequalitiesexist, s

6、et A = and b = .x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub) definesa set of lower and upper bounds on the design variables in x,so that the solution is always in the range lbxub.If no equalities exist, set Aeq = and beq= . If x(i) is unbounded below, set lb(i)= -Inf, and if x(i) is unbounded above,set ub(

7、i) = Inf.Note:If the specified input bounds for a problem are inconsistent,the output x is x0 and the output fval is .Components of x0 that violate the bounds lbxub are reset to the interior of the box definedby the bounds. Components that respect the bounds are not changed.See Iterations Can Violat

8、e Constraints.x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon) subjectsthe minimization to the nonlinear inequalities c(x) orequalities ceq(x) defined in nonlcon. fmincon optimizessuch that c(x)0 and ceq(x)=0. If no bounds exist, set lb= and/or ub = .x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options

9、) minimizeswith the optimization options specified in options.Use optimoptions to set theseoptions. If there are no nonlinear inequality or equality constraints,set nonlcon = .x = fmincon(problem) finds the minimumfor problem, where problem isa structure described in Input Arguments. Create the prob

10、lem structure by exporting a problem from Optimization app, as described in Exporting Your Work.x,fval = fmincon(.) returns the value of the objective function fun at the solution x.x,fval,exitflag = fmincon(.) returns a value exitflag that describes the exit condition of fmincon.x,fval,exitflag,out

11、put = fmincon(.) returns a structure output with information about the optimization.x,fval,exitflag,output,lambda = fmincon(.) returns a structure lambda whose fields contain the Lagrange multipliers at the solution x.x,fval,exitflag,output,lambda,grad= fmincon(.) returns the value of the gradient o

12、f fun atthe solution x.x,fval,exitflag,output,lambda,grad,hessian= fmincon(.) returns the value of the Hessian at thesolution x. See fmincon Hessian.Input ArgumentsFunction Arguments describes the arguments passed to fmincon. Options provides the function-specific details for the options values. Thi

13、s section provides function-specific details for fun, nonlcon,and problem.FunThe function to be minimized. fun is a function that accepts a vector x and returns a scalar f, the objective function evaluated at x. fun can be specified as a function handle for a file:x = fmincon(myfun,x0,A,b)where myfu

14、n is a MATLAB function such asfunction f = myfun(x)f = . % Compute function value at xfun can also be a function handle for an anonymous function:x = fmincon(x)norm(x)2,x0,A,b);If the gradient of fun can also be computed and the GradObj option is on, as set byoptions = optimoptions(fmincon,GradObj,o

15、n)then fun must return the gradient vector g(x) in the second output argument.If the Hessian matrix can also be computed and the Hessian option is on via options=optimoptions (fmincon,Hessian,user-supplied) and the Algorithm option is trust-region-reflective, fun must return the Hessian value H(x),

16、a symmetric matrix, in a third output argument. fun can give a sparse Hessian. See Writing Objective Functions for details.If the Hessian matrix can be computed and the Algorithm option is interior-point, there are several ways to pass the Hessian to fmincon. For more information,see Hessian.A, b, A

17、eq, beqLinear constraint matrices A and Aeq, and their corresponding vectors b and beq, can be sparse or dense. The trust-region-reflective and interior-point algorithms use sparse linear algebra. If A or Aeq is large, with relatively few nonzero entries, save running time and memory in the trust-re

18、gion-reflective or interior-point algorithms by using sparse matrices. NonlconThe function that computes the nonlinear inequality constraints c(x) 0 and the nonlinear equality constraints ceq(x) = 0. nonlcon accepts a vector x and returns the two vectors c and ceq. c is a vector that contains the no

19、nlinear inequalities evaluated at x, and ceq is a vector that contains the nonlinear equalities evaluated at x. nonlcon should be specified as a function handle to a file or to an anonymous function,such as mycon:x = fmincon(myfun,x0,A,b,Aeq,beq,lb,ub,mycon)where mycon is a MATLAB function such asfu

20、nction c,ceq = mycon(x)c = . % Compute nonlinear inequalities at x.ceq = . % Compute nonlinear equalities at x.If the gradients of the constraints can also be computed and the GradConstr option is on, as set byoptions = optimoptions (fmincon,GradConstr,on) then nonlcon must also return, in the third

21、 and fourth output arguments, GC, the gradient of c(x), and GCeq, the gradient of ceq(x). GC and GCeq can be sparse or dense. If GC or GCeq is large, with relatively few nonzero entries, save running time and memory in the interior-point algorithm by representing them as sparse matrices. For more in

22、formation, see Nonlinear Constraints.NoteBecause Optimization Toolbox functions only accept inputs of type double, user-supplied objective and nonlinear constraint functions must return outputs of type double. Problemobjective Objective functionx0 Initial point for xAineq Matrix for linear inequalit

23、y constraintsbineq Vector for linear inequality constraintsAeq Matrix for linear equality constraintsbeq Vector for linear equality constraintslbVector of lower boundsubVector of upper boundsnonlcon Nonlinear constraint functionsolver fminconoptions Options created with optimoptionsOutput ArgumentsF

24、unction Arguments describes arguments returned by fmincon. This section provides function-specific details for exitflag, lambda, and output: ExitflagInteger identifying the reason the algorithm terminated. The following lists the values of exitflag and the corresponding reasons the algorithm termina

25、ted. All Algorithms:1 First-order optimality measure was less than options.TolFun, and maximum constraint violation was less than options.TolCon.0 Number of iterations exceeded options.MaxIter or number of function evaluations exceeded options.MaxFunEvals.-1 Stopped by an output function or plot fun

26、ction.-2 No feasible point was found.trust-region-reflective, interior-point, and sqp algorithms:2 Change in x was less than options.TolX and maximum constraint violation was less than options.TolCon.trust-region-reflective algorithm only:3 Change in the objective function value was less than option

27、s.TolFun and maximum constraint violation was less than options.TolCon.active-set algorithm only:4 Magnitude of the search direction was less than 2*options.TolX and maximum constraint violation was less than options.TolCon.5 Magnitude of directional derivative in search direction was less than 2*op

28、tions.TolFun and maximum constraint violation was less than options.TolCon.interior-point and sqp algorithms:-3 Objective function at current iteration went below options.ObjectiveLimit and maximum constraint violation was less than options.TolCon.Grad Gradient at xHessian Hessian at xLambda Structu

29、re containing the Lagrange multipliers at the solution x (separated by constraint type). The fields of the structure are:Lower Lower bounds lbUpper Upper bounds ubIneqlin Linear inequalitieseqlinLinear equalitiesineqnonlin Nonlinear inequalitieseqnonlin Nonlinear equalitiesoutput Structure containin

30、g information about the optimization. The fields of the structure are:iterations Number of iterations takenfuncCount Number of function evaluationslssteplength Size of line search step relative to search direction (active-set algorithm only)constrviolation Maximum of constraint functionsstepsize Len

31、gth of last displacement in x (active-set and interior-point algorithms)algorithm Optimization algorithm usedcgiterations Total number of PCG iterations (trust-region-reflective and interior-point algorithms)firstorderopt Measure of first-order optimality message Exit messageHessianfmincon uses a Hessian as an optional input. This Hessian is the second derivatives of the Lagrangian (see Equation3-1), namely,The various fmincon algorithms handle input Hessians differently:The active-set and sqp algorithms do not accept a user-supplied Hessian. They compute a quasi-Newton ap

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1