00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 char et_rot_f_eccentric_C[] = "$Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_f_eccentric.C,v 1.5 2003/12/19 16:31:52 j_novak Exp $" ;
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #include <math.h>
00062
00063
00064 #include "etoile.h"
00065 #include "param.h"
00066
00067
00068
00069
00070
00071 double Etoile_rot::f_eccentric(double, double, ostream* ost) const {
00072
00073 cout << "Etoile_rot::f_eccentric not ready yet !" << endl ;
00074 abort() ;
00075
00076
00077
00078
00079 int nzm1 = mp.get_mg()->get_nzone() - 1 ;
00080 Cmp dnphi = nphi().dsdr() ;
00081 dnphi.annule(nzm1) ;
00082 Cmp ddnphi = dnphi.dsdr() ;
00083
00084 Cmp tmp = nnn().dsdr() ;
00085 tmp.annule(nzm1) ;
00086 Cmp ddnnn = tmp.dsdr() ;
00087
00088 tmp = bbb().dsdr() ;
00089 tmp.annule(nzm1) ;
00090 Cmp ddbbb = tmp.dsdr() ;
00091
00092
00093
00094
00095 Cmp bdlog = bbb().dsdr() / bbb() ;
00096 Cmp ndlog = nnn().dsdr() / nnn() ;
00097 Cmp bsn = bbb() / nnn() ;
00098
00099 Cmp r(mp) ;
00100 r = mp.r ;
00101
00102 Cmp r2= r*r ;
00103
00104 bdlog.annule(nzm1) ;
00105 ndlog.annule(nzm1) ;
00106 bsn.annule(nzm1) ;
00107 r2.annule(nzm1) ;
00108
00109
00110 Cmp ucor_plus = (r2 * bsn * dnphi +
00111 sqrt ( r2 * r2 * bsn *bsn * dnphi * dnphi +
00112 4 * r2 * bdlog * ndlog + 4 * r * ndlog) ) /
00113 2 / (1 + r * bdlog ) ;
00114
00115 Cmp factor_u2 = r2 * (2 * ddbbb / bbb() - 2 * bdlog * bdlog +
00116 4 * bdlog * ndlog ) +
00117 2 * r2 * r2 * bsn * bsn * dnphi * dnphi +
00118 4 * r * ( ndlog - bdlog ) - 6 ;
00119
00120 Cmp factor_u1 = 2 * r * r2 * bsn * ( 2 * ( ndlog - bdlog ) *
00121 dnphi - ddnphi ) ;
00122
00123 Cmp factor_u0 = - r2 * ( 2 * ddnnn / nnn() - 2 * ndlog * ndlog +
00124 4 * bdlog * ndlog ) ;
00125
00126
00127 Cmp orbit = factor_u2 * ucor_plus * ucor_plus +
00128 factor_u1 * ucor_plus + factor_u0 ;
00129
00130
00131
00132
00133 int l_ms = nzet ;
00134
00135
00136 Param par_ms ;
00137 par_ms.add_int(l_ms) ;
00138 par_ms.add_cmp(orbit) ;
00139
00140
00141
00142
00143 double theta_ms = M_PI / 2. ;
00144 double phi_ms = 0. ;
00145
00146 double xi_min = -1. ;
00147 double xi_max = 1. ;
00148
00149 double resloc_old ;
00150 double xi_f = xi_min;
00151
00152 orbit.std_base_scal() ;
00153 const Valeur& vorbit = orbit.va ;
00154
00155 double resloc = vorbit.val_point(l_ms, xi_min, theta_ms, phi_ms) ;
00156
00157 for (int iloc=0; iloc<200; iloc++) {
00158 xi_f = xi_f + 0.01 ;
00159 resloc_old = resloc ;
00160 resloc = vorbit.val_point(l_ms, xi_f, theta_ms, phi_ms) ;
00161 if ((resloc * resloc_old) < double(0) ) {
00162 xi_min = xi_f - 0.01 ;
00163 xi_max = xi_f ;
00164 break ;
00165 }
00166 }
00167
00168
00169 if (ost != 0x0) {
00170 *ost <<
00171 "Etoile_rot::isco : preliminary location of zero of MS function :"
00172 << endl ;
00173 *ost << " xi_min = " << xi_min << " f(xi_min) = " <<
00174 vorbit.val_point(l_ms, xi_min, theta_ms, phi_ms) << endl ;
00175 *ost << " xi_max = " << xi_max << " f(xi_max) = " <<
00176 vorbit.val_point(l_ms, xi_max, theta_ms, phi_ms) << endl ;
00177 }
00178
00179 double xi_ms = 0 ;
00180 double r_ms = 0 ;
00181
00182 if ( vorbit.val_point(l_ms, xi_min, theta_ms, phi_ms) *
00183 vorbit.val_point(l_ms, xi_max, theta_ms, phi_ms) < double(0) ) {
00184
00185
00186
00187
00188 int niter = 0 ;
00189
00190 if (ost != 0x0) {
00191 * ost <<
00192 " number of iterations used in zerosec to locate the ISCO : "
00193 << niter << endl ;
00194 *ost << " zero found at xi = " << xi_ms << endl ;
00195 }
00196
00197 r_ms = mp.val_r(l_ms, xi_ms, theta_ms, phi_ms) ;
00198
00199 }
00200 else {
00201 xi_ms = -1 ;
00202 r_ms = ray_eq() ;
00203 }
00204
00205 p_r_isco = new double (
00206 (bbb().va).val_point(l_ms, xi_ms, theta_ms, phi_ms) * r_ms
00207 ) ;
00208
00209
00210
00211
00212 ucor_plus.std_base_scal() ;
00213 double ucor_msplus = (ucor_plus.va).val_point(l_ms, xi_ms, theta_ms,
00214 phi_ms) ;
00215 double nobrs = (bsn.va).val_point(l_ms, xi_ms, theta_ms, phi_ms) ;
00216 double nphirs = (nphi().va).val_point(l_ms, xi_ms, theta_ms, phi_ms) ;
00217
00218 p_f_isco = new double ( ( ucor_msplus / nobrs / r_ms + nphirs ) /
00219 (double(2) * M_PI) ) ;
00220
00221 return 0 ;
00222
00223 }
00224
00225
00226
00227
00228
00229
00230
00231
00232