资源描述:
《多目标非线性规划程序(matlab)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、function[errmsg,Z,X,t,c,fail]=BNB18(fun,x0,xstat,xl,xu,A,B,Aeq,Beq,nonlcon,setts,options1,options2,maxSQPit,varargin);%·ÇÏßÐÔÕûÊý¹æ»®Ä£ÐÍÇó½â·ÖÖ§¶¨½çµü´úËã·¨¡£ÔÚMATLAB5.3ÖÐʹÓã¬ÐèOptimizationtoolbox2.0Ö§³Ö?%MinimizeF(x)%subjectto:xlb<=x<=xub%A*x<=B%Aeq*x=Beq%C(x)<=0%C
2、eq(x)=0%%x(i)¿ÉΪÁ¬Ðø±äÁ¿£¬ÕûÊý£¬»ò¹Ì¶¨Öµ%ʹÓøñʽ%[errmsg,Z,X]=BNB18('fun',x0,xstat,xl,xu,A,B,Aeq,Beq,'nonlcon',setts)%fun£ºMÎļþÃû£¬±íʾ×îС»¯Ä¿±êº¯Êýf=fun(x)%x0:ÁÐÏòÁ¿£¬±íʾ±äÁ¿³õÖµ%xstat£ºÁÐÏòÁ¿£¬xstat(i)=0±íʾx(i)ΪÁ¬Ðø±äÁ¿£¬1±íʾÕûÊý£¬2±íʾ¹Ì¶¨Öµ%xl£ºÁÐÏòÁ¿£¬±íʾ
3、±äÁ¿Ï½ç%xu:ÁÐÏòÁ¿£¬±íʾ±äÁ¿ÉϽç%A:¾ØÕó,±íʾÏßÐÔ²»µÈʽԼÊøϵÊý%B:ÁÐÏòÁ¿,±íʾÏßÐÔ²»µÈʽԼÊøÉϽç%Aeq:¾ØÕó,±íʾÏßÐÔµÈʽԼÊøϵÊý%Beg:ÁÐÏòÁ¿,±íʾÏßÐÔ²»µÈʽԼÊøÓÒ¶ËÖµ%nonlcon:MÎļþÃû£¬±íʾ·ÇÏßÐÔÔ¼Êøº¯Êý[C,Ceq]=nonlin(x),ÆäÖÐC(x)Ϊ²»µÈʽԼÊø,%Ceq(x)ΪµÈʽԼÊø%setts:Ëã·¨ÉèÖÃ%e
4、rrmsq:·µ»Ø´íÎóÌáʾ%Z:·µ»ØÄ¿±êº¯Êý×îСֵ%X:·µ»Ø×îÓŽâ%%ÀýÌâ%maxx1*x2*x3%-x1+2*x2+2*x3>=0%x1+2*x2+2*x3<=72%10<=x2<=20%x1-x2=10%ÏÈдMº¯Êýdiscfun.m%functionf=discfun(x)%f=-x(1)*x(2)*x(3);%Çó½â%clear;x0=[25,15,10]';xstat=[111]';%xl=[2010-10]';xu=[302020]';%A=[1-2-2;122];B=[
5、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
6、,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:%OptimizationToolboxVersion2.0(R11)09-Oct-1998%F
7、romthistoolboxfmincon.miscalled.Formoreinfotypehelpfmincon.%%funisthefunctiontobeminimizedandshouldreturnascalar.F(x)=feval(fun,x).%x0isthestartingpointforx.x0shouldbeacolumnvector.%xstatusisacolumnvectordescribingthestatusofeveryvariablex(i).%xlbandxubarecolumnvectors
8、withlowerandupperboundsforx.%AandAeqarematricesforthelinearconstrains.%BandBeqarecolumnvectorsforthelinearconstrains.