-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadiab_cool_ph_and_el.h
26 lines (18 loc) · 1.13 KB
/
adiab_cool_ph_and_el.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
tuple<double, double, double> func_adiab_cool_ph_el(double t_init_this_ph_obs_fr,
double t_delta_ph, double t_elec_init,
double E_ph_init, double gam_e_init)
{
// Declaring variables returned by function
double E_ph_fin, gam_e_fin, beta_e_fin ;
// Final photon energy with adiabatic cooling
E_ph_fin = E_ph_init*(pow( (r_initial + (t_init_this_ph_obs_fr + t_delta_ph)*c*beta_jet)/
(r_initial + (t_init_this_ph_obs_fr)*c*beta_jet) , -2.0/3.0 )) ;
// Declaring exponent for adiabatic cooling for electron
double elec_adiab_index = 2.0 - 2.0*( (4.0*gam_e_init + 1.0)/(3.0*gam_e_init) ) ;
// Final gam_e of electron with adiabatic cooling
gam_e_fin = 1.0 + (gam_e_init-1.0)*(pow( (r_initial + (t_init_this_ph_obs_fr + t_delta_ph)*c*beta_jet)/
(r_initial + t_elec_init*c*beta_jet), elec_adiab_index )) ;
// Calculating final beta_e from final gam_e
beta_e_fin = sqrt(1.0 - 1.0/(gam_e_fin*gam_e_fin)) ;
return make_tuple(E_ph_fin, gam_e_fin, beta_e_fin) ;
}