et_rot_f_eccentric.C

00001 /*
00002  * Method of class Etoile_rot to compute eccentric orbits
00003  *
00004  * (see file etoile.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2001 Dorota Gondek-Rosinska
00010  *   Copyright (c) 2001 Eric Gourgoulhon
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License as published by
00016  *   the Free Software Foundation; either version 2 of the License, or
00017  *   (at your option) any later version.
00018  *
00019  *   LORENE is distributed in the hope that it will be useful,
00020  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00021  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022  *   GNU General Public License for more details.
00023  *
00024  *   You should have received a copy of the GNU General Public License
00025  *   along with LORENE; if not, write to the Free Software
00026  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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  * $Id: et_rot_f_eccentric.C,v 1.5 2003/12/19 16:31:52 j_novak Exp $
00035  * $Log: et_rot_f_eccentric.C,v $
00036  * Revision 1.5  2003/12/19 16:31:52  j_novak
00037  * Still warnings...
00038  *
00039  * Revision 1.4  2003/12/19 16:21:42  j_novak
00040  * Shadow hunt
00041  *
00042  * Revision 1.3  2003/12/05 14:50:26  j_novak
00043  * To suppress some warnings...
00044  *
00045  * Revision 1.2  2003/10/03 15:58:47  j_novak
00046  * Cleaning of some headers
00047  *
00048  * Revision 1.1.1.1  2001/11/20 15:19:28  e_gourgoulhon
00049  * LORENE
00050  *
00051  * Revision 2.0  2001/02/08  15:13:24  eric
00052  * *** empty log message ***
00053  *
00054  *
00055  * $Header: /cvsroot/Lorene/C++/Source/Etoile/et_rot_f_eccentric.C,v 1.5 2003/12/19 16:31:52 j_novak Exp $
00056  *
00057  */
00058 
00059 
00060 // Headers C
00061 #include <math.h>
00062 
00063 // Headers Lorene
00064 #include "etoile.h"
00065 #include "param.h"
00066 
00067 //=============================================================================
00068 //      r_isco()
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     // First and second derivatives of metric functions
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() ;     // d^2/dr^2 N^phi
00083 
00084     Cmp tmp = nnn().dsdr() ;
00085     tmp.annule(nzm1) ;
00086     Cmp ddnnn = tmp.dsdr() ;        // d^2/dr^2 N
00087 
00088     tmp = bbb().dsdr() ;
00089     tmp.annule(nzm1) ;
00090     Cmp ddbbb = tmp.dsdr() ;        // d^2/dr^2 B
00091 
00092     // Constructing the velocity of a particle corotating with the star
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     // ucor_plus - the velocity of corotating particle on the circular orbit
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     // Scalar field the zero of which will give the marginally stable orbit
00127     Cmp orbit = factor_u2 * ucor_plus * ucor_plus +
00128                 factor_u1 * ucor_plus + factor_u0 ;
00129 
00130     // Search for the zero
00131     // -------------------
00132 
00133     int l_ms = nzet ;  // index of the domain containing the MS orbit
00134 
00135 
00136     Param par_ms ;
00137     par_ms.add_int(l_ms) ;
00138     par_ms.add_cmp(orbit) ;
00139 
00140     // Preliminary location of the zero
00141     // of the orbit function with an error = 0.01
00142     // The orbit closest to the star
00143     double theta_ms = M_PI / 2. ; // 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 //##        double precis_ms = 1.e-12 ;    // precision in the determination of xi_ms
00186 //##        int nitermax_ms = 100 ;        // max number of iterations
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     // Determination of the frequency at the marginally stable orbit
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 

Generated on Tue Feb 7 01:35:16 2012 for LORENE by  doxygen 1.4.6