[Fortran] 纯文本查看 复制代码
program main
implicit none
real*8 :: Cd0,m,Vcruise,Rho,f1,f2,f3,f4,f5,f6,parent1,parent2,parent3,pi,funcval
! c=1.0d0
pi=4.0d0*datan(1.0d0)
Vcruise=150.0d0
m=1000.0d0
Cd0=0.02d0
Rho=1.212d0
funcval=0.0d0
parent1=11.34
parent2=0.67
parent3=32.83
f1=parent1/parent2 !aspect ratio
f2=parent1*parent2 !wing planform area
! f3=(((Wbp+4.936*f2*(f3**0.3)*9.81)*2)/(Rho*f2*(Vmin**2)))**2 !lift coefficient function (for minimum air speed)
f4=2.0d0*m*9.81d0/(Rho*f2*(Vcruise**2)) !lift coefficient
if (parent3.le.30.0d0 .and. f1.gt.2.27d0 ) then
f5=1.78d0*(1.0d0-0.045d0*(f1**0.68d0))-0.64d0 !Oswald Coefficient for sweep angle smaller than or equals to 30 Degree,f1 cannot be smaller than 2.27
elseif (parent3.gt.30.0d0 .and. f1.gt.10.0d0) then
f5=4.61d0*(1.0d0-0.045d0*(f1**0.68d0))*((dcos(parent3*pi/180.0d0))**0.15d0)-3.1d0 !Oswald Coefficient for sweep angle larger than 30 Degree
else
f5=0.8d0
endif
f6=Cd0+(f4**2)/(pi*f1*f5) !drag coefficient
funcval=dble(Rho*(Vcruise**2)*f2*f6/2)
write(*,*) funcval
pause
end