机设作业

更新时间:2023-09-11 18:57:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

支架最轻问题:如图所示为一对称支架,在支架的顶点承受一个载荷为2F=300000N,支架之间的水平距离2B=1520mm,若已选定壁厚T=2.5mm钢管,密度ρ=8300kg/mm3、屈服点σs=700 MPa,要求在满足强度和稳定性条件下,设计最轻的支架尺寸。

1.建立数学模型

设变量:钢管直径D(单位m) 目标函数: m?2?DT?B2?H2 约束条件:

1)圆管杆件中的压应力σ应小于或等于y

FB2?H2????y

?TDHFB2?H2于是得 g1(x)?-?y?0

?TDH2)圆管杆件中的压应力α应小于或等于压杆稳定的临界应力σc,由欧拉公式得钢管的压杆稳度应力

?c??2EIL2A??2E(D2?T2)8(B2?H2) A 圆管横截面积、L圆管长度、E弹性模量=2.1x1011N/m2

于是得 g2(x)????c?0

3)设计变量的值不得小于或等于0 ,于是得

g3(D)?-D?0

g4(H)??H?0

2.利用Matlab进行函数优化

1 编写优化目标objfun1.m函数文件

function f=objfun1(x)

f=1.225e-4*x(1)*sqrt(577600.0+x(2)*x(2));

2 编写约束条件confun1.m函数文件

FB2?H2g1(x)?-?y?0

?TDHg2(x)????c?0 g3(x1)?-x1?0 g4(x2)?-x2?0

function [c,ceq]=confun1(x)

c=[19098.59*sqrt(577600.0+x(2)*x(2))/(x(1)*x(2))-700.0;

19098.59*sqrt(577600.0+x(2)*x(2))/(x(1)*x(2))-2.6e5*(x(1)*x(1)+6.25)/(577600.0+x(2)*x(2))]; ceq=[];

3调用函数fmincon求极值,optimset函数用于创建options参数的结构 clear all clc; x0=[1,1]; lb=zeros(2,1); ub=Inf*ones(2,1);

options=optimset('LargeScale','off','display','iter','tolx',1e-6); [x,fval,exitflag,output]=fmincon('exefun',x0,[],[],[],[],lb,ub,'execonfun',options)

求得结果

First-order Norm of Iter F-count f(x) Feasibility optimality step 0 3 1.190000e+02 9.969e-01 3.694e+01

1 6 9.525042e+01 9.887e-01 3.160e+01 1.163e+00 2 10 9.528184e+01 9.887e-01 1.781e+01 9.595e-04 3 14 9.542761e+01 9.885e-01 1.844e+01 1.312e-02 4 17 1.079540e+02 9.724e-01 5.856e+01 1.006e+00 5 20 7.355434e+02 0.000e+00 2.597e+04 4.715e+01 6 23 7.350522e+02 0.000e+00 2.924e+01 2.040e-02 7 26 6.639639e+02 0.000e+00 2.353e+01 5.160e+00 8 29 5.011828e+02 0.000e+00 6.080e+01 1.184e+01 9 32 3.791681e+02 0.000e+00 8.720e+01 8.877e+00 10 35 2.880938e+02 0.000e+00 9.727e+01 6.626e+00

11 38 2.406135e+02 0.000e+00 9.341e+01 3.454e+00 12 41 2.280929e+02 0.000e+00 8.572e+01 9.108e-01 13 44 2.272066e+02 0.000e+00 8.192e+01 6.447e-02 14 47 2.272995e+02 0.000e+00 8.156e+01 6.757e-03 15 50 2.272987e+02 0.000e+00 8.156e+01 5.600e-05 16 53 2.272987e+02 0.000e+00 8.156e+01 1.680e-07 Local minimum possible. Constraints satisfied.

fmincon stopped because the size of the current step is less than the selected value of the step size tolerance and constraints are satisfied to within the default value of the constraint tolerance.

x =

1.8134 13.3148 fval = 227.2987 exitflag = 2 output =

iterations: 16 funcCount: 53 constrviolation: 0

stepsize: 1.6804e-07 algorithm: 'interior-point' firstorderopt: 81.5567 cgiterations: 0

message: 'Local minimum possible. Constraints satisfied. fmincon stopped because the size of the cu...' 根据结果可知:在满足强度和稳定性的条件下,最轻的尺寸是

X1=D=1.8134

X2=H=13.3148

本文来源:https://www.bwwdw.com/article/ji1h.html

Top