优化设计方法剖析Word文档格式.docx
- 文档编号:22672334
- 上传时间:2023-02-05
- 格式:DOCX
- 页数:20
- 大小:47.40KB
优化设计方法剖析Word文档格式.docx
《优化设计方法剖析Word文档格式.docx》由会员分享,可在线阅读,更多相关《优化设计方法剖析Word文档格式.docx(20页珍藏版)》请在冰豆网上搜索。
0.999996954049381.00001655313968
-0.99999999979866
c=
1
d=
iterations:
39
funcCount:
77
algorithm:
'
Nelder-Meadsimplexdirectsearch'
用Hession矩阵进行证明:
已知f(x)=3/2x
(1)*x
(1)+1/2x
(2)*x
(2)-x
(1)*x
(2)-2x
(1)
对该函数进行求导:
一阶导为:
f`(x1)=3x
(1)-x
(2)-2;
f`(x2)=x
(2)-x
(1);
二阶导为:
f``(x1)=3;
f``(x2)=1;
f``(x1x2)=f``(x2x1)=-1;
由Hession矩阵判定条件之,令一阶导数值为0,固有
f`(x1)=3x
(1)-x
(2)-2=0;
f`(x2)=x
(2)-x
(1)=0;
得:
x
(1)=1;
x
(2)=1
该函数的Hession矩阵为:
由该Hession矩阵知,一阶主子式为3>
0,二阶主子式为:
3*1–(-1)*(-1)=2>
0.所以该Hession矩阵为正定。
即可知X=[11]为该函数的极小值点。
即可知Matlab软件所算的值是正确的。
②functiony=OPT_fun0(x)
y=x
(1)*x
(1)+x
(1)*x
(2)+2*x
(2)*x
(2)+4*x
(1)+6*x
(2)+10;
x0=[0,0];
x,f_opt,c
-1.42857209403050-1.14288457948509
3.71428571580995
结论:
由结果可知该函数的最优点为:
X=[-1.43-1.14]
故此函数的极值为:
fopt=3.71
③functiony=a123(x)
y=x
(1)*x
(1)*x
(1)+x
(1)*x
(2)-3*x
(2)*x
(2)*x
(2)+3*x
(1)*x
(1)+3*x
(2)*x
(2)-9*x
(1);
x0=[0,0]
[x,f_opt,c,d]=fminsearch(@a123,x0);
x0=
00
1.01162643167122-0.139********890
.0737********
由上述结果知该函数的最优解点为:
X=[1.01-0.14]
故此函数的极值为:
f_opt=-5.07
④functiony=a123(x)
y=x
(1)*x
(1)*x
(1)*x
(1)+2*x
(1)*x
(1)*x
(2)+x
(2)*x
(2)+x
(1)*x
(1)-2*x
(2)+5;
0.000018156900600.99998886868293
4.00000000111292
X=[01]
f_opt=4.00
4-2
functiony=OPT_fun0(x)
y=4*x
(1)*x
(2)+4/x
(1)+4/x
(2);
x0=[0.5,0.5];
1.000018783361701.00000069475736
12.00000000146536
X=[11]
f_opt=12.00
4-3
functiony=OPT_fun1(x)
y=x
(1)*x
(1)-x
(1)*x
(2)+3*x
(2)*x
(2);
x0=[1,1]
[x,f_opt,c,d]=fminsearch(@OPT_fun1,x0);
x,f_opt,c
结果:
11
.024*********
2.776385560476180e-009
有输出的结果可知,最终在x(0)=[0.020.31]处约束,且最优解值为:
f(x)=2.78
4-4
y=4+4.5*x
(1)-4*x
(2)+x
(1)*x
(1)+2*x
(2)*x
(2)-2*x
(1)*x
(2)+x
(1)*x
(1)*x
(1)*x
(1)-2*x
(1)*x
(1)*x
(2);
x0=[-2,2]
-22
-1.052756318166731.02772085864556
-0.51340925137577
X=[1.051.03]
f_opt=-0.51
4-5
y=x
(1)*x
(1)+2*x
(2)*x
(2);
0.034546445759640.175********544
6.305748878049377e-010
X=[00.18]
f_opt=6.31
4-6
y=x
(1)*x
(1)-x
(1)*x
(2)+x
(2)*x
(2)+2*x
(1)-4*x
(2);
x0=[2,2]
22
0.000031318899142.00001969820371
-3.99999999924803
由上述结果知该函数的最优解为:
X=[02]
f_opt=-4.00
第五章例题
Aeq=[];
Beq=[];
f=[-60,-120];
A=[9,4;
3,10;
4,5];
B=[360;
300;
200];
LB=zeros(2,1);
UB=[];
[X,fopt,key]=linprog(f,A,B,Aeq,Beq,LB,UB);
X,fopt,key
>
A11
Optimizationterminatedsuccessfully.
X=
20.0000
24.0000
fopt=
-4.0800e+003
key=
第五章课后习题
5-1
①Aeq=[1,1,1,0;
1,2,2.5,3];
Beq=[4;
5];
f=[-1.1,-2.2,3.3,-4.4];
A=[];
B=[];
LB=zeros(4,1);
cc2
3.99999999991453
0.00000000008539
0.00000000000014
0.33333333330478
-5.86666666663444
由上述结果知该函数的最优点为:
4.0
0.0
0.3
故此函数的极小值为:
fopt=-5.87
②Aeq=[];
f=[-7,-12];
4,5;
3,10];
200;
300];
UB=[];
cc3
19.99999999999513
23.99999999999991
-4.279999999999648e+002
20.0
24.0
故此函数的最小值为:
fopt=-4.28e+002
5-2
f=[-7000,-12000];
19.99999999999673
23.99999999999963
-4.279999999999726e+005
fopt=-4.28e+005
5-4
f=[-0.30,-0.15];
A=[-1,-1;
1,1];
B=[-600;
1000];
UB=[800;
1200];
7.99999999999976
1.99999999999523
-2.699999999999213e+002
8.0
2.0
fopt=-2.70e+002
5-6
f=[1,-2];
A=[1,1;
-2,-1];
B=[5;
-3];
cc4
0.00000000016734
4.99999999277444
-9.99999998538153
5.0
fopt=-10.00
5-7
Aeq=[1,2,1];
Beq=[6];
f=[-5,-4,-8];
A=[5,3,0;
2,-1,0];
B=[15;
4];
LB=zeros(3,1);
0.00000000000002
0.00000000000000
5.99999999999997
-47.99999999999991
0.0
6.0
fopt=-48.00
第六章
6-2已知约束优化问题:
min
s.t.
试以
,
为复合型的初始点,用复合型法进行二次迭代计算。
主程序:
functionf=exefun(x)
f=4*x
(1)-x
(2)*x
(2)-12;
function[c,ceq]=execonfun(x)
c=[x
(1)*x
(1)+x
(2)*x
(2)-25;
-x
(1);
-x
(2)];
ceq=[];
x0=[2,1];
lb=[0,0];
ub=[];
options=optimset('
LargeScale'
'
off'
display'
iter'
tolx'
1e-6);
[x,fval,exitflag,output]=fmincon('
exefun'
x0,[],[],[],[],lb,ub,'
execonfun'
options)
输出结果:
maxDirectionalFirst-order
IterF-countf(x)constraintStep-sizederivativeoptimalityProcedure
17-2101-206
211-44.11117.1111-30.25.53Hessianmodifiedtwice
315-37.39370.393716.320.409Hessianmodifiedtwice
419-37.00150.00152610.3910.1
523-372.327e-00810.001530.1Hessianmodified
627-374.416e-02212.3e-0084Hessianmodifiedtwice
Optimizationterminatedsuccessfully:
Searchdirectionlessthan2*options.TolXand
maximumconstraintviolationislessthanoptions.TolCon
ActiveConstraints:
3
x=-05
fval=-37
exitflag=1
output=iterations:
6
27
stepsize:
medium-scale:
SQP,Quasi-Newton,line-search'
firstorderopt:
4.0000
cgiterations:
[]
6-3用外点法求解下列问题的最优解,并用MATLAB计算下列约束优化问题。
主程序为:
f=x
(1)+x
(2);
c=[3-x
(2);
x
(2)];
173.51.510.51infeasible
2113.51.51-8.59e-0091Hessianmodifiedtwice;
infeasible
Optimizationterminated:
Nofeasiblesolutionfound.
Searchdirectionlessthan2*options.TolXbutconstraintsarenotsatisfied.
x=21.5
fval=3.5000
exitflag=-1
2
11
1.0000
6-4用内点法求解下列问题的最优解,并用Matlab计算下列约束优化问题。
,
c=[x
(1)*x
(1)-x
(2);
-x
(1)];
17111-21
2115.02476e-0092.525e-0171-10.62Hessianmodifiedtwice
315001-5.02e-0092.22e-016Hessianmodified
First-orderoptimalitymeasurelessthanoptions.TolFunand
1;
2
x=00
fval=0
exitflag=1
3
15
2.2204e-016
cgiterations:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 优化 设计 方法 剖析