Open ruskin23 opened 5 years ago
Not a problem with scipy.optimize.root.
Simply putting the _try_initial_condition_solver function in a loop for the same initial values gives:
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE 0.07694740761660412 -0.10196568378465258
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE 0.07694755827306388 -0.1019656441994576
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE 0.07694755827306388 -0.1019656441994576
If you run the same code a second time do you get exactly the same values for everything? This may help distinguish between something like a memory leak in the C++ library vs something happening in the python part
I ran the same code twice by putting everything in a loop right from the beginning and the same results were produced. Also, all the finals properties are different for the same initial conditions for try_initial_condition function:
i=1
1.1300786890891823 #primary_mass 0.9989895611548372 #secondary_mass 0.04769862780926112 #age BEGINSAT star-planet evolution completed
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE final semimajor = 22.17686356299132 final age = 0.04769862780926112 final primary envelope angular momentum = 0.004952828446631805 final primary core angular momentum 0.3201271359347706 final secondary envelope angular momentum = 0.00634815847686712 final secondary core angular momentum 0.10358456564757547 0.07694740761660412 -0.10196568378465258
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE final semimajor = 22.176863831648163 final age = 0.04769862780926112 final primary envelope angular momentum = 0.004952828356631842 final primary core angular momentum 0.32012685551600834 final secondary envelope angular momentum = 0.0063481583615120196 final secondary core angular momentum 0.10358455248160424 0.07694755827306388 -0.1019656441994576
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE final semimajor = 22.176863831648163 final age = 0.04769862780926112 final primary envelope angular momentum = 0.004952828356631842 final primary core angular momentum 0.32012685551600834 final secondary envelope angular momentum = 0.0063481583615120196 final secondary core angular momentum 0.10358455248160424 0.07694755827306388 -0.1019656441994576
i=2
1.1300786890891823 #primary_mass 0.9989895611548372 #secondary_mass 0.04769862780926112 #age BEGINSAT star-planet evolution completed
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE final semimajor = 22.17686356299132 final age = 0.04769862780926112 final primary envelope angular momentum = 0.004952828446631805 final primary core angular momentum 0.3201271359347706 final secondary envelope angular momentum = 0.00634815847686712 final secondary core angular momentum 0.10358456564757547 0.07694740761660412 -0.10196568378465258
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE final semimajor = 22.176863831648163 final age = 0.04769862780926112 final primary envelope angular momentum = 0.004952828356631842 final primary core angular momentum 0.32012685551600834 final secondary envelope angular momentum = 0.0063481583615120196 final secondary core angular momentum 0.10358455248160424 0.07694755827306388 -0.1019656441994576
Trying Porb_initial = 8.213895933139078, e_initial =0.2071468686756509 BINARY CONFIGURATION COMPLETE BINARY EVOLUTION COMPLETE final semimajor = 22.176863831648163 final age = 0.04769862780926112 final primary envelope angular momentum = 0.004952828356631842 final primary core angular momentum 0.32012685551600834 final secondary envelope angular momentum = 0.0063481583615120196 final secondary core angular momentum 0.10358455248160424 0.07694755827306388 -0.1019656441994576
I am currently plotting the evolution to see where does the change comes in.
The parameters which I am using are:
teff_primary=6143.418404381242,
feh=-0.06343468212582376,
logg=4.457665799499136,
logQ=5.108511709508514,
Wdisk=4.648707984307468,
Porb=8.213895933139078,
incination=0.0,
disk_dissipation_age=5e-3,
wind=True,
planet_formation_age=5e-3,
wind_saturation_frequency=2.54,
diff_rot_coupling_timescale=5e-3,
wind_strength=0.17,
eccentricity=0.2071468686756509
These are one of the proposed values in the mcmc code.
Shift the creating of primary and secondary star objects into the solver to see if the problem is related to how stars are configured initially
Root function calculates different values of final rotation period of star, final orbital period and final eccentricity for the same initial orbital period and initial eccentricity.