fixed point solver
Closed this issue · 2 comments
qezlou commented
fake_spectra/fake_spectra/rate_network.py
Line 143 in 2ec63a3
Since rooted()
returns nebynh
shouln't the second argument of fixed_point()
be just a unit vector ?
qezlou commented
fake_spectra/fake_spectra/rate_network.py
Line 143 in 2ec63a3
Since
rooted()
returnsnebynh
shouln't the second argument offixed_point()
be just a unit vector ?
Sorry, It cannot be a unit vector :)) We are looking for x0 in f(x0)=x0.
But, this line seems to me is looking for nebynh = nh. Maybe I am wrong.
qezlou commented
I modified the rooted()
to return ne instead of nebynh. like this :
def rooted(ne, nh, ienergy):
return self._nebynh(nh, self._get_temp(ne/nh, ienergy, helium=helium), ne/nh, helium=helium)*nh
ne = fixed_point(rooted, nh, args=(nh, ienergy),xtol=self.converge)
assert np.all(np.abs(rooted(ne, nh, ienergy) - ne) < self.converge)
return nebynh * nh
It did not solve my issue with TNG though :((