隨機(jī)方向法減速器優(yōu)化設(shè)計【單級圓柱齒輪減速器】【P=10KW n=960r-min i=5】【說明書+CAD+SOLIDWORKS】
隨機(jī)方向法減速器優(yōu)化設(shè)計【單級圓柱齒輪減速器】【P=10KW n=960r-min i=5】【說明書+CAD+SOLIDWORKS】,單級圓柱齒輪減速器,P=10KW n=960r-min i=5,說明書+CAD+SOLIDWORKS,隨機(jī)方向法減速器優(yōu)化設(shè)計【單級圓柱齒輪減速器】【P=10KW,n=960r-min,i=5】【說明書+CAD+SOLIDWORKS】,隨機(jī)
南昌航空大學(xué)學(xué)士學(xué)位論文
附錄 隨機(jī)方向優(yōu)化方法設(shè)計源程序
優(yōu)化源程序(frotran語言)如下:
C ==============
PROGRAM RANDIR
C ==============
DIMENSION X(25),GX(50)
COMMON /ONE/ NSR,KWR,ILI,NPE,NFX,NGR
READ(*,*) N,KG,NSR
WRITE(*,1001)
WRITE(*,1002) N,KG,NSR
1001 FORMAT(25X,'======== PRIMARY DATA ========'/)
1002 FORMAT(5X,'N=',I4,2X,'KG=',I4,2X,'NSR=',I4)
CALL MAISUB(N,KG,X,GX)
STOP
END
C ============================
SUBROUTINE MAISUB(N,KG,X,GX)
C ============================
DIMENSION X(N),GX(KG),SF(25),BL(25),BU(25)
COMMON /ONE/ NSR,KWR,ILI,NPE,NFX,NGR
READ(*,*) (X(I),I=1,N)
READ(*,*) EPS1,EPS2,T0
READ(*,*) KWR
READ(*,*) (BL(I),I=1,N),(BU(I),I=1,N)
CALL FFX(N,X,FX)
WRITE(*,132) (X(I),I=1,N)
WRITE(*,133) FX
WRITE(*,104) EPS1,EPS2,T0
RM=2657863.0
CALL XRAN(N,KG,X,GX,RM,BL,BU)
WRITE(*,132) (X(I),I=1,N)
CALL FFX(N,X,FX)
WRITE(*,133) FX
WRITE(*,134) (GX(K),K=1,KG)
104 FORMAT(5X,'EPS1=',E9.1,2X,'EPS2=',E9.1,2X,'T0=',F10.6)
WRITE(*,105)
105 FORMAT(/22X,'======== ITERATION COMPUTE ========'/)
ITE=1
CALL FFX(N,X,F0)
107 TH=T0
CALL SFEAS(N,KG,X,GX,SF,F0,TH,RM)
CALL FFX(N,X,FX)
FL=FX
113 TH=1.3*TH
DO 114 I=1,N
114 X(I)=X(I)+TH*SF(I)
CALL FFX(N,X,FX)
CALL GGX(N,KG,X,GX)
DO 115 K=1,KG
IF(GX(K).GE.1E-15) GOTO 116
115 CONTINUE
IF(FX.GT.FL) GOTO 116
FL=FX
GOTO 113
116 DO 117 I=1,N
117 X(I)=X(I)-TH*SF(I)
TH=0.7*TH
DO 118 I=1,N
118 X(I)=X(I)+TH*SF(I)
CALL FFX(N,X,FX)
CALL GGX(N,KG,X,GX)
DO 119 K=1,KG
IF(GX(K).GE.1E-15) GOTO 116
119 CONTINUE
IF(FX.GT.FL) GOTO 116
IF(ABS(F0-FX).LT.ABS(F0)*EPS1+EPS2) GOTO 129
IF(TH.LT.EPS1) GOTO 129
IF(KWR.GT.0) GOTO 125
IF((ITE/10)*10.NE.ITE) GOTO 128
125 WRITE(*,126) ITE,FX
IF(KWR.LE.0) GOTO 128
WRITE(*,127) (X(I),I=1,N)
126 FORMAT(/' ***** ITE= ',I6,5X,'FX=',E15.6)
127 FORMAT(5X,'X :'/(5X,5E15.6))
128 ITE=ITE+1
F0=FX
GOTO 107
129 WRITE(*,130)
130 FORMAT(/22X,'======== OPTIMUM SOLUTION ========'/)
WRITE(*,131) ITE,NFX
WRITE(*,132) (X(I),I=1,N)
WRITE(*,133) FX
WRITE(*,134) (GX(K),K=1,KG)
131 FORMAT(5X,'ITE=',I6,2X,'NFX=',I6)
132 FORMAT(5X,'X :'/(5X,5E15.6))
133 FORMAT(5X,'FX=',E15.6)
134 FORMAT(5X,'GX:'/(5X,5E15.6))
RETURN
END
C =======================
SUBROUTINE RANDOM(Q,RM)
C =======================
RM35=2.0**35
RM36=2.0*RM35
RM37=2.0*RM36
RM =5.0*RM
IF(RM.GE.RM37) RM=RM-RM37
IF(RM.GE.RM36) RM=RM-RM36
IF(RM.GE.RM35) RM=RM-RM35
Q=RM/RM35
RETURN
END
C ===================================
SUBROUTINE XRAN(N,KG,X,GX,RM,BL,BU)
C ===================================
DIMENSION X(N),GX(KG),BL(N),BU(N)
COMMON /ONE/ NSR,KWR,ILI,NPE,NFX,NGR
201 CALL GGX(N,KG,X,GX)
DO 203 K=1,KG
IF(GX(K).LE.0.0) GOTO 203
DO 202 I=1,N
CALL RANDOM(Q,RM)
202 X(I)=BL(I)+Q*(BU(I)-BL(I))
GOTO 201
203 CONTINUE
RETURN
END
C ========================
SUBROUTINE SRAN(N,SR,RM)
C ========================
DIMENSION SR(N)
RQU=0.0
DO 301 I=1,N
CALL RANDOM(Q,RM)
SR(I)=2.0*Q-1.0
301 RQU=RQU+SR(I)*SR(I)
DO 302 I=1,N
302 SR(I)=SR(I)/SQRT(RQU)
RETURN
END
C =======================================
SUBROUTINE SFEAS(N,KG,X,GX,SF,F0,TH,RM)
C =======================================
DIMENSION X(N),SF(N),GX(KG),X0(25),XL(25),SR(25)
COMMON /ONE/ NSR,KWR,ILI,NPE,NFX,NGR
DO 400 I=1,N
400 X0(I)=X(I)
FL=F0
401 DO 405 K=1,NSR
CALL SRAN(N,SR,RM)
DO 402 I=1,N
402 X(I)=X0(I)+TH*SR(I)
CALL FFX(N,X,FX)
CALL GGX(N,KG,X,GX)
DO 403 KK=1,KG
IF(GX(KK).GE.1E-15) GOTO 405
403 CONTINUE
IF(FX.GE.FL) GOTO 405
FL=FX
DO 404 I=1,N
SF(I)=SR(I)
404 XL(I)=X(I)
405 CONTINUE
DO 406 I=1,N
406 X(I)=XL(I)
IF(ABS(FL-F0).GE.1E-15) GOTO 410
TH=0.7*TH
IF(TH.GT.1E-7) GOTO 401
WRITE(*,407) (X(I),I=1,N)
WRITE(*,408) FL
WRITE(*,409) (GX(K),K=1,KG)
407 FORMAT(5X,'X :'/(5X,5E15.7))
408 FORMAT(5X,'FX:'/5X,E15.7)
409 FORMAT(5X,'GX:'/(5X,5E15.7))
PAUSE 1111
410 IF(KWR.LE.0) GOTO 412
WRITE(*,411) (SF(I),I=1,N)
411 FORMAT(5X,'SF:'/(5X,5E15.6))
412 RETURN
END
C ======================
SUBROUTINE FFX(N,X,FX)
C ======================
DIMENSION X(N)
COMMON /ONE/ ITE,KTE,ILI,NPE,NFX,NGR
NFX=NFX+1
FX=0.785398*(X(1)*X(3)**2*(4.75*X(2)**2+85.0*X(2)-85.0)+X(6)**2*(0.92 2 *X(1)+X(4)+32.0)
1 +X(5)**2*(-X(1)+X(4)+28.0)+X(1)*X(3)*X(6)*(0.8*X(2)-1.6)))
RETURN
END
C =========================
SUBROUTINE GGX(N,KG,X,GX)
C =========================
DIMENSION X(N),GX(KG)
GX(1)=17.0-X(2)
GX(2)=0.9-X(1)/(X(2)*X(3))
GX(3)=X(1)/(X(2)*X(3))-1.4
GX(4)=2.0-X(3)
GX(5)=X(2)*X(3)-300.0
GX(6)=80.0-X(5)
GX(7)=X(5)-150.0
GX(8)=110.0-X(6)
GX(9)=X(6)-200.0
GX(10)=X(1)+0.5*X(6)-X(4)+40.0
GX(11)=1486250.0/(X(2)*X(3)*SQRT(X(1)))-550.0
GX(12)=49466941.02/((X(1)*X(2)*X(3)**2))-500.0
GX(13)=26707797.02/((X(1)*X(2)*X(3)**2))-380.0
C GX(14)=117.04*X(4)**4/(X(2)*X(3)*X(5)**4)-0.003*X(4)
C GX(15)=(1/X(5)**3)*SQRT((.285E7*X(4)/(X(2)*X(3)))**2+0.24E13)-5.5
C GX(16)=(1/X(6)**3)*SQRT((.285E7*X(4)/(X(2)*X(3)))**2+0.60E14)-5.5
RETURN
END
C =========================
SUBROUTINE HHX(N,KH,X,HX)
C =========================
DIMENSION X(N),HX(KH)
X(1)=X(1)
RETURN
END
7
收藏