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 char bin_bhns_rotaxis_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_bhns/bin_bhns_rotaxis.C,v 1.1 2007/06/22 01:10:47 k_taniguchi Exp $" ;
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #include <math.h>
00046
00047
00048 #include "bin_bhns.h"
00049 #include "unites.h"
00050
00051 void Bin_bhns::rotation_axis_x(double rot_exp_x) {
00052
00053 using namespace Unites ;
00054
00055 double momunit = (hole.get_mass_bh()+star.mass_g_bhns())*omega*separ ;
00056
00057 double error_y = line_mom_bhns()(1) / momunit ;
00058
00059 if (error_y >= 1.) {
00060 cout << "Bin_bhns::rotation_axis:" << endl ;
00061 cout << " !!! WARNING : error_y is larger than +1 !!!" << endl ;
00062 error_y *= 0.1 ;
00063 }
00064
00065
00066
00067
00068 double gg = pow( (2.-error_y)/(2.-2.*error_y), rot_exp_x) ;
00069
00070 double xbh_old = hole.get_mp().get_ori_x() ;
00071
00072 cout << "Bin_bhns::rotation_axis:" << endl ;
00073 cout << " error_y : " << error_y << " gg : " << gg << endl ;
00074 cout << " old X_BH : " << hole.get_mp().get_ori_x() / km << " [km]"
00075 << " old X_NS : " << star.get_mp().get_ori_x() / km << " [km]"
00076 << endl ;
00077
00078 double xbh_new = xbh_old * gg ;
00079 double xns_new = xbh_new + separ ;
00080
00081 cout << " new X_BH : " << xbh_new / km << " [km]"
00082 << " new X_NS : " << xns_new / km << " [km]"
00083 << endl ;
00084
00085 double yns_old = star.get_mp().get_ori_y() ;
00086
00087 (hole.set_mp()).set_ori(xbh_new, 0., 0.) ;
00088 (star.set_mp()).set_ori(xns_new, yns_old, 0.) ;
00089
00090 set_x_rot() = 0. ;
00091
00092 }
00093
00094 void Bin_bhns::rotation_axis_y(double thres_rot, double rot_exp_y,
00095 double fact) {
00096
00097 using namespace Unites ;
00098
00099 double momunit = (hole.get_mass_bh()+star.mass_g_bhns())*omega*separ ;
00100
00101 double error_x = line_mom_bhns()(0) / momunit ;
00102
00103 if (error_x <= -1.) {
00104 cout << "Bin_bhns::rotation_axis:" << endl ;
00105 cout << " !!! WARNING : error_x is smaller than -1 !!!" << endl ;
00106 error_x *= 0.1 ;
00107 }
00108
00109
00110
00111
00112 double ff = pow( (2.+error_x)/(2.+2.*error_x), rot_exp_y) ;
00113
00114 double yns_old = star.get_mp().get_ori_y() ;
00115
00116 if ( fabs(error_x) < thres_rot ) {
00117 cout << "Bin_bhns::rotation_axis:" << endl ;
00118 cout << " ff is set to 1 because error_x is smaller than" << endl ;
00119 cout << " the threshold value (" << thres_rot << ")" << endl ;
00120
00121 ff = 1. ;
00122 }
00123
00124 cout << "Local center of mass of NS:" << endl ;
00125 cout << " X_CM : " << xa_barycenter() / km << " [km]"
00126 << " Y_CM : " << ya_barycenter() / km << " [km]" << endl ;
00127
00128 cout << "Bin_bhns::rotation_axis:" << endl ;
00129 cout << " error_x : " << error_x << " ff : " << ff << endl ;
00130 cout << " old Y_BH : " << hole.get_mp().get_ori_y() / km << " [km]"
00131 << " old Y_NS : " << star.get_mp().get_ori_y() / km << " [km]"
00132 << endl ;
00133
00134 double aa = fact * separ ;
00135 double yns_new = yns_old + aa * (1. - ff) ;
00136
00137 cout << " new Y_BH : " << 0. / km << " [km]"
00138 << " new Y_NS : " << yns_new / km << " [km]"
00139 << endl ;
00140
00141 double xbh_old = hole.get_mp().get_ori_x() ;
00142 double xns_old = star.get_mp().get_ori_x() ;
00143
00144 (hole.set_mp()).set_ori(xbh_old, 0., 0.) ;
00145 (star.set_mp()).set_ori(xns_old, yns_new, 0.) ;
00146
00147 set_y_rot() = 0. ;
00148
00149 }