Skip to content
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 47 commits into from
Jul 24, 2018
Merged

Add dynamical friction #346

merged 47 commits into from
Jul 24, 2018

Conversation

jobovy
Copy link
Owner

@jobovy jobovy commented Jul 24, 2018

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, with galpy.potential.Force being the top-level class from which galpy.potential.Potential (for forces deriving from potentials) and a new galpy.potential.DissipativeForce (for dissipative forces) inherit. The new ChandrasekharDynamicalFrictionForce class inherits from this DissipativeForce.

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:

  • Added galpy.df.jeans with tools for dealing with the Jeans equations (used in ChandrasekharDynamicalFrictionForce for computing sigmar)
  • Made galpy's directory structure more like a normal python package, that is, removing the structure that went like galpy/potential_src/ and galpy/potential.py forgalpy.potential functions in favor of galpy/potential/ and galpy/potential/__init.py.

jobovy added 30 commits March 27, 2018 17:43
…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)
… 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
jobovy added 17 commits July 20, 2018 14:09
…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
…exclude dissipative for now, only ChandrasekharDynamicalFriction) and that inputs to RZToplanarPotential are axisymmetric
…ng tools, and general package updates [ci skip]
@jobovy jobovy added this to the simple dynamical friction milestone Jul 24, 2018
@jobovy jobovy self-assigned this Jul 24, 2018
@jobovy jobovy merged commit c3a5cb4 into master Jul 24, 2018
@jobovy jobovy deleted the dynamfric-anothertry branch July 24, 2018 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant