.. _potential-api: Potential (``galpy.potential``) =============================== 3D potentials ------------- General instance routines +++++++++++++++++++++++++ Use as ``Potential-instance.method(...)`` .. toctree:: :maxdepth: 1 __add__ __mul__ __call__ dens dvcircdR epifreq flattening LcE lindbladR mass nemo_accname nemo_accpars omegac phitorque phizderiv phi2deriv plot plotDensity plotEscapecurve plotRotcurve plotSurfaceDensity R2deriv r2deriv rE Rzderiv Rforce rforce rhalf rl Rphideriv rtide surfdens tdyn toPlanar toVertical ttensor turn_physical_off turn_physical_on vcirc verticalfreq vesc vterm z2deriv zforce zvc zvc_range In addition to these, the ``NFWPotential`` also has methods to calculate virial quantities .. toctree:: :maxdepth: 1 conc mvir rmax rvir vmax General 3D potential routines +++++++++++++++++++++++++++++ Use as ``method(...)`` .. toctree:: :maxdepth: 1 dvcircdR epifreq evaluateDensities evaluatephitorques evaluatePotentials evaluatephizderivs evaluatephi2derivs evaluateRphiderivs evaluateR2derivs evaluater2derivs evaluateRzderivs evaluateRforces evaluaterforces evaluateSurfaceDensities evaluatez2derivs evaluatezforces flatten flattening LcE lindbladR mass nemo_accname nemo_accpars omegac plotDensities plotEscapecurve plotPotentials plotRotcurve plotSurfaceDensities rE rhalf rl rtide tdyn to_amuse ttensor turn_physical_off turn_physical_on vcirc verticalfreq vesc vterm zvc zvc_range In addition to these, the following methods are available to compute expansion coefficients for the ``SCFPotential`` class for a given density .. toctree:: :maxdepth: 1 scf_compute_coeffs scf_compute_coeffs_axi scf_compute_coeffs_axi_nbody scf_compute_coeffs_nbody scf_compute_coeffs_spherical scf_compute_coeffs_spherical_nbody Specific potentials +++++++++++++++++++ All of the following potentials can also be modified by the specific ``WrapperPotentials`` listed :ref:`below `. Spherical potentials ******************** Spherical potentials in ``galpy`` can be implemented in two ways: a) directly by inheriting from ``Potential`` and implementing the usual methods (``_evaluate``, ``_Rforce``, etc.) or b) by inheriting from the general :ref:`SphericalPotential ` class and implementing the functions ``_revaluate(self,r,t=0.)``, ``_rforce(self,r,t=0.)``, ``_r2deriv(self,r,t=0.)``, and ``_rdens(self,r,t=0.)`` that evaluate the potential, radial force, (minus the) radial force derivative, and density as a function of the (here natural) spherical radius. For adding a C implementation when using method b), follow similar steps in C (use ``interpSphericalPotential`` as an example to follow). For historical reasons, most spherical potentials in ``galpy`` are directly implemented (option a above), but for new spherical potentials it is typically easier to follow option b). Additional spherical potentials can be obtained by setting the axis ratios equal for the triaxial potentials listed in the section on ellipsoidal triaxial potentials below. .. toctree:: :maxdepth: 1 potentialanyspherical.rst potentialburkert.rst potentialdoublepowerspher.rst potentialcoredehnen.rst potentialdehnen.rst potentialeinasto.rst potentialexptruncnfw.rst potentialhernquist.rst potentialhomogsphere.rst potentialinterpsphere.rst potentialisochrone.rst potentialjaffe.rst potentialkepler.rst potentialking.rst potentialnfw.rst potentialplummer.rst potentialpowerspher.rst potentialpowerspherwcut.rst potentialpseudoiso.rst potentialsphericalshell.rst Axisymmetric potentials *********************** Additional axisymmetric potentials can be obtained by setting the x/y axis ratio equal to 1 for the triaxial potentials listed in the section on ellipsoidal triaxial potentials below. .. toctree:: :maxdepth: 1 potentialanyaxirazorthin.rst potentialdoubleexp.rst potentialflattenedpower.rst potentialinterprz.rst potentialinterpsnapshotrzpotential.rst potentialkuzmindisk.rst potentialkuzminkutuzov.rst potentialloghalo.rst potentialmiyamoto.rst potential3mn.rst potentialrazorexp.rst potentialring.rst potentialsnapshotrzpotential.rst Ellipsoidal triaxial potentials ******************************* ``galpy`` has very general support for implementing triaxial (or the oblate and prolate special cases) of ellipsoidal potentials through the general :ref:`EllipsoidalPotential ` class. These potentials have densities that are uniform on ellipsoids, thus only functions of :math:`m^2 = x^2 + \frac{y^2}{b^2}+\frac{z^2}{c^2}`. New potentials of this type can be implemented by inheriting from this class and implementing the ``_mdens(self,m)``, ``_psi(self,m)``, and ``_mdens_deriv`` functions for the density, its integral with respect to :math:`m^2`, and its derivative with respect to m, respectively. For adding a C implementation, follow similar steps (use ``PerfectEllipsoidPotential`` as an example to follow). .. toctree:: :maxdepth: 1 potentialdoublepowertriaxial.rst potentialperfectellipsoid.rst potentialpowertriax.rst potentialtriaxialgaussian.rst potentialtriaxialjaffe.rst potentialtriaxialhernquist.rst potentialtriaxialnfw.rst Note that the Ferrers potential listed below is a potential of this type, but it is currently not implemented using the ``EllipsoidalPotential`` class. Further note that these potentials can all be rotated in 3D using the ``zvec`` and ``pa`` keywords; however, more general support for the same behavior is available through the ``RotateAndTiltWrapperPotential`` discussed below and the internal ``zvec``/``pa`` keywords will likely be deprecated in a future version. Spiral, bar, other triaxial, and miscellaneous potentials ********************************************************** .. toctree:: :maxdepth: 1 potentialdehnenbar.rst potentialferrers.rst potentialloghalo.rst potentialmovingobj.rst potentialnull.rst potentialsoftenedneedle.rst potentialspiralarms.rst All ``galpy`` potentials can also be made to rotate using the ``SolidBodyRotationWrapperPotential`` listed in the section on wrapper potentials :ref:`below `. General Poisson solvers for disks and halos ******************************************* .. toctree:: :maxdepth: 1 potentialdiskmultipole.rst potentialmultipole.rst potentialdiskscf.rst potentialscf.rst Dissipative forces ******************* .. toctree:: :maxdepth: 1 potentialfdmdynfric.rst potentialchandrasekhardynfric.rst Fictitious forces in non-inertial frames **************************************** .. toctree:: :maxdepth: 1 potentialnoninertialframe.rst Helper classes ************** .. toctree:: :maxdepth: 1 potentialnumericalpotentialderivsmixin.rst 2D potentials ------------- General instance routines +++++++++++++++++++++++++ Use as ``Potential-instance.method(...)`` .. toctree:: :maxdepth: 1 __add__ __mul__ __call__ phitorque Rforce turn_physical_off turn_physical_on General axisymmetric potential instance routines ++++++++++++++++++++++++++++++++++++++++++++++++ Use as ``Potential-instance.method(...)`` .. toctree:: :maxdepth: 1 epifreq lindbladR omegac plot plotEscapecurve plotRotcurve vcirc vesc General 2D potential routines +++++++++++++++++++++++++++++ Use as ``method(...)`` .. toctree:: :maxdepth: 1 evaluateplanarphitorques evaluateplanarPotentials evaluateplanarRforces evaluateplanarR2derivs flatten LinShuReductionFactor plotEscapecurve plotplanarPotentials plotRotcurve turn_physical_off turn_physical_on Specific potentials +++++++++++++++++++ All of the 3D potentials above can be used as two-dimensional potentials in the mid-plane. .. toctree:: :maxdepth: 1 toPlanarPotential (general) RZToplanarPotential In addition, a two-dimensional bar potential, two spiral potentials, the `Henon & Heiles (1964) `__ potential, and some static non-axisymmetric perturbations are included .. toctree:: :maxdepth: 1 potentialdehnenbar.rst potentialcosmphidisk.rst potentialellipticaldisk.rst potentialhenonheiles.rst potentiallopsideddisk.rst potentialsteadylogspiral.rst potentialtransientlogspiral.rst 1D potentials ------------- General instance routines +++++++++++++++++++++++++ Use as ``Potential-instance.method(...)`` .. toctree:: :maxdepth: 1 __add__ __mul__ __call__ force plot turn_physical_off turn_physical_on General 1D potential routines +++++++++++++++++++++++++++++ Use as ``method(...)`` .. toctree:: :maxdepth: 1 evaluatelinearForces evaluatelinearPotentials flatten plotlinearPotentials turn_physical_off turn_physical_on Specific potentials +++++++++++++++++++ .. toctree:: :maxdepth: 1 IsothermalDiskPotential KGPotential One-dimensional potentials can also be derived from 3D axisymmetric potentials as the vertical potential at a certain Galactocentric radius .. toctree:: :maxdepth: 1 toVerticalPotential (general) RZToverticalPotential .. _potwrapperapi: Potential wrappers ------------------- Gravitational potentials in ``galpy`` can also be modified using wrappers, for example, to change their amplitude as a function of time. These wrappers can be applied to *any* ``galpy`` potential (although whether they can be used in C depends on whether the wrapper *and* all of the potentials that it wraps are implemented in C). Multiple wrappers can be applied to the same potential. Specific wrappers ++++++++++++++++++ .. toctree:: :maxdepth: 1 potentialadiabaticcontractwrapper.rst potentialtimedependentamplitude.rst potentialcorotwrapper.rst potentialcylindricallyseparablewrapper.rst potentialdehnensmoothwrapper.rst potentialgaussampwrapper.rst potentialkuzminlikewrapper.rst potentialoblatestaeckelwrapper.rst potentialsolidbodyrotationwrapper.rst potentialrotateandtiltwrapper.rst