进行优化分析时出错,不知道问题出在哪
提示:modification of an optimization variable has forced a partial clear of your optimization on data.Design sets and global optimization settings are unchanged,but all other data has been initialized.
这是命令流
finish
/clear
/filname,ZWXHDQ
/title,BL
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!设计变量初值
E_x1=3.45E10
D_z1=3945
E_x2=3.45E10
D_z2=2500
E_x3=3.45E10
D_z3=4101
/prep7
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!实测数据添加
*dim,sc_pinlv,,4,1,1 !b由系统赋值
sc_pinlv(1)=2.1048
sc_pinlv(2)=3.2434
sc_pinlv(3)=5.1302
sc_pinlv(4)=6.5548
f1=2.45e10 !!!!!!!!!!!!!!!!!弹模下限
f2=4.45e10 !!!!!!!!!!!!!!!!!弹模上限
h11=3700 !!!!!!!!!!!!!!!!!密度上限1
h12=4100 !!!!!!!!!!!!!!!!!密度下限1
h21=2400 !!!!!!!!!!!!!!!!!密度上限2
h22=2600 !!!!!!!!!!!!!!!!!密度下限2
h31=3900 !!!!!!!!!!!!!!!!!密度上限3
h32=4300 !!!!!!!!!!!!!!!!!密度下限3
q=5 !!!!!!!!!!!!!!!!!最大迭代次数
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!生成截面文件
*dim,data_b,,12,1,1
data_b(1)=2.750,2.510,2.282,2.066,1.864,1.616
data_b(7)=1.395,1.207,1.041,0.950,0.950,0.950
*dim,data_h,,12,1,1
data_h(1)=0.943,0.560,0.522,0.486,0.452,0.411
data_h(7)=0.374,0.343,0.315,0.300,0.300,0.300
*dim,data_j,,12,1,1
data_j(1)=0.050,0.300,0.300,0.300,0.300,0.300
data_j(7)=0.300,0.300,0.300,0.300,0.300,0.300
*dim,data_l,,12,1,1
data_l(1)=1.472,1.578,1.388,1.208,1.040,0.833
data_l(7)=0.649,0.492,0.354,0.278,0.278,0.278
!
*do,ii,1,12,1
a=4.175
b=data_b(ii)
c=1
d=0.5
e=3.2
f=0.37
g=0.18
h=data_h(ii)
ai=3.075
j=data_j(ii)
k=0.5
l=data_l(ii)
m=0.842
n=2
ah=-b-d-f-g+h+j+l+m
k,1,-a,-b-d-f-g
k,2,-ai-k,-b-d-f-g
k,3,-ai,-b-d-f-g
k,4,ai,-b-d-f-g
k,5,ai+k,-b-d-f-g
k,6,a,-b-d-f-g
k,7,a,-g-f-d
k,8,a+c,-g-f
k,9,a+c+e,-g
k,10,a+c+e
k,11,a+c
k,12,a
k,13,ai+k
k,14,ai+k-n
k,15,-ai-k+n
k,16,-ai-k
k,17,-a
k,18,-a-c
k,19,-a-c-e
k,20,-a-c-e,-g
k,21,-a-c,-g-f
k,22,-a,-g-f-d
k,23,ai,-b-d-f-g+h
k,24,ai+k,-b-d-f-g+h+j
ah=-b-d-f-g+h+j+l+m
k,25,ai+k,ah-m
k,26,ai+k-n,ah
k,27,-ai-k+n,ah
k,28,-ai-k,ah-m
k,29,-ai-k,-b-d-f-g+h+j
k,30,-ai,-b-d-f-g+h
k,31,a,-b-d-f-g+h+j
k,32,-a,-b-d-f-g+h+j
*do,i,1,5,1
l,i,i+1
*enddo
l,6,31
l,31,7
*do,i,7,21,1
l,i,i+1
*enddo
l,22,32
l,32,1
/pnum,kp,1
/pnum,line,1
al,all
*do,i,23,29,1
l,i,i+1
*enddo
l,30,23
al,25,26,27,28,29,30,31,32
asba,1,2
adele,3
l,2,29
l,3,30
l,4,23
l,5,24
l,32,29
l,24,31
al,37,24,1,33
al,33,31,2,34
al,34,3,35,32
al,35,4,36,25
al,36,5,6,38
l,22,28
l,7,25
al,39,23,37,30
al,26,38,7,40
l,18,21
l,17,22
l,16,28
l,15,27
l,14,26
l,13,25
l,12,7
l,8,11
al,20,21,41,19
al,41,22,42,18
al,42,39,43,17
al,43,29,44,16
al,44,28,45,15
al,45,27,46,14
al,46,40,47,13
al,47,8,48,12
al,48,9,10,11
nummrg,all
numcmp,all
et,1,82
lesize,24,,,1
lesize,1,,,1
lesize,33,,,1
lesize,37,,,1
mshape,0,2d
mshkey,2
amesh,1
lesize,33,,,1
lesize,2,,,1
lesize,34,,,1
lesize,31,,,1
mshape,0,2d
mshkey,2
amesh,2
lesize,34,,,1
lesize,3,,,10
lesize,35,,,1
lesize,32,,,10
mshape,0,2d
mshkey,2
amesh,3
lesize,35,,,1
lesize,4,,,1
lesize,36,,,1
lesize,25,,,1
mshape,0,2d
mshkey,2
amesh,4
lesize,36,,,1
lesize,5,,,1
lesize,6,,,1
lesize,38,,,1
mshape,0,2d
mshkey,2
amesh,5
lesize,23,,,3
lesize,37,,,1
lesize,30,,,3
lesize,39,,,1
mshape,0,2d
mshkey,2
amesh,6
lesize,26,,,3
lesize,38,,,1
lesize,7,,,3
lesize,40,,,1
mshape,0,2d
mshkey,2
amesh,7
lesize,41,,,1
lesize,19,,,5
lesize,20,,,1
lesize,21,,,5
mshape,0,2d
mshkey,2
amesh,8
lesize,41,,,1
lesize,22,,,2
lesize,42,,,1
lesize,18,,,2
mshape,0,2d
mshkey,2
amesh,9
lesize,42,,,1
lesize,39,,,1
lesize,43,,,1
lesize,18,,,1
mshape,0,2d
mshkey,2
amesh,10
lesize,43,,,1
lesize,29,,,3
lesize,44,,,1
lesize,16,,,3
mshape,0,2d
mshkey,2
amesh,11
lesize,44,,,1
lesize,28,,,3
lesize,45,,,1
lesize,15,,,3
mshape,0,2d
mshkey,2
amesh,12
lesize,45,,,1
lesize,27,,,3
lesize,46,,,1
lesize,14,,,3
mshape,0,2d
mshkey,2
amesh,13
lesize,46,,,1
lesize,40,,,1
lesize,47,,,1
lesize,13,,,1
mshape,0,2d
mshkey,2
amesh,14
lesize,47,,,1
lesize,8,,,2
lesize,48,,,1
lesize,12,,,2
mshape,0,2d
mshkey,2
amesh,15
lesize,48,,,1
lesize,9,,,5
lesize,10,,,1
lesize,11,,,5
mshape,0,2d
mshkey,2
amesh,16
secwrite,sec-%100+ii%
ASEL,ALL
ACLEAR,ALL
ADELE,ALL,,,1
*enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!建模主命令流
*do,i,1,3,1
et,i,beam188
mp,ex,i,E_x%i%
mp,prxy,i,0.2
mp,dens,i,D_z%i%
*enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!将截面赋给点
*do,i,0,10,1
sectype,100+i,beam,mesh
secread,sec-%(111-i)%,,,mesh
secoffset,origin
*enddo
sectype,111,beam,mesh
secread,sec-101,,,mesh
secoffset,origin
*do,i,1,12,1
sectype,111+i,beam,mesh
secread,sec-%(100+i)%,,,mesh
secoffset,origin
*enddo
sectype,124,beam,mesh
secread,sec-112,,,mesh
secoffset,origin
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!定义关键点
*dim,kdata1,,25,1,1
kdata1(1)=0,-1.000,-5.500,-10.000,-14.000,-18.000,-22.000,-25.000,-28.000,-31.000
kdata1(11)=-34.000,-35.000,-36.000,-39.000,-42.000,-45.000,-48.000,-52.000,-56.000,-60.000
kdata1(21)=-64.500,-69.000,-70.000,-71.000,-75.000
*do,i,0,24,1
k,100+i,kdata1(i+1)
*enddo
k,1000,0,1 !定义方向关键点
*do,i,1,24,1 !定义锥形截面
sectype,1000+i,taper
secdata,100+i-1,kx(100+i-1)
secdata,100+i,kx(100+i)
*enddo
*do,i,1,10,1
l,100+i-1,100+i
latt,2,,2,,1000,,1000+i
lsel,s,,,i
lesize,i,,,2
lmesh,i
allsel,all
*enddo
*do,i,11,12,1
l,100+i-1,100+i
latt,1,,1,,1000,,1000+i
lsel,s,,,i
lesize,i,,,2
lmesh,i
allsel,all
*enddo
*do,i,13,23,1
l,100+i-1,100+i
latt,2,,2,,1000,,1000+i
lsel,s,,,i
lesize,i,,,2
lmesh,i
allsel,all
*enddo
l,123,124
latt,3,,3,,1000,,1024
lsel,s,,,24
lesize,24,,,2
lmesh,24
allsel,all
allsel
/eshape,1
eplot
!
*do,i,1,10,1
sectype,200+i,beam,mesh
secread,sec-%(111-i)%,,,mesh
secoffset,origin
*enddo
sectype,211,beam,mesh
secread,sec-101,,,mesh
secoffset,origin
*do,i,1,12,1
sectype,211+i,beam,mesh
secread,sec-%(100+i)%,,,mesh
secoffset,origin
*enddo
sectype,224,beam,mesh
secread,sec-112,,,mesh
secoffset,origin
*dim,kdata2,,24,1,1
kdata2(1)=1.000,5.500,10.000,14.000,18.000,22.000,25.000,28.000,31.000,34.000
kdata2(11)=35.000,36.000,39.000,42.000,45.000,48.000,52.000,56.000,60.000,64.500
kdata2(21)=69.000,70.000,71.000,75.000
*do,i,1,24,1
k,200+i,kdata2(i)
*enddo
sectype,2001,taper
secdata,100,0
secdata,201,1000
*do,i,2,24,1 !定义锥形截面
sectype,2000+i,taper
secdata,200+i-1,kx(200+i-1)
secdata,200+i,kx(200+i)
*enddo
l,100,201
latt,2,,2,,1000,,2001
lsel,s,,,25
lesize,25,,,2
lmesh,25
allsel,all
*do,i,2,10,1
l,200+i-1,200+i
latt,2,,2,,1000,,2000+i
lsel,s,,,24+i
lesize,24+i,,,2
lmesh,24+i
allsel,all
*enddo
*do,i,11,12,1
l,200+i-1,200+i
latt,1,,1,,1000,,2000+i
lsel,s,,,24+i
lesize,24+i,,,2
lmesh,24+i
allsel,all
*enddo
*do,i,13,23,1
l,200+i-1,200+i
latt,2,,2,,1000,,2000+i
lsel,s,,,24+i
lesize,24+i,,,2
lmesh,24+i
allsel,all
*enddo
l,223,224
latt,3,,3,,1000,,2024
lesize,48,,,2
lmesh,48
allsel,all
allsel
/eshape,1
eplot
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!支座约束
dk,111,uy,,,,,uz
dk,124,ux,,,,,uy,uz,rotx
dk,211,uy,,,,,uz
dk,224,uy,,,,,uz
finish
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!进入求解器
/solu
acel,0,-9.8,0
antype,modal
msave,0
modopt,lanb,40,1,20,,on
eqslv,spar
mxpand,40,1,20,1,0.001
solve
finish
/solu
expass,1
mxpand,40,1,20,1,0.001
outres,all,all,
solve
finish
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!后处理
/post1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!提取振型参与系数并放入数组
*dim,pf,,40
*do,i,1,40,1
*GET,PF(i),mode,i,pfact
*enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!判断振型参与系数选取受弯振型频率与扭转振型频率
*dim,swpl,,40 !受弯频率
*dim,sjpl,,40 !扭转频率
*do,i,1,40,1
*if,pf(i),ABGT,100,then !如果pf(1)绝对值大于100
*get,swpl(i),mode,i,freq
*else
*get,sjpl(i),mode,i,freq
*endif
*enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!提取前5阶受弯频率数组
*dim,pin_lv,,4,1,1
m=1
*do,n,1,40,1
*if,swpl(n),ne,0,then
pin_lv(m)=swpl(n)
m=m+1
*elseif,m,gt,4,then
*exit
*endif
*enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!状态变量和目标函数
*do,i,1,4,1
*dim,obj_func%i%,,1,1
zwxhdq_OPT%i%=pin_lv(i)/sc_pinlv(i)
obj_func%i%(1)=(pin_lv(i)-sc_pinlv(i))*(pin_lv(i)-sc_pinlv(i))/sc_pinlv(i)
*enddo
obj_func=0
*do,i,1,4,1
obj_func=obj_func+obj_func%i%(1) !目标函数
*enddo
finish
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!一阶优化工具
LGWRITE,'zwxh Analysis','lgw'
finish
/opt
OPANL,'zwxh Analysis','lgw',' '
opvar,E_X1,dv,f1,f2 !设计变量
opvar,E_X2,dv,f1,f2
opvar,E_X3,dv,f1,f2
opvar,D_Z1,dv,h11,h12
opvar,D_Z2,dv,h21,h22
opvar,D_Z3,dv,h31,h32
!
*do,i,1,4,1
opvar,zwxhdq_OPT%i%,sv,0.95,1.05 !状态变量
*enddo
!
opvar,obj_func,obj !目标函数
!
opdata,,,
oploop,prep,proc,,all
opprnt,full
opkeep,on
!
optype,first
opfrst,q !优化计算
opexe
*get,n,opt,0,best
/output,OPT_LIST1,lis
oplist,n
/output