loading...
مرجع مهندسی نرم افزار
آخرین ارسال های انجمن
حامد شیرزاد بازدید : 1143 پنجشنبه 03 آذر 1390 نظرات (0)
#include <iostream.h>
 
int main()
{
 
  double
    Temperature,
    PressureMeasured,
    DewPoint;
 
  // Get Temperature as input from the user
  cout << "nPlease enter the current Temperature (Celsius): ";
  cin >> Temperature;
 
  // Get PressureMeasured as input from the user
  cout << "nPlease enter the current Measured Pressure (hPa): ";
  cin >> PressureMeasured;
 
  // Get Dew Point as input from the user
  cout << "nPlease enter the current Dew Point (Celsius): ";
  cin >> DewPoint;
 
  const double
    eso = 6.1078,
    c0   = 0.99999683,
    c1   = -0.90826951e-2,
    c2   = 0.78736169e-4,
    c3   = -0.61117958e-6,
    c4   = 0.43884187e-8,
    c5   = -0.29883885e-10,
    c6   = 0.21874425e-12,
    c7   = -0.17892321e-14,
    c8   = 0.11112018e-16,
    c9   = -0.30994571e-19;
 
  // 2.  Es     = eso*(p**(-8))
  //
  // Es = Pv when Temperature is at Dew Point
  // Es checked against 1958 Smithsonian Meterological Tables,
  //  Smithsonian Institute, Washington, D.C. for accuracy
  double p;
  p = c0+(DewPoint*(c1+(DewPoint*(c2+(DewPoint*(c3+(DewPoint*(c4+(DewPoint*(c5+(DewPoint*(c6+(DewPoint*(c7+(DewPoint*(c8+(DewPoint*c9)))))))))))))))));
 
  double
    SaturationPressure,
    DryAirPressure,
    WaterVaporPressure,
    Density;
 
  SaturationPressure = eso * pow(p, -8);
  WaterVaporPressure = SaturationPressure;
 
  DryAirPressure = PressureMeasured - WaterVaporPressure;
 
  const float
    GasConstantDry = 287.05,
    GasConstantVapor = 461.495;
 
  // Air Density Calculation
  Density = (DryAirPressure*100/(GasConstantDry*(Temperature+273.15))) +
              (WaterVaporPressure*100/(GasConstantVapor*(Temperature+273.15)));
 
  cout << "nThe Air Density is " << Density << " kg/m^3.nn";
 
  return 0;
}
درباره ما
به نام آنکه جان را فکرت آموخت در این وبلاگ سعی می شود به صورت تخصصی به مباحث مربوط به مهندسی نرم افزار به خصوص برنامه نویسی کامپیوتری پرداخته شود. مدیر وبلاگ : حامد شیرزاد
اطلاعات کاربری
  • فراموشی رمز عبور؟
  • آمار سایت
  • کل مطالب : 431
  • کل نظرات : 9
  • افراد آنلاین : 1
  • تعداد اعضا : 109
  • آی پی امروز : 68
  • آی پی دیروز : 72
  • بازدید امروز : 310
  • باردید دیروز : 81
  • گوگل امروز : 0
  • گوگل دیروز : 0
  • بازدید هفته : 641
  • بازدید ماه : 3,292
  • بازدید سال : 22,393
  • بازدید کلی : 790,921
  • کدهای اختصاصی

    قالب وبلاگ