-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwithout_field_decay.cpp
More file actions
50 lines (37 loc) · 1.34 KB
/
without_field_decay.cpp
File metadata and controls
50 lines (37 loc) · 1.34 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <cmath>
#include "stars.h"
using namespace std;
double MFDConst::get_B (double t, double B, double i_incl, double P) {
return B;
}
double MFDConst::get_incl (double t, double B, double i_incl, double P) {
return i_incl;
}
double MFDConst::get_P(double t, double B, double i_incl, double P) {
double res, I;
//I = 2./5. * M*M_sol*pow(R,2);
I=1e45;
res = P * sqrt(1. + 16*t*3.2e7*pow(1e6, 6)*B*B*pi*pi/(3.*pow(light_velocity,3)*I*P*P));
//res = sqrt(P+2*B*B*t*3.2e7/1.e39);
//cout<<R<<endl;
return res;
}
double MFDConst::get_dot_P (double t, double B, double i_incl, double P) {
double res, I;
//I = 2./5. * M*M_sol*pow(R,2);
//res = pow(B/3.2e19, 2)/get_P(t);
I=1e45;
res = 8*pi*pi*pow(1e6,6)/3./pow(light_velocity, 3)/I/get_P(t, B, i_incl, P)*B*B;
//res = 1*B*B/1.e39/get_P(t);
return res;
}
MFDConst::MFDConst (vector <double> * values) {
}
void MFDConst::print_description (ostream * out) {
*out<<"#// Constant magnetic field //"<<endl;
*out<<"#//----------------------------------------------------------//"<<endl;
}
void MFDConst::print_parameters (ostream * out) {
*out<<"#// This model has no parameters because field is constant //"<<endl;
*out<<"#//----------------------------------------------------------//"<<endl;
}