2
1 #include<cstdio> 2 #include<cstdlib> 3 #include<cmath> 4 #include<iostream> 5 using namespace std; 6 7 long double a=-5.8522e+04,b=3.7519e+11,c=6.8944e-07,g0=9.7803, 8 gama=1.4000,k=0.00046,P0=101325,P00=101325.0,Re=6378137.0, 9 rou0=1.2250,rou00=1.1031865,T0=273.0,T00=303.1500, 10 mu=0.027441,R=8.3140,A=58857.2530,B=375399623239.3531; 11 long double n0=pow(1+k*c*(a+b/Re),2.5); 12 13 long double phi() 14 { 15 int n=10000; 16 long double st=1,ed=1+k*rou00; 17 long double delta=(ed-st)/n,ans=0; 18 for(int i=1;i<=n;i++) 19 { 20 long double X=(st-1)*pow(T00,3.5)/k/rou0/T0; 21 long double H=pow(X,0.4)+A-303.15; 22 H=B/H; 23 H-=6378137; 24 ans+=n0*Re/st/(Re+H)/ 25 sqrt(1-(n0*Re/st/(Re+H))*(n0*Re/st/(Re+H)))/st*delta; 26 st+=delta; 27 } 28 return ans; 29 } 30 31 long double eps=1e-8,tar=0.0098901991; 32 long double tdiv() 33 { 34 long double l=0.0,r=1.0; 35 while(r-l>eps) 36 { 37 long double mid=(l+r)/2;k=mid; 38 long double ans=phi(); 39 if(ans<tar) l=mid; 40 else r=mid; 41 } 42 return l; 43 } 44 45 int main() 46 { 47 long double ans=phi(); 48 tdiv(); 49 return 0; 50 }