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

Adds the 3MN potential of Smith et al. (2015) #232

Merged
merged 27 commits into from
Mar 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9c09177
start on adding the 3MN potential of Smith et al. (2015)
jobovy Feb 7, 2015
b63a62b
add equations from Tables 1 and 2
jobovy Feb 7, 2015
6ff157e
add equations from Figure 5
jobovy Feb 7, 2015
e0bd9e8
setup MN3 disk
jobovy Feb 7, 2015
4df45f9
fix posdens=False
jobovy Feb 7, 2015
746d250
fix setup and add evaluation of potential and forces
jobovy Feb 7, 2015
0eb8f17
add remaining potential methods
jobovy Feb 7, 2015
e960788
add scale parameter
jobovy Feb 7, 2015
4283955
add MN3 to top level
jobovy Feb 7, 2015
3648443
add 3MN to documentation API
jobovy Feb 7, 2015
13bff3c
special case MN3 potential for zmax test
jobovy Feb 7, 2015
714c3d7
raise warning when b/Rd is outside of the interpolation range and err…
jobovy Feb 9, 2015
c6971d9
glue MN3 to C
jobovy Feb 9, 2015
5ac0504
few more special tests
jobovy Feb 9, 2015
9d566df
add tests of MN3 inputs
jobovy Feb 9, 2015
333d4d3
normalize the special MN3 potentials
jobovy Feb 9, 2015
86b86bf
add test of hz conversion
jobovy Feb 9, 2015
6be9940
test of 3MN approximations
jobovy Feb 9, 2015
42c2043
add MN3 to changelog
jobovy Feb 9, 2015
1926f04
add nemo parameters for MN3ExponentialDiskPotential
jobovy Feb 9, 2015
9b8e8c0
test MN3ExponentialDiskPotential nemo_accname
jobovy Feb 9, 2015
5c6b9fe
test nemo_accpars
jobovy Feb 9, 2015
3a183ff
add explicit NEMO test for MN3ExponentialDiskPotential
jobovy Feb 10, 2015
a7476b9
add that MN3ExponentialDiskPotential works for nemo functions
jobovy Feb 10, 2015
69f4530
fix sech^2 docs
jobovy Feb 10, 2015
89d6fef
add a test of the approximation with sech=True
jobovy Feb 10, 2015
740f07f
Merge branch 'dev-v1.1' into mn3
jobovy Mar 24, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Current development version, last updated 12/26/2014:
subclass of interpRZPotential and can be used in the same way). This
code was mainly written by Rok Roskar.

- Added MN3ExponentialDiskPotential that gives the approximation to a
radially-exponential disk potential as three Miyamoto-Nagai disks
from Smith et al. (2015; arXiv:1502.00627v1)

- Add support for converting potential parameters to NEMO format and
units: nemo_accname and nemo_accpars (both instance and general
Potential method).
Expand Down
8 changes: 4 additions & 4 deletions doc/source/potential.rst
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,10 @@ LogarithmicHaloPotential, the radial force scales as :math:`R^{-1}`,
so the amplitude scales as :math:`V_0^2`.

Currently, only the ``MiyamotoNagaiPotential``, ``NFWPotential``,
``PowerSphericalPotentialwCutoff``, and the
``LogarithmicHaloPotential`` have this NEMO support. Combinations of
the first three are also supported (e.g., ``MWPotential2014``); they
can also be combined with spherical
``PowerSphericalPotentialwCutoff``, ``MN3ExponentialDiskPotential``,
and the ``LogarithmicHaloPotential`` have this NEMO
support. Combinations of the first three are also supported (e.g.,
``MWPotential2014``); they can also be combined with spherical
``LogarithmicHaloPotentials``. Because of the definition of the
logarithmic potential in NEMO, it cannot be flattened in ``z``, so to
use a flattened logarithmic potential, one has to flip ``y`` and ``z``
Expand Down
1 change: 1 addition & 0 deletions doc/source/reference/potential.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Specific potentials
potentialkepler.rst
potentialloghalo.rst
potentialmiyamoto.rst
potential3mn.rst
potentialmovingobj.rst
potentialnfw.rst
potentialpowerspher.rst
Expand Down
5 changes: 5 additions & 0 deletions doc/source/reference/potential3mn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Three Miyamoto-Nagai disk approximation to an exponential disk
================================================================

.. autoclass:: galpy.potential.MN3ExponentialDiskPotential
:members: __init__
10 changes: 10 additions & 0 deletions galpy/orbit_src/integrateFullOrbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ def _parse_pot(pot,potforactions=False):
elif isinstance(p,potential.PowerSphericalPotentialwCutoff):
pot_type.append(15)
pot_args.extend([p._amp,p.alpha,p.rc])
elif isinstance(p,potential.MN3ExponentialDiskPotential):
# Three Miyamoto-Nagai disks
npot+= 2
pot_type.extend([5,5,5])
pot_args.extend([p._amp*p._mn3[0]._amp,
p._mn3[0]._a,p._mn3[0]._b,
p._amp*p._mn3[1]._amp,
p._mn3[1]._a,p._mn3[1]._b,
p._amp*p._mn3[2]._amp,
p._mn3[2]._a,p._mn3[2]._b])
pot_type= nu.array(pot_type,dtype=nu.int32,order='C')
pot_args= nu.array(pot_args,dtype=nu.float64,order='C')
return (npot,pot_type,pot_args)
Expand Down
11 changes: 11 additions & 0 deletions galpy/orbit_src/integratePlanarOrbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ def _parse_pot(pot):
and isinstance(p._RZPot,potential.PowerSphericalPotentialwCutoff):
pot_type.append(15)
pot_args.extend([p._RZPot._amp,p._RZPot.alpha,p._RZPot.rc])
elif isinstance(p,potential_src.planarPotential.planarPotentialFromRZPotential) \
and isinstance(p._RZPot,potential.MN3ExponentialDiskPotential):
# Three Miyamoto-Nagai disks
npot+= 2
pot_type.extend([5,5,5])
pot_args.extend([p._RZPot._amp*p._RZPot._mn3[0]._amp,
p._RZPot._mn3[0]._a,p._RZPot._mn3[0]._b,
p._RZPot._amp*p._RZPot._mn3[1]._amp,
p._RZPot._mn3[1]._a,p._RZPot._mn3[1]._b,
p._RZPot._amp*p._RZPot._mn3[2]._amp,
p._RZPot._mn3[2]._a,p._RZPot._mn3[2]._b])
pot_type= nu.array(pot_type,dtype=nu.int32,order='C')
pot_args= nu.array(pot_args,dtype=nu.float64,order='C')
return (npot,pot_type,pot_args)
Expand Down
2 changes: 2 additions & 0 deletions galpy/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from galpy.potential_src import FlattenedPowerPotential
from galpy.potential_src import SnapshotRZPotential
from galpy.potential_src import BurkertPotential
from galpy.potential_src import MN3ExponentialDiskPotential
#
# Functions
#
Expand Down Expand Up @@ -97,6 +98,7 @@
InterpSnapshotRZPotential = SnapshotRZPotential.InterpSnapshotRZPotential
SnapshotRZPotential = SnapshotRZPotential.SnapshotRZPotential
BurkertPotential= BurkertPotential.BurkertPotential
MN3ExponentialDiskPotential= MN3ExponentialDiskPotential.MN3ExponentialDiskPotential
#Softenings
PlummerSoftening= ForceSoftening.PlummerSoftening

Expand Down
Loading