hamers / mse

Multiple Stellar Evolution -- A Population Synthesis Code for Multiple-Star Systems
GNU General Public License v3.0
9 stars 4 forks source link

Another system with ODE_tides.cpp -- FATAL ERROR: t_V is NaN #12

Closed pavanvyn closed 3 years ago

pavanvyn commented 3 years ago

Version baa6d17c57b9cef377a911e58f6d93312e864423

configuration = "[2,2]"
N_bodies = 4
masses = [5.093058447760394, 12.648237722921836, 6.443580107515282, 12.342633840803302]
metallicities = [0.028430542650177776, 0.028430542650177776, 0.028430542650177776, 0.028430542650177776]
semimajor_axes = [0.12401049479541143, 0.3497077963137055, 3.247264834545161]
eccentricities = [0.47201203636119604, 0.6515837152119581, 0.47068967710714166]
inclinations = [3.0839014161281986, 2.088592665666578, 0.3044507497210534]
arguments_of_pericentre = [1.8014437875856235, 3.704441107488157, 3.336967919674607]
longitudes_of_ascending_node = [4.133943340139425, 0.790055599595232, 0.5130315279982524]
tend = 1.000000E+08
N_steps = 1000
stellar_types = [1, 1, 1, 1]
object_types = [1, 1, 1, 1]

Like the other two systems I had pointed out, this system also has the error -

ODE_tides.cpp -- FATAL ERROR: t_V is NaN
binary_index 5 star_index 2 companion_index 3
t_V -nan 
st 1
pr 1
M 6.44358
star->convective_envelope_mass 1e-10
m 12.3426
a -1.15259944261353
spin 2289.98 -2031.26 -1575.68 norm 3442.79
e 1.01358019277815
rp 0.0156525
R 0.0149387
rg 0.08
star->convective_envelope_radius 4.64913e-13
star->luminosity 0.349338
k_AM 0.00928437
=============================
Printing system; N=7; integration_flag=0 size = 7
index 0 -- body -- parent 4 m 5.093058448107017 r 0.0130446 st 1 mc 0 minit 5.09306 menv 1e-10 epoch 0 age 99140.3 rc 0 renv 4.64913e-13 lum 0.151223 Spin_freq 3964.5 Omega_crit 9517.53
index 1 -- body -- parent 4 m 12.648237709082121 r 0.0222775 st 1 mc 0 minit 12.6476 menv 1e-10 epoch -8.82727e-05 age 99140.3 rc 0 renv 4.64913e-13 lum 3.2361 Spin_freq 2130.09 Omega_crit 6720.42
index 2 -- body -- parent 5 m 6.443580107669352 r 0.0149387 st 1 mc 0 minit 6.44358 menv 1e-10 epoch 0 age 99140.3 rc 0 renv 4.64913e-13 lum 0.349338 Spin_freq 3442.79 Omega_crit 8735.2
index 3 -- body -- parent 5 m 12.342633828396878 r 0.0219502 st 1 mc 0 minit 12.342 menv 1e-10 epoch -8.23321e-05 age 99140.3 rc 0 renv 4.64913e-13 lum 3.00086 Spin_freq 2169.85 Omega_crit 6787.76
index 4 -- binary -- parent 6 child1 0 child2 1 m 17.7413 a 0.124757 e 0.479357 rp 0.0649538 
index 5 -- binary -- parent 6 child1 2 child2 3 m 18.7862 a -1.1526 e 1.01358 rp 0.0156525 
index 6 -- binary -- parent -1 child1 4 child2 5 m 36.5275 a 3.25139 e 0.47049 rp 1.72164

Am I right in assuming that this kind of error is system specific, and can't be solved for all systems? In other words, I might still encounter systems with this error after this is solved, right?

'''

UPDATE : Another similar system

configuration = "[2,2]"
N_bodies = 4
masses = [2.637289392039294, 30.422508761203126, 18.524433804979367, 21.904410732825582]
metallicities = [0.0287060880866142, 0.0287060880866142, 0.0287060880866142, 0.0287060880866142]
semimajor_axes = [0.11679976142288281, 17.002803212706528, 1925.0810470138933]
eccentricities = [0.9001032171589015, 0.6784999547217095, 0.8617681964238854]
inclinations = [1.7255463919491807, 2.4556618697569945, 0.693026467836522]
arguments_of_pericentre = [1.7802895541513786, 0.8728659577824223, 5.644177993305278]
longitudes_of_ascending_node = [1.7266035085075135, 5.927816691601421, 2.683845230261317]
tend = 1.000000E+08
N_steps = 1000
stellar_types = [1, 1, 1, 1]
object_types = [1, 1, 1, 1]

Full error -

ODE_tides.cpp -- FATAL ERROR: t_V is NaN
binary_index 4 star_index 2 companion_index 3
t_V -nan 
st 1
pr 1
M 24.764
star->convective_envelope_mass 1e-10
m 12.293
a -1730.86043128734
spin -985.4 -845.446 -1016.02 norm 1648.66
e 1.00453245734712
rp 7.84505
R 0.0539933
rg 0.08
star->convective_envelope_radius 4.64913e-13
star->luminosity 33.3296
k_AM 0.00645829
=============================
Printing system; N=4; integration_flag=0 size = 4
index 0 -- body -- parent -1 m 8.521199150612446 r 1.67973e-07 st 14 mc 8.5212 minit 9.74572 menv 1e-10 epoch 5.94826e+06 age 1.77814e+06 rc 1.67973e-07 renv 4.64913e-13 lum 2.7104e-14 Spin_freq 2e+08 Omega_crit 2.66424e+11
index 2 -- body -- parent 4 m 24.764019992532162 r 0.0539933 st 1 mc 0 minit 24.8727 menv 1e-10 epoch 3.59554e+06 age 4.13086e+06 rc 0 renv 4.64913e-13 lum 33.3296 Spin_freq 1648.66 Omega_crit 2492.19
index 3 -- body -- parent 4 m 12.292965233098277 r 6.00564 st 4 mc 6.15582 minit 20.6449 menv 3.24701 epoch -331599 age 8.058e+06 rc 0.00335852 renv 5.0921 lum 39.2977 Spin_freq 0.000745338 Omega_crit 1.49682
index 4 -- binary -- parent -1 child1 2 child2 3 m 37.057 a -1730.86 e 1.00453 rp 7.84505

(I updated the existing issue only because it wasn't closed yet. If it had been, I would have opened a new one. Sorry for the inconvenience!)

hamers commented 3 years ago

The problem was the ODE solver setting e>1 in some cases. This should have been fixed in d28c020ea3a26b83718ba889bf6773e657b30739.