def dvcircdR(Pot,R): """ NAME: dvcircdR PURPOSE: calculate the derivative of the circular velocity wrt R at R in potential Pot INPUT: Pot - Potential instance or list of such instances R - Galactocentric radius OUTPUT: derivative of the circular rotation velocity wrt R HISTORY: 2013-01-08 - Written - Bovy (IAS) """ from planarPotential import evaluateplanarRforces from planarPotential import evaluateplanarR2derivs tvc= vcirc(Pot,R) try: return 0.5*(-evaluateplanarRforces(R,Pot)+R*evaluateplanarR2derivs(R,Pot))/tvc except TypeError: from planarPotential import RZToplanarPotential Pot= RZToplanarPotential(Pot) return 0.5*(-evaluateplanarRforces(R,Pot)+R*evaluateplanarR2derivs(R,Pot))/tvc
def epifreq(Pot,R): """ NAME: epifreq PURPOSE: calculate the epicycle frequency at R in potential Pot INPUT: Pot - Potential instance or list of such instances R - Galactocentric radius OUTPUT: epicycle frequency HISTORY: 2011-10-09 - Written - Bovy (IAS) """ from planarPotential import evaluateplanarRforces, evaluateplanarR2derivs try: return nu.sqrt(evaluateplanarR2derivs(R,Pot)-3./R*evaluateplanarRforces(R,Pot)) except TypeError: from planarPotential import RZToplanarPotential Pot= RZToplanarPotential(Pot) return nu.sqrt(evaluateplanarR2derivs(R,Pot)-3./R*evaluateplanarRforces(R,Pot))
def epifreq(Pot,R): """ NAME: epifreq PURPOSE: calculate the epicycle frequency at R in the potential Pot INPUT: Pot - Potential instance or list thereof R - Galactocentric radius OUTPUT: epicycle frequency HISTORY: 2012-07-25 - Written - Bovy (IAS) """ from galpy.potential_src.planarPotential import planarPotential if isinstance(Pot,(Potential,planarPotential)): return Pot.epifreq(R) from planarPotential import evaluateplanarRforces, evaluateplanarR2derivs from Potential import PotentialError try: return nu.sqrt(evaluateplanarR2derivs(R,Pot)-3./R*evaluateplanarRforces(R,Pot)) except PotentialError: from planarPotential import RZToplanarPotential Pot= RZToplanarPotential(Pot) return nu.sqrt(evaluateplanarR2derivs(R,Pot)-3./R*evaluateplanarRforces(R,Pot))
def epifreq(Pot, R): """ NAME: epifreq PURPOSE: calculate the epicycle frequency at R in potential Pot INPUT: Pot - Potential instance or list of such instances R - Galactocentric radius OUTPUT: epicycle frequency HISTORY: 2011-10-09 - Written - Bovy (IAS) """ from planarPotential import evaluateplanarRforces, evaluateplanarR2derivs try: return nu.sqrt( evaluateplanarR2derivs(R, Pot) - 3. / R * evaluateplanarRforces(R, Pot)) except TypeError: from planarPotential import RZToplanarPotential Pot = RZToplanarPotential(Pot) return nu.sqrt( evaluateplanarR2derivs(R, Pot) - 3. / R * evaluateplanarRforces(R, Pot))