matlab里options,matlab优化函数中options选项的修改

41528d3028836879cd698677c3999917.gifmatlab优化函数中options选项的修改

Matlab优化函数中options选项的修改 (2010-11-12 10:43:58) 转载▼ 标签: 杂谈 通常在使用Matlab优化工具箱中的函数时,需要根据不同要求修改优化选 项,例如最大迭代次数、x处的终止容限等等。可通过 optimset 语句来修改 优化选项参数: options=optimset(‘optionName’,’optionValue’);如: options=optimset( tolx ,1e-100);options=optimset(options, tolfun ,1e-100); 后面还可以依此法添加很多选项信息。 下面举一个完整例子:求取f=4*x(1)^2+5*x(1)*x(2)+2*x(2)^2的最小值 --------------------------------------------------------------------- ------------------------function [f,g]=ff3(x) f=4*x(1)^2+5*x(1)*x(2)+2*x(2)^2; if nargut >1g(1)=8*x(1)+5*x(2);g(2)=5*x(1)+4*x(2); end 通过下面将优化选项结构options.GradObj设置为’on’来得到梯度值。options=optimset(‘Gradobj’,’on’);x0=[1,1]; [x,fval,exitflag]=fminunc(@ff3,x0,options) --------------------------------------------------------------------- ------------------------ Options的参数描述(OPTIMSET): %OPTIMSETPARAMETERS �rivativeCheck- Compare user supplied derivatives (gradients orJacobian) %to finite-differencing derivatives[ on | {off}] %Diagnostics - Print diagnosticination about the function tobe %minimized or solved [ on | {off}] %DiffMaxChange - Maximum change invariables for finite differencegradients %[ positive scalar| {1e-1} ] %DiffMinChange - Minimum change invariables for finite differencegradients %[ positive scalar| {1e-8} ] %Display - Level of display [ off | iter| notify | final ] %GoalsExactAchieve - Number of goals to achieve exactly (do not over- or % under-achieve) [ positive scalar integer | {0}] %GradConstr - Gradients for the nonlinear constraints defined by user % [ on | {off} ] %GradObj - Gradient(s) for the objective function(s) defined by user % [ on | {off}] %Hessian - Hessian for the objective function defined by user [ on | {off} ] %HessMult - Hessian multiply function defined by user % [ function | {[]} ] %HessPattern - Sparsity pattern of the Hessian for finite- differencing % [ sparse matrix ] %HessUpdate - Quasi-Newton updating scheme % [ {bfgs} | dfp | gillmurray | steepdesc ]%Jacobian - Jacobian for the objective function defined by user % [ on | {off}] %JacobMult - Jacobian multiply function defined by user % [ function | {[]} ] %JacobPattern - Sparsity pattern of the Jacobian for finite- differencing % [ sparse matrix ] %LargeScale - Use large-scale algorithm if possible [ {on} | off ] %LevenbergMarquardt - Chooses Levenberg-Marquardt over Gauss-Newton algorithm % [ on | off] %LineSearchType - Line search algorithm choice [ cubicpoly | {quadcubic} ] %MaxFuns - Maximum number of function uations allowed % [ positive integer ] %MaxIter - Maximum number of iterations allowed [ positive integer ] %MaxPCGIter - Maximum number of PCG iterations allowed [positive integer] %MeritFunction - Use goal attainment/minimax merit function % [ {multiobj} | singleobj ] %MinAbsMax - Number of F(x) to minimize the worst case

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值