_for densc in np.logspace(-0,3.7,350):
_R, M, prof = tov_s.solve(dens_c, rmax=50e5, dr=100)
m_arr.append(M)
R_arr.append(R)
print(R, M, densc) # extra I have written to check which central density gives the maximum mass of the neutron star.
I found that the radius and central density corresponded to the maximum mass 2.1498973233892715 M_sun are
12.004 km 1076.692506643068 MeV/fm^3
Now, I have fixed only this central density to check whether i am getting the same or not. But it gives me wrong values.
_R, M, prof = tovs.solve(1076.692506643068, rmax=50e5, dr=100)# 2.1498973233892715 M_sun, 12.004 km
12.004 km 4.274931084233547 M_sun
If you compare the masses there is huge differences _4.274931084233547-2.1498973233892715 = 2.125033761 Msun. But the radius is same.
For arbitrary star say mass 1.3820322317287081 M_sun, the radius and central density are 13.144 km and 386.20641587213856 Mev/fm^3
_R, M, prof = tovs.solve(386.20641587213856, rmax=50e5, dr=100)# 1.3820322317287081, 13.144
_m_arr = [] Rarr = []
_for densc in np.logspace(-0,3.7,350): _R, M, prof = tov_s.solve(dens_c, rmax=50e5, dr=100) m_arr.append(M) R_arr.append(R) print(R, M, densc) # extra I have written to check which central density gives the maximum mass of the neutron star.
I found that the radius and central density corresponded to the maximum mass 2.1498973233892715 M_sun are
12.004 km 1076.692506643068 MeV/fm^3
_R, M, prof = tovs.solve(1076.692506643068, rmax=50e5, dr=100) # 2.1498973233892715 M_sun, 12.004 km
12.004 km 4.274931084233547 M_sun
If you compare the masses there is huge differences _4.274931084233547-2.1498973233892715 = 2.125033761 Msun. But the radius is same.
_R, M, prof = tovs.solve(386.20641587213856, rmax=50e5, dr=100) # 1.3820322317287081, 13.144
print(max(prof[0]/1e5), max(prof[3]/1e33)) gives
13.144 km 2.748081260697474 M_sun
Please help me in this regard.