主要内容

焊接梁的设计优化

This example shows how to examine the tradeoff between the strength and cost of a beam. Several publications use this example as a test problem for various multiobjective algorithms, including Deb et al. [1] and Ray and Liew [2].

有关此示例的视频概述,请参见帕累托设置用于多目标优化

Problem Description

以下草图从Ray和Liew [2]中改编。

This sketch represents a beam welded onto a substrate. The beam supports a loadPat a distanceL从底物。将梁焊接到上下焊缝上,每个焊缝长度l和thicknessh。梁具有矩形横截面,宽度b,和高度t。The material of the beam is steel.

这两个目标是梁的制造成本和在施加的载荷下的横梁末端的挠度P。The loadPis fixed at 6,000 lbs, and the distanceLis fixed at 14 in.

设计变量是:

  • x(1)=h, the thickness of the welds

  • x(2) =l, the length of the welds

  • x(3) =t,光束的高度

  • x(4)=b, the width of the beam

梁的制造成本与梁中的材料量成正比, ( l + L ) t b ,加上焊缝中的材料量, l h 2 。使用引用论文的比例常数,第一个目标是

F 1 ( x ) = 1 1 0 4 7 1 x 1 2 x 2 + 0 0 4 8 1 1 x 3 x 4 ( 1 4 + x 2 )

梁的挠度与P并且与 b t 3 。Again, using the proportionality constants from the cited papers, the second objective is

F 2 ( x ) = P x 4 x 3 3 C , 在哪里 C = 4 ( 1 4 ) 3 3 0 × 1 0 6 3 6 5 8 7 × 1 0 - 4 P = 6 , 000

The problem has several constraints.

  • The weld thickness cannot exceed the beam width. In symbols, x(1) <= x(4). In toolbox syntax:

aineq = [1,0,0,-1];bineq = 0;
  • The shear stress τ ( x ) 在焊缝上不能超过13,600 psi。要计算剪切应力,首先计算初步表达式:

τ 1 = 1 2 x 1 x 2

R = x 2 2 + ( x 1 + x 3 ) 2

τ 2 = ( L + x 2 / 2 ) R 2 x 1 x 3 ( x 2 2 / 3 + ( x 1 + x 3 ) 2

τ ( x ) = P τ 1 2 + τ 2 2 + 2 τ 1 τ 2 x 2 R

In summary, the shear stress on the welds has the constraint τ ( x ) <= 13600。

  • 正常应力 σ ( x ) 在焊缝上不能超过30,000 psi。正常应力是 P 6 L x 4 x 3 2 3 0 × 1 0 3

  • 垂直方向上的屈曲负载能力必须超过6,000磅的施加载荷。使用杨氏模量的值 E = 3 0 × 1 0 6 psi和 G = 1 2 × 1 0 6 psi,屈曲负荷约束是 4 0 1 3 E x 3 x 4 3 6 L 2 ( 1 - x 3 2 L E 4 G ) 6 0 0 0 。从数值上讲,这成为不平等的 6 4 , 7 4 6 0 2 2 ( 1 - 0 0 2 8 2 3 4 6 x 3 ) x 3 x 4 3 6 0 0 0

  • 变量的界限为0.125 <= x(1)<= 5,0.1 <= x(2)<= 10,0.1 <= x(3)<= 10,和0.125 <= x(4)<= 5。在工具箱语法中:

lb = [0.125,0.1,0.1,0.125]; ub = [5,10,10,5];

目标函数出现在本示例的末尾objval(x)。非线性约束出现在函数的示例的末尾nonlcon(x)

多目标问题的制定和paretosearchSolution

You can optimize this problem in several ways:

  • 设置最大挠度,并在满足最大挠度约束的设计上找到一个单目标最小制造成本。

  • 设定最大制造成本,并在满足制造成本限制的设计上找到一个单目标最小的挠度。

  • 解决一个多主体问题,可视化两个目标之间的权衡。

要使用多目标方法,该方法提供了有关问题的更多信息,请设置目标函数和非线性约束函数。

fun = @objval;nlcon = @nonlcon;

使用paretosearch'Psplotparetof'plot function. To reduce the amount of diagnostic display information, set the展示选项'离开'

opts_ps = optimoptions('Paretosearch','展示','离开','plotfcn','Psplotparetof');rng默认%可再现性[x_ps1,fval_ps1,〜,psoutput1] = paretosearch(fun,4,aineq,bineq,[],[],[],lb,ub,ub,nlcon,opts_ps);

disp(“总功能计数:”+ psoutput1.funccount);
Total Function Count: 1870

对于帕累托的更平滑,请尝试使用更多点。

npts = 160;%默认值为60opts_ps.ParetoSetSize = npts; [x_ps2,fval_ps2,~,psoutput2] = paretosearch(fun,4,Aineq,bineq,[],[],lb,ub,nlcon,opts_ps);

disp(“总功能计数:”+ psoutput2.funccount);
总功能数量:6254

This solution looks like a smoother curve, but it has a smaller extent of Objective 2. The solver takes over three times as many function evaluations when using 160 Pareto points instead of 60.

gamultiobjSolution

要查看求解器是否有所不同,请尝试gamultiobjsolver on the problem. Set equivalent options as in the previous solution. Because thegamultiobj求解器在最佳帕累托阵线上只有不到一半的解决方案,使用了两倍的点。万博 尤文图斯

opts_ga = optimoptions('gamultiobj','展示','离开','plotfcn','gaplotpareto','PopulationSize',2*npts); [x_ga1,fval_ga1,~,gaoutput1] = gamultiobj(fun,4,Aineq,bineq,[],[],lb,ub,nlcon,opts_ga);

disp(“总功能计数:”+ gaoutput1.funccount);
总功能数量:38401

gamultiobj进行数以万计的功能评估,而paretosearch只有数千人。

比较解决方案万博 尤文图斯

Thegamultiobjsolution seems to differ from theparetosearchsolution, although it is difficult to tell because the plotted scales differ. Plot the two solutions on the same plot, using the same scale.

fps2 = sortrows(fval_ps2,1,“上升”);figure hold绘图(fps2(:1),fps2(:,2),,'r-') fga = sortrows(fval_ga1,1,“上升”);plot(fga(:,1),fga(:,2),'B--') xlim([0,40]) ylim([0,1e-2]) legend('Paretosearch','gamultiobj')XLABEL'Cost'ylabel'偏转'hold离开

Thegamultiobj解决方案在情节的最右边部分更好,而paretosearch解决方案在最左侧的部分更好。paretosearch使用较少的功能评估来获得其解决方案。

通常,当问题没有非线性约束时,paretosearchis at least as accurate asgamultiobj。然而,the resulting Pareto sets can have somewhat different ranges. In this case, the presence of a nonlinear constraint causes theparetosearchsolution to be less accurate over part of the range.

主要优势之一paretosearch是通常需要更少的功能评估。

从单目标解决方案开始万博 尤文图斯

To help the solvers find better solutions, start them from points that are the solutions to minimizing the individual objective functions. ThePickIndex功能从objval功能。采用Fminconto find single-objective optima. Then use those solutions as initial points for a multiobjective search.

x0 =零(2,4);x0f =(lb + ub)/2;opts_fmc = optimoptions('fmincon','展示','离开','MaxFunctionEvaluations',1e4); x0(1,:) = fmincon(@(x)pickindex(x,1),x0f,Aineq,bineq,[],[],lb,ub,@nonlcon,opts_fmc); x0(2,:) = fmincon(@(x)pickindex(x,2),x0f,Aineq,bineq,[],[],lb,ub,@nonlcon,opts_fmc);

Examine the single-objective optima.

objval(x0(1,:))
ans =1×22.3810 0.0158
objval(x0(2,:))
ans =1×276.7188 0.0004

最低成本为2.381,挠度为0.158。最小挠度为0.0004,成本为76.7253。绘制的曲线在其范围的末端附近非常陡峭,这意味着,如果您的成本高出最低,或者如果您将偏转略高于其最小值,则偏转率要少得多。

Startparetosearch从单目标解决方案。万博 尤文图斯因为您将稍后在同一图上绘制解决方案,请删除万博 尤文图斯paretosearchplot function.

opts_ps.initialpoints = x0;opts_ps.plotfcn = [];[x_psx0,fval_ps1x0​​,〜,psoutput1x0] = paretosearch(Fun,4,Aineq,bineq,[],[],[],lb,ub,ub,nlcon,opts_ps);disp(“总功能计数:”+ psoutput1x0.funccount);
总功能数量:4839

Startga从相同的初始点,然后删除其绘图函数。

opts_ga.initialpopulationmatrix = x0;opts_ga.plotfcn = [];[〜,fval_ga,〜,gaoutput] = gamultiobj(fun,4,aineq,bineq,[],[],[],lb,ub,ub,nlcon,opts_ga);disp(“总功能计数:”+ gaoutput.funccount);
总功能数量:37441

将解决方案绘制在同万博 尤文图斯一轴上。

fps = sortrows(fval_ps1x0​​,1,“上升”);figure hold绘图(fps(:1),fps(:,2),'r-')fga = sortrows(fval_ga,1,“上升”);plot(fga(:,1),fga(:,2),'B--') xlim([0,40]) ylim([0,1e-2]) legend('Paretosearch','gamultiobj')XLABEL'Cost'ylabel'偏转'hold离开

通过从单目标解决方案开始万博 尤文图斯gamultiobj解决方案比paretosearch在整个绘制范围内解决方案。然而,gamultiobjtakes almost ten times as many function evaluations to reach its solution.

混合功能

gamultiobjcan call the hybrid functionFgoalattainautomatically to attempt to reach a more accurate solution. See whether the hybrid function improves the solution.

opts_ga.HybridFcn =“ fgoalattain”;[xgah,fval_gah,〜,gaoutputh] = gamultiobj(fun,4,aineq,bineq,[],[],[],lb,ub,ub,nlcon,opts_ga);disp(“总功能计数:”+ gaoutputh.funccount);
Total Function Count: 57478
fgah = sortrows(fval_gah,1,“上升”);figure hold绘图(fps(:1),fps(:,2),'r-')图(FGA(:1),FGA(:,2),,'B--')情节(fgah(:,1),fgah(:,2),,'G-') xlim([0,40]) ylim([0,1e-2]) legend('Paretosearch','gamultiobj','gamultiobj/fgoalattain')XLABEL'Cost'ylabel'偏转'hold离开

The hybrid function provides a slight improvement on thegamultiobj解决方案,主要在图的最左侧部分。

Fgoalattain手动来自paretosearch解决方案点

Althoughparetosearchhas no built-in hybrid function, you can improve theparetosearch通过运行解决方案Fgoalattain来自paretosearch解决方案点。创建目标和权重Fgoalattain通过使用相同的设置Fgoalattain如所述GamultiOBJ混合功能

fmax = max(fval_ps1x0​​);nobj = numel(fmax);fmin = min(fval_ps1x0​​);w = sum((fmax -fval_ps1x0​​)./(1 + fmax -fmin),2);p = w。*((fmax -fval_ps1x0​​)./(1 + fmax -fmin));Xnew = ZEROS(size(x_psx0));nsol = size(Xnew,1);fvalNew = Zeros(NSOL,NOBJ);opts_fg = optimoptions(“ fgoalattain”,'展示','离开');nfv = 0;forII = 1:NSOL [XNew(II,:),fvalNew(ii,:),〜,〜,输出] = fgoalattain(fun,x_psx0(ii,:),fval_ps1x0​​(ii,:),p(ii,ii,:),...aineq,bineq,[],[],lb,ub,nlcon,opts_fg);nfv = nfv + output.funccount;enddisp(“ fgoalattain函数计数:”+ NFV)
Fgoalattain功能数量:14049
fnew = sortrows(fvalnew,1,“上升”);figure hold绘图(fps(:1),fps(:,2),'r-')图(FGA(:1),FGA(:,2),,'B--')情节(fgah(:,1),fgah(:,2),,'G-')图(fnew(:,1),fnew(:,2),,'k.-') xlim([0,40]) ylim([0,1e-2]) legend('Paretosearch','gamultiobj','gamultiobj/fgoalattain','Paretosearch/fgoalattain')XLABEL'Cost'ylabel'偏转'

组合paretosearchFgoalattaincreates the most accurate Pareto front. Zoom in to see.

XLIM([3.64 13.69])Ylim([0.00121 0.00442])离开

即使有额外的Fgoalattaincomputations, the total function count for the combination is less than half of the function count for thegamultiobj仅解决方案。

fprintf(“仅gamultiobj的总功能计数为%d。\ n”+..."For paretosearch and fgoalattain together it is %d.\n",...gaoutput.funccount,nfv + psoutput1x0.funccount)
仅GamultiObj的总功能数量为37441。paretosearch和Fgoalattain在一起是18888年。

从图中查找好参数

绘制点显示功能空间中最佳值。要确定哪些参数达到这些函数值,请找到光束的大小和焊缝的大小,以获取特定的成本/偏转点。例如,情节paretosearchfollowed byFgoalattainshows points with a cost of about 6 and a deflection of about 3.5e–3. Determine the sizes of the beam and weld that achieve these points.

whichgood = find(fvalnew(:,1) <= 6 & fvalnew(:,2) <= 3.5e-3); goodpoints = table(xnew(whichgood,:),fvalnew(whichgood,:),'variablenames',{'参数'“目标”})
goodpoints =4×2桌Parameters Objectives ________________________________________ ___________________ 0.63457 1.5187 10 0.67262 5.6974 0.0032637 0.61635 1.5708 10 0.63165 5.391 0.0034753 0.63228 1.5251 10 0.6674 5.6584 0.0032892 0.65077 1.4751 10 0.70999 5.976 0.0030919

四组参数的成本小于6,偏转小于3.5e – 3:

  • 焊接厚度略高于0.6

  • Weld length about 1.5

  • 梁高10(上限)

  • 光束宽度在0.63和0.71之间

客观和非线性约束

功能[cineq,ceq] = nonlcon(x)sigma = 5.04e5 ./(x(:,3)。^2。* x(:,4));p_c = 64746.022*(1-0.028236*x(:,3))。*x(:,3)。*x(:,4)。^3;tp = 6e3./sqrt(2)./(x(x:,1).* x(:,2));tpp = 6e3./sqrt(2)。*(14 + 0.5*x(:,2))。:,3))。^2))。/(x(:,1)。*x(:,2)。) + x(:,3))。^2));tau = sqrt(tp。^2 + tpp。^2 +(x(:,2)。*tp。*tpp。1) + x(:,3))。^2)));cineq = [tau -13600,sigma -3e4,6e3 -p_c];ceq = [];end功能f = objval(x)f1 = 1.10471*x(:,1)。^2.*x(:,2) + 0.04811*x(:,3)。(:,2));f2 = 2.1952./(x(:,3).^ 3。* x(:,4));f = [f1,f2];end功能z = pickIndex(x,k)z = objval(x);%评估两个目标z = z(k);返回目标kend

参考

[1] Deb,Kalyanmoy,J。Sundar,Udaya Bhaskara Rao N和Shamik Chaudhuri。使用进化算法的基于参考点的多目标优化。国际计算情报研究杂志,第1卷。2,第3期,2006年,第273–286页。可用https://www.softcomputing.net/ijcir/vol2-issu3-paper4.pdf

[2] Ray,T。和K. M. Liew。A Swarm Metaphor for Multiobjective Design Optimization。工程优化34,2002,pp.141–153。

相关话题