You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: (-1*d_perigalactic * e) / (eccentricity - 1)) must be greater than initial separation for brentq to work
The _get_vxvy() function in Combine.py works fine for the parameters we are interested in, but if eccentricity is too low and (-1*d_perigalactic * e) / (eccentricity - 1)) - r) is negative,
brentq will fail. This makes sense given that f(a) and f(b) must have different signs, but I am unsure if this makes sense physics-wise. Obviously the initial separation must also be less than or equal to the intergalactic distance, and violating that errors as it should.
This may all be fine, but investigation is needed to make sure.
Error message:
Traceback (most recent call last):
File "Main.py", line 31, in
combined = two_bodys.combine()
File "/home/michael/NBody/Combine.py", line 205, in combine
x1, y1, vx1, vy1 = self._initial_conds(which_gal=self.Gal1)
File "/home/michael/NBody/Combine.py", line 157, in _initial_conds
x, y, vx, vy = self._get_vxvy(which_gal)
File "/home/michael/NBody/Combine.py", line 84, in _get_vxvy
self.inital_separation)
File "/home/michael/miniconda3/lib/python3.7/site-packages/scipy/optimize/zeros.py", line 776, in brentq
r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
ValueError: f(a) and f(b) must have different signs
The text was updated successfully, but these errors were encountered:
Problem: (-1*d_perigalactic * e) / (eccentricity - 1)) must be greater than initial separation for brentq to work
The _get_vxvy() function in Combine.py works fine for the parameters we are interested in, but if eccentricity is too low and (-1*d_perigalactic * e) / (eccentricity - 1)) - r) is negative,
brentq will fail. This makes sense given that f(a) and f(b) must have different signs, but I am unsure if this makes sense physics-wise. Obviously the initial separation must also be less than or equal to the intergalactic distance, and violating that errors as it should.
This may all be fine, but investigation is needed to make sure.
Error message:
Traceback (most recent call last):
File "Main.py", line 31, in
combined = two_bodys.combine()
File "/home/michael/NBody/Combine.py", line 205, in combine
x1, y1, vx1, vy1 = self._initial_conds(which_gal=self.Gal1)
File "/home/michael/NBody/Combine.py", line 157, in _initial_conds
x, y, vx, vy = self._get_vxvy(which_gal)
File "/home/michael/NBody/Combine.py", line 84, in _get_vxvy
self.inital_separation)
File "/home/michael/miniconda3/lib/python3.7/site-packages/scipy/optimize/zeros.py", line 776, in brentq
r = _zeros._brentq(f, a, b, xtol, rtol, maxiter, args, full_output, disp)
ValueError: f(a) and f(b) must have different signs
The text was updated successfully, but these errors were encountered: