forked from ignotur/NINA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stars.h
186 lines (171 loc) · 7 KB
/
stars.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#ifndef STAR
#define STAR
#include "lum_model.h"
#include "field_decay_model.h"
double const light_velocity = 2.9979250e10; // Скорость света в см/сек
double const pi = 3.1415926;
double const rand_high_board = 2.14665e+9;
double const e = 2.718281828;
double const M_sol = 1.989e33; // Масса солнца в граммах
double const R_sol = 6.9599e10; // Радиус солнца в сантиметрах
double const G_cgs = 6.67e-8; // Гравитационная постоянная в см^3 /(г*сек^2)
double const G = 2.2608e-57; // Гравитационная постоянная в кпк^3/(г*год^2)
double const lcm = 3.2407789e-22; // 1 см в кпк, для внутренних переводов
double const lsec = 3.1688955e-8; // 1 сек в годах, для внутренних переводов
//------------------------------------------------------------//
// Константы по которым будет производиться градиентный спуск
//extern double tau_ohm/* = 2.3e5*/; // характерное время убывания поля на поверхности нейтронной звезды
//extern double alpha/* = 5*/; // коэффициент затухания магнитного поля
//extern double delta_s/* = 0.1*/; // Коэффициент определяющий угловые размеры сгустка плазмы
//extern double delta_lum/* = 1.*/; // Коэффициент определяющий светимость одного сгустка плазмы
//------------------------------------------------------------//
//--------------------------------------------------//
// Класс служит для хранения карты распределения
// температур по небу на частоте 1.4 Ггц
// Используется для ускорения расчётов.
//--------------------------------------------------//
class TMap {
public:
int size;
double Tb [1038961];
TMap ();
double get_Tb (int);
private:
};
//--------------------------------------------//
// Class which contains P and B initial parame-
// ters for distribution.
//--------------------------------------------//
class PDistr {
public:
PDistr (ifstream *);
void print_param (ostream * );
double a();
double b();
private:
double ain;
double bin;
};
class BDistr {
public:
BDistr (ifstream *);
void print_param (ostream *);
double a();
double b();
private:
double ain;
double bin;
};
//----------------------------------------------//
// Класс для расчёта положения солнца
//----------------------------------------------//
class SpecialStar {
public:
double x, y, z, v_x, v_y, v_z, t; // эпоха для которой посчитано положение
int use;
ofstream out_err;
SpecialStar();
//~special_star();
double get_position_x();
double get_position_y();
double get_position_z();
double get_velocity_x();
double get_velocity_y();
double get_velocity_z();
double get_theta ();
void move_to(double);
private:
};
// Описание переменных
// M - масса в массах солнца в граммах
// x, y, z - координаты звезды в кпк
// v_x, v_y, v_z - скорость звезды в кпк/год
// F - магнитный поток на поверхности звезды в Гс см^2
// Z - металличность
// ksi - log10(Z/0.02) - отношение металличности к солнечной
// L - момент импульса находяшийся в звезде в г см^2 / сек^2
class OBStar {
public:
double M, R, x, y, z, v_x, v_y, v_z, F, P, Z, ksi, L, t_bgb, t_ms, t_inf, t_HeI, t_He, M_c_SN;
double M_c_DU, M_c_BGB, t_BGB, M_c_HeF, M_c_HeI, M_c_BAGB;
double tau; // Время рождения
OBStar (double, SpecialStar*);
//~star_OB ();
double get_position_x();
double get_position_y();
double get_position_z();
double get_velocity_x();
double get_velocity_y();
double get_velocity_z();
void move_to (double);
double get_Flux ();
double get_mass ();
double get_time_on_MS();
double get_R (double);
double get_Z ();
double get_L ();
double get_t_bgb ();
double get_t_inf ();
double get_t_HeI ();
double get_M_c_SN ();
double get_t_He ();
double get_c_HeI ();
double get_c_DU ();
double get_c_BGB ();
double get_c_HeF ();
double get_c_BAGB ();
protected:
void set_position(double, double, double);
void set_velocity(double, double, double);
private:
};
/*
class close_double_star_OB {
public:
star_OB *first, *second;
double x, y, z, v_z, v_y, v_z;
double a, e;
private:
}
*/
class NeutronStar {
public:
parametrs_B * paramet_B;
double M, R, x, y, z, v_x, v_y, v_z, B, P, L;
double tau; // Время рождения
bool visible, massive;
double sparks [2][30];
double i_incl, x_axis, y_axis, z_axis;
NeutronStar (double, OBStar *, parametrs_B *, PDistr*, BDistr*);
//~neutron_star ();
double get_M ();
double get_R ();
double get_P (double/*, parametrs_B **/);
double get_dot_P(double/*, parametrs_B **/);
//double get_L (double);
double get_position_x ();
double get_position_y ();
double get_position_z ();
double get_velocity_x ();
double get_velocity_y ();
double get_velocity_z ();
double get_dist_to_sun(double, SpecialStar *);
void move_to (double);
double get_B (double/*, parametrs_B **/);
double get_incl (double);
//double get_Lum (double);
//double get_nu_0 (double); // Циклическая частота вращения пульсара sec^-1
//double get_nu_1 (double); // Первая производная циклической частоты вращения пульсара sec^-2
//double get_nu_2 (double); // Вторая производная циклической частоты вращения пульсара sec^-3
void show_pos_sparks (void);
void show_pulse_profile (double t, SpecialStar *, parametrs_lum *);
bool is_pulsar_alive (double);
bool is_this_ns(); // Проверка, какая масса у родившейся нейтронной звезды
double is_pulsar_visible (double, SpecialStar * , TMap *, parametrs_lum *);
double get_angle_btw_l_of_s_sparks (double, SpecialStar *, double *, parametrs_lum *);
double get_DM (double, SpecialStar *, float *, float *, float *);
//double T_sky (double, double);
//double S_min (double, double, float, double, double, double, float);
private:
};
#endif