多目标非线性规划程序Matlab完整版.docx
- 文档编号:452700
- 上传时间:2022-10-10
- 格式:DOCX
- 页数:14
- 大小:19.18KB
多目标非线性规划程序Matlab完整版.docx
《多目标非线性规划程序Matlab完整版.docx》由会员分享,可在线阅读,更多相关《多目标非线性规划程序Matlab完整版.docx(14页珍藏版)》请在冰豆网上搜索。
多目标非线性规划程序Matlab完整版
Documentserialnumber【NL89WT-NY98YT-NC8CB-NNUUT-NUT108】
多目标非线性规划程序Matlab
function[errmsg,Z,X,t,c,fail]=BNB18(fun,x0,xstat,xl,xu,A,B,Aeq,Beq,nonlcon,setts,options1,options2,maxSQPit,varargin);
%·Dêy1£Díóa·§¨μü′ú·¨£úDê1ó£DèOptimizationtoolbox§3
%MinimizeF(x)
%subjectto:
xlb<=x<=xub
%A*x<=B
%Aeq*x=Beq
%C(x)<=0
%Ceq(x)=0
%
%x(i)éaáD±á£êy£ò1ì¨μ
%ê1óê
%[errmsg,Z,X]=BNB18('fun',x0,xstat,xl,xu,A,B,Aeq,Beq,'nonlcon',setts)
%fun£oMt£±íê×Dˉ±êoˉêyf=fun(x)
%x0:
áDòᣱíê±á3μ
%xstat£oáDòá£xstat(i)=0±íêx(i)aáD±á£1±íêêy£2±íê1ì¨μ
%xl£oáDòᣱíê±á
%xu:
áDòᣱíê±áé
%A:
ó,±íêD2μèêêμêy
%B:
áDòá,±íêD2μèêêé
%Aeq:
ó,±íêDμèêêμêy
%Beg:
áDòá,±íêD2μèêêóòμ
%nonlcon:
Mt£±íê·Dêoˉêy[C,Ceq]=nonlin(x),DC(x)a2μèêê,
%Ceq(x)aμèêê
%setts:
·¨éè
%errmsq:
·μ′íóìáê
%Z:
·μ±êoˉêy×Dμ
%X:
·μ×óa
%
%àyìa
%maxx1*x2*x3
%-x1+2*x2+2*x3>=0
%x1+2*x2+2*x3<=72
%10<=x2<=20
%x1-x2=10
%èD′Moˉêy
%functionf=discfun(x)
%f=-x
(1)*x
(2)*x(3);
%óa
%clear;x0=[25,15,10]';xstat=[111]';
%xl=[2010-10]';xu=[302020]';
%A=[1-2-2;122];B=[072]';Aeq=[1-10];Beq=10;
%[err,Z,X]=BNB18('discfun',x0,xstat,xl,xu,A,B,Aeq,Beq);
%XMAX=X',ZMAX=-Z
%
%BNB18Findstheconstrainedminimumofafunctionofseveralpossiblyintegervariables.
%Usage:
[errmsg,Z,X,t,c,fail]=
%BNB18(fun,x0,xstatus,xlb,xub,A,B,Aeq,Beq,nonlcon,settings,options1,options2,maxSQPiter,P1,P2,...)
%
%BNBsolvesproblemsoftheform:
%MinimizeF(x)subjectto:
xlb<=x0<=xub
%A*x<=BAeq*x=Beq
%C(x)<=0Ceq(x)=0
%x(i)iscontinuousforxstatus(i)=0
%x(i)integerforxstatus(i)=1
%x(i)fixedforxstatus(i)=2
%
%BNBuses:
%OptimizationToolboxVersion(R11)09-Oct-1998
%Fromthistoolboxiscalled.Formoreinfotypehelpfmincon.
%
%funisthefunctiontobeminimizedandshouldreturnascalar.F(x)=feval(fun,x).
%x0isthestartingpointforx.x0shouldbeacolumnvector.
%xstatusisacolumnvectordescribingthestatusofeveryvariablex(i).
%xlbandxubarecolumnvectorswithlowerandupperboundsforx.
%AandAeqarematricesforthelinearconstrains.
%BandBeqarecolumnvectorsforthelinearconstrains.
%nonlconisthefunctionforthenonlinearconstrains.
%[C(x);Ceq(x)]=feval(nonlcon,x).BothC(x)andCeq(x)shouldbecolumnvectors.
%
%errmsgisastringcontaininganerrormessageifBNBfoundanerrorintheinput.
%Zisthescalarresultoftheminimization,Xthevaluesoftheaccompanyingvariables.
%tisthetimeelapsedwhilethealgorithmBNBhasrun,cisthenumberofBNBcyclesand
%failisthenumberofunsolvedleafsub-problems.
%
%settingsisarowvectorwithsettingsforBNB:
%settings
(1)(standard0)if1:
usephase1byrelaxation.Thissometimesmakesthealgorithm
%faster,becausephase1meansthealgorithmfirstchecksifthereisafeasiblesolution
%forasub-problembeforetryingtofindabestsolution.IfthereisnofeasiblesolutionBNB
%willnottrytofindabestsolution.
%settings
(2)(standard0)if1:
ifthesub-problemdidnotconvergedonotbranch.Ifasub-
%problemdidnotconvergethismeansBNBdidnotfindasolutionforit.NormallyBNBwill
%branchtheproblemsoitcantryagaintofindasolution.
%Asub-problemthatisaleafofthebranch-and-bound-threecannotbebranched.Ifsuch
%aproblemdoesnotconvergeitwillbeconsideredunfeasibleandtheparameterfailwillbe
%raisedbyone.
%settings(3)(standard0)if1:
if1asub-problemthatdidnotconvergebutdidreturnafeasible
%pointwillbeconsideredconvergent.Thismightbeusefuliffminconishavingahardtimewith
%acertainproblembutyoudowantsomeresults.
%options1andoptions2areoptionsstructuresforphase1andphase2.
%Fordetailsabouttheoptionsstructuretypehelpoptimset.
%maxSQPiterisaglobalvariableusedbyfmincon(ifmodifiedasdescribedin.
%maxSQPiteris1000bydefault.
%P1,P2,...areparameterstobepassedtofunandnonlcon.
%F(x)=feval(fun,x,P1,P2,...).[C(x);Ceq(x)]=feval(nonlcon,x,P1,P2,...).
%TypeeditBNB18formoreinfo.
%.Kuipers
%FI-Lab
%AppliedPhysics
%RijksuniversiteitGroningen
%Togetridofbugsandtostopfminconfromhangingmakethefollowingchances:
%
%Inoptim/private/($Revision:
$$Date:
1998/08/2413:
46:
15$):
%GetEXITFLAGindependentofverbosity.
%Afterthelines:
disp('lessthan2*butconstraintsarenotsatisfied.')
%end
%EXITFLAG=-1;
%end
%end
%status=1;
%addtheline:
if(strncmp(howqp,'i',1)&mg>0),EXITFLAG=-1;end;
%
%Inoptim/private/($Revision:
$$Date:
1998/09/0121:
37:
56$):
%Stopqpsubfromhanging.
%Aftertheline:
%AndyGrace7-9-90.MaryAnnBranch9-30-96.
%addtheline:
globalmaxSQPiter;
%andchangedtheline:
maxSQPiters=Inf;
%totheline:
ifexist('maxSQPiter','var'),maxSQPiters=maxSQPiter;elsemaxSQPite
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 多目标 非线性 规划 程序 Matlab 完整版
![提示](https://static.bdocx.com/images/bang_tan.gif)