-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dynamical friction #346
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…o inherit from general Force class and introduce two subclasses: Potential for all forces that derive from a potential and DissipativeForce for those that do not (like dynamical friction), generalize evaluatePotentials and evaluateXForces to include dissipative forces; generalize FullOrbit integration to pass velocities to forces (for dynamical friction)
…its with a symplectic integrator when the force is dissipative
…setup of ChandrasekharDynamicalFrictionForce)
… DissipativeForces
… error when no velocity given for dissipative force
…en a dissipative force, still raise error in potential, density, and second derivative
…s; start with computing sigma_r(r) using the spherical Jeans equation
…s, as a possibly better approx. for halo objects in a disk+halo potential
…df/ and galpy/df.py --> galpy/df/__init.py; various other necessary adjustments
…le_src/ --> galpy/actionAngle/ and galpy/actionAngle.py --> galpy/actionAngle/__init.py; various other necessary adjustments
…galpy/orbit/ and galpy/orbit.py --> galpy/orbit/__init.py; various other necessary adjustments
…rc/ --> galpy/potential/ and galpy/potential.py --> galpy/potential/__init.py; various other necessary adjustments
…e in Python 2.7, but not in python 3 (?)
…exclude dissipative for now, only ChandrasekharDynamicalFriction) and that inputs to RZToplanarPotential are axisymmetric
…mmetric and raise error if not
…kharDynamicalFrictionForce
…ng tools, and general package updates [ci skip]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds dynamical friction using the Chandrasekhar dynamical-friction formula (with a few small recent tweaks to better agree with N-body simulations). As a dissipative force, dynamical friction is not specified by a potential and therefore did not fit into the regular
galpy.potential.Potential
framework. Therefore a new class hierarchy was constructed, withgalpy.potential.Force
being the top-level class from whichgalpy.potential.Potential
(for forces deriving from potentials) and a newgalpy.potential.DissipativeForce
(for dissipative forces) inherit. The newChandrasekharDynamicalFrictionForce
class inherits from thisDissipativeForce
.PR includes tests and extensive documentation. A single new line is untested, in
galpy.orbit
, because it is the fallback onto the non-symplectic, C-based integrator for dissipative forces. This fallback cannot currently be tested, because there is no support for dissipative forces in C.This PR also made the following changes:
galpy.df.jeans
with tools for dealing with the Jeans equations (used inChandrasekharDynamicalFrictionForce
for computing sigmar)galpy/potential_src/
andgalpy/potential.py
forgalpy.potential
functions in favor ofgalpy/potential/
andgalpy/potential/__init.py
.