Changeset 3952 in Sophya for trunk/Cosmo/SimLSS
- Timestamp:
- Feb 22, 2011, 4:32:25 PM (15 years ago)
- Location:
- trunk/Cosmo/SimLSS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvtuniv.cc
r3790 r3952 27 27 <<"cmvtuniv [options] z1,z2"<<endl 28 28 <<" -D dz"<<endl 29 <<" -U h100,om0,or0,ol0,w0 "<<endl29 <<" -U h100,om0,or0,ol0,w0,wa"<<endl 30 30 <<" -F flat(0,1,2)"<<endl 31 31 <<" -I perc,dzinc,dzmax,glorder"<<endl … … 44 44 unsigned short flat = 0; 45 45 // -- WMAP 46 double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1. ;46 double h100=0.71, om0=0.267804, or0=7.9e-05, ol0=0.73,w0=-1.,wa=0.; 47 47 // -- ouvert matter only 48 //double h100=0.71, om0=0.3, or0=0., ol0=0.,w0=-1 .;48 //double h100=0.71, om0=0.3, or0=0., ol0=0.,w0=-1,wa=0..; 49 49 // -- plat matter only 50 //double h100=0.71, om0=1., or0=0., ol0=0.,w0=-1. ; flat = 1;50 //double h100=0.71, om0=1., or0=0., ol0=0.,w0=-1.,wa=0.; flat = 1; 51 51 // -- plat lambda only 52 //double h100=0.71, om0=0., or0=0., ol0=1.,w0=-1. ; flat = 2;52 //double h100=0.71, om0=0., or0=0., ol0=1.,w0=-1.,wa=0.; flat = 2; 53 53 54 54 // -- parametre d'integration … … 70 70 break; 71 71 case 'U' : 72 sscanf(optarg,"%lf,%lf,%lf,%lf,%lf ",&h100,&om0,&or0,&ol0,&w0);72 sscanf(optarg,"%lf,%lf,%lf,%lf,%lf,%lf",&h100,&om0,&or0,&ol0,&w0,&wa); 73 73 break; 74 74 case 'F' : … … 94 94 cout<<"z1="<<z1<<" z2="<<z2<<" dz="<<dz<<endl; 95 95 cout<<"perc="<<perc<<" dzinc="<<dzinc<<" dzmax="<<dzmax<<" glorder="<<glorder<<endl; 96 cout<<"h100="<<h100<<" om0="<<om0<<" or0="<<or0<<" ol0="<<ol0<<" w0="<<w0<<" flat="<<flat<<endl;96 cout<<"h100="<<h100<<" om0="<<om0<<" or0="<<or0<<" ol0="<<ol0<<" w0="<<w0<<" wa="<<wa<<" flat="<<flat<<endl; 97 97 cout<<"todo ="<<todo<<endl; 98 98 99 99 CosmoCalc univ1(flat,true,z2); 100 100 univ1.SetInteg(perc,dzinc,dzmax,glorder); 101 univ1.SetDynParam(h100,om0,or0,ol0,w0 );101 univ1.SetDynParam(h100,om0,or0,ol0,w0,wa); 102 102 univ1.PrtInteg(); 103 103 univ1.Print(); … … 108 108 CosmoCalc univ2(flat,false,z2); 109 109 univ2.SetInteg(perc,dzinc,dzmax,glorder); 110 univ2.SetDynParam(h100,om0,or0,ol0,w0 );110 univ2.SetDynParam(h100,om0,or0,ol0,w0,wa); 111 111 univ2.PrtInteg(); 112 112 univ2.Print(); … … 115 115 else if(todo==3) tstspeed(univ1,z1,z2,dz); 116 116 else if(todo==4) tstntuple(univ1,z1,z2,dz); 117 else if(todo==5) tstinterp(univ1,z1,z2,dz);117 else if(todo==5) tstinterp(univ1,z1,z2,dz); 118 118 else cout<<"Unknown job to be done !!!!! todo="<<todo<<endl; 119 119 … … 215 215 nt.Fill(xnt); 216 216 } 217 217 218 cout<<">>>> Ecriture"<<endl; 219 nt.Info()["flat"] = univ.Flat(); 220 nt.Info()["h100"] = univ.h100(); 221 nt.Info()["Olambda0"] = univ.Olambda0(); 222 nt.Info()["W0"] = univ.W0(); 223 nt.Info()["Wa"] = univ.Wa(); 224 nt.Info()["Omatter0"] = univ.Omatter0(); 225 nt.Info()["Obaryon0"] = univ.Obaryon0(); 226 nt.Info()["Orelat0"] = univ.Orelat0(); 227 nt.Info()["Ocurv0"] = univ.Ocurv0(); 228 nt.Info()["Otot0"] = univ.Otot0(); 229 nt.Info()["ZMax"] = univ.ZMax(); 230 218 231 string tag = "cmvtuniv_nt.ppf"; 219 232 POutPersist pos(tag); -
trunk/Cosmo/SimLSS/cosmocalc.cc
r3768 r3952 67 67 _Olambda0 = univ._Olambda0; 68 68 _W0 = univ._W0; 69 _Wa = univ._Wa; 69 70 _Omatter0 = univ._Omatter0; 70 71 _Obaryon0 = univ._Obaryon0; … … 149 150 } 150 151 151 void CosmoCalc::SetDynParam(double h100,double om0,double or0,double ol0,double w0 )152 void CosmoCalc::SetDynParam(double h100,double om0,double or0,double ol0,double w0,double wa) 152 153 { 153 154 _computespl=true; … … 161 162 _Olambda0 = ol0; 162 163 _W0 = w0; 164 _Wa = wa; 163 165 _Otot0 = _Olambda0 + _Omatter0 + _Orelat0; 164 166 _Ocurv0 = 1. - _Otot0; … … 209 211 210 212 double h100 = 0.71; 211 double ol0 = 0.73, w0 = -1. ;213 double ol0 = 0.73, w0 = -1., wa = 0.; 212 214 double om0 = 0.135/(h100*h100); 213 215 // Relat = photons (2.725 K) + neutrinos (1.9 K) 214 216 double or0 = 2.47e-5 * (1. + 21./8.*pow(T_NU_Par/T_CMB_Par,4.)) / (h100*h100); 215 SetDynParam(h100,om0,or0,ol0,w0 );217 SetDynParam(h100,om0,or0,ol0,w0,wa); 216 218 _Obaryon0 = 0.0224/(h100*h100); 217 219 … … 224 226 if(z<0.) z = 0.; 225 227 226 printf("CosmoCalc::Print(spl=%d,zmax=%g,flat=%u) for z=%g\n",int(_usespline),ZMax(),Flat(),z); 228 printf("CosmoCalc::Print(spl=%d,zmax=%g,flat=%u) for z=%g (a=%g)\n" 229 ,int(_usespline),ZMax(),Flat(),z,1./(1.+z)); 227 230 printf("h100=%g H0=%g Dhub=%g H(z)=%g Rhoc=%g g/cm^3 =%g Msol/Mpc^3\n" 228 231 ,h100(),H0(),Dhubble(),H(z),Rhoc(z),Rhoc(z)*GCm3toMsolMpc3_Cst); 229 printf("Olambda=%g W 0=%g\n",Olambda(z),_W0);232 printf("Olambda=%g W=%g (%g+(%g)*(1-a))\n",Olambda(z),W(z),_W0,_Wa); 230 233 printf("Omatter=%g Obaryon=%g\n",Omatter(z),Obaryon(z)); 231 234 printf("Orelat=%g\n",Orelat(z)); … … 240 243 //---------------------------------------------------------- 241 244 double CosmoCalc::Olambda(double z) 242 { 243 double v = _Olambda0; 244 if(_W0 != -1.) v *= pow((1.+z),3.*(1+_W0)); 245 // Equation d'etat de l'energie noire: P=W(z)*Rho*C^2 246 // avec W(z) = W0 + Wa*(1-a) = W0 + Wa * z/(1+z) et a=1/(1+z) 247 { 248 double zp1 = 1. + z; 249 double v = _Olambda0 * pow(zp1,3.*(1.+_W0+_Wa)); 250 if(_Wa!=0.) v *= exp(-3.*_Wa*z/zp1); 245 251 return v / E2(z); 246 252 } … … 248 254 double CosmoCalc::Omatter(double z) 249 255 { 250 return _Omatter0 * (1.+z)*(1.+z)*(1.+z) /E2(z); 256 double zp1 = 1. + z; 257 return _Omatter0 * zp1*zp1*zp1 /E2(z); 251 258 } 252 259 253 260 double CosmoCalc::Obaryon(double z) 254 261 { 255 return _Obaryon0 * (1.+z)*(1.+z)*(1.+z) /E2(z); 262 double zp1 = 1. + z; 263 return _Obaryon0 * zp1*zp1*zp1 /E2(z); 256 264 } 257 265 … … 269 277 double CosmoCalc::Otot(double z) 270 278 { 271 return Olambda(z) +Omatter(z)+Orelat(z);279 return Olambda(z) + Omatter(z) + Orelat(z); 272 280 } 273 281 … … 369 377 double CosmoCalc::E2(double z) const 370 378 { 371 z += 1.; 379 double zp1 = 1. + z; 380 372 381 double oldum = _Olambda0; 373 374 if(oldum>0. && _W0!=-1.) oldum *= pow(z,3.*(1.+_W0)); 375 376 return oldum + z*z*(_Ocurv0 + z*(_Omatter0+z*_Orelat0)); 382 if(oldum>0.) { 383 oldum *= pow(zp1,3.*(1.+_W0+_Wa)); 384 if(_Wa!=0.) oldum *= exp(-3.*_Wa*z/zp1); 385 } 386 387 return oldum + zp1*zp1*(_Ocurv0 + zp1*(_Omatter0+zp1*_Orelat0)); 377 388 } 378 389 -
trunk/Cosmo/SimLSS/cosmocalc.h
r3768 r3952 25 25 void PrtInteg(void); 26 26 27 void SetDynParam(double h100,double om0,double or0,double ol0,double w0=-1. );27 void SetDynParam(double h100,double om0,double or0,double ol0,double w0=-1.,double wa=0.); 28 28 void SetObaryon0(double v); 29 29 void DefaultParam(void); … … 34 34 inline double Olambda0(void) {return _Olambda0;} 35 35 inline double W0(void) {return _W0;} 36 inline double Wa(void) {return _Wa;} 36 37 inline double Omatter0(void) {return _Omatter0;} 37 38 inline double Obaryon0(void) {return _Obaryon0;} … … 43 44 inline double H(double z) {return _H0 * E(z);} 44 45 double Olambda(double z); 46 inline double W(double z) {return _W0 + _Wa * z/(1.+z);} // W(z) = W0 + Wa*(1-a) 45 47 double Omatter(double z); 46 48 double Obaryon(double z); … … 76 78 unsigned short _flat; 77 79 double _h100, _H0; /* km/s/Mpc */ 78 double _Olambda0,_W0 ;80 double _Olambda0,_W0,_Wa; 79 81 double _Omatter0,_Obaryon0; 80 82 double _Orelat0;
Note:
See TracChangeset
for help on using the changeset viewer.