def __init__(self, amp=1.0, phib=25.0 * _degtorad, p=1.0, twophio=0.01, tform=None, tsteady=None, cp=None, sp=None):
        """
        NAME:

           __init__

        PURPOSE:

           initialize an Elliptical disk potential

           phi(R,phi) = phio (R/Ro)^p cos[2(phi-phib)]

        INPUT:

           amp=  amplitude to be applied to the potential (default:
           1.), see twophio below

           tform= start of growth (to smoothly grow this potential

           tsteady= time delay at which the perturbation is fully grown (default: 2.)

           p= power-law index of the phi(R) = (R/Ro)^p part

           Either:
           
              a) phib= angle (in rad; default=25 degree)

                 twophio= potential perturbation (in terms of 2phio/vo^2 if vo=1 at Ro=1)
                 
              b) cp, sp= twophio * cos(2phib), twophio * sin(2phib)

        OUTPUT:

           (none)

        HISTORY:

           2011-10-19 - Started - Bovy (IAS)

        """
        planarPotential.__init__(self, amp=amp)
        self.hasC = True
        if cp is None or sp is None:
            self._phib = phib
            self._twophio = twophio
        else:
            self._twophio = m.sqrt(cp * cp + sp * sp)
            self._phib = m.atan2(sp, cp) / 2.0
        self._p = p
        if not tform is None:
            self._tform = tform
        else:
            self._tform = None
        if not tsteady is None:
            self._tsteady = self._tform + tsteady
        else:
            if self._tform is None:
                self._tsteady = None
            else:
                self._tsteady = self._tform + 2.0
    def __init__(self,amp=1.,omegas=0.65,A=-0.035,
                 alpha=-7.,m=2,gamma=math.pi/4.,p=None,
                 sigma=1.,to=0.):
        """
        NAME:

           __init__

        PURPOSE:

           initialize a transient logarithmic spiral potential localized 
           around to

        INPUT:

           amp - amplitude to be applied to the potential (default:
           1., A below)

           gamma - angle between sun-GC line and the line connecting the 
                  peak of the spiral pattern at the Solar radius 
                  (in rad; default=45 degree)
        
           A - force amplitude (alpha*potential-amplitude; default=0.035)

           omegas= - pattern speed (default=0.65)

           m= number of arms
           
           to= time at which the spiral peaks

           sigma= "spiral duration" (sigma in Gaussian amplitude)
           
           Either provide:

              a) alpha=
               
              b) p= pitch angle (rad)
              
        OUTPUT:

           (none)

        HISTORY:

           2011-03-27 - Started - Bovy (NYU)

        """
        planarPotential.__init__(self,amp=amp)
        self._omegas= omegas
        self._A= A
        self._m= m
        self._gamma= gamma
        self._to= to
        self._sigma2= sigma**2.
        if not p is None:
            self._alpha= self._m/math.tan(p)
        else:
            self._alpha= alpha
        self.hasC= True
    def __init__(self,amp=1.,phib=25.*_degtorad,
                 p=1.,phio=0.01,m=1.,
                 tform=None,tsteady=None,
                 cp=None,sp=None):
        """
        NAME:

           __init__

        PURPOSE:

           initialize an cosmphi disk potential

           phi(R,phi) = phio (R/Ro)^p cos[m(phi-phib)]

        INPUT:

           amp=  amplitude to be applied to the potential (default:
           1.), see twophio below

           tform= start of growth (to smoothly grow this potential

           tsteady= time delay at which the perturbation is fully grown (default: 2.)

           m= cos( m * (phi - phib) )

           p= power-law index of the phi(R) = (R/Ro)^p part

           Either:
           
              a) phib= angle (in rad; default=25 degree)

                 phio= potential perturbation (in terms of phio/vo^2 if vo=1 at Ro=1)
                 
              b) cp, sp= m * phio * cos(m * phib), m * phio * sin(m * phib)

        OUTPUT:

           (none)

        HISTORY:

           2011-10-27 - Started - Bovy (IAS)

        """
        planarPotential.__init__(self,amp=amp)
        self.hasC= False
        self._m= m
        if cp is None or sp is None:
            self._phib= phib
            self._mphio= phio*self._m
        else:
            self._mphio= math.sqrt(cp*cp+sp*sp)
            self._phib= math.atan(sp/cp)/self._m
            if m < 2. and cp < 0.:
                self._phib= math.pi+self._phib
        self._p= p
        if not tform is None:
            self._tform= tform
        else:
            self._tform= None
        if not tsteady is None:
            self._tsteady= self._tform+tsteady
        else:
            if self._tform is None: self._tsteady= None
            else: self._tsteady= self._tform+2.
    def __init__(self,amp=1.,omegas=0.65,A=-0.035,
                 alpha=-7.,m=2,gamma=math.pi/4.,p=None,
                 tform=None,tsteady=None):
        """
        NAME:

           __init__

        PURPOSE:

           initialize a logarithmic spiral potential

        INPUT:

           amp - amplitude to be applied to the potential (default:
           1., A below)

           gamma - angle between sun-GC line and the line connecting the peak of the spiral pattern at the Solar radius (in rad; default=45 degree)
        
           A - force amplitude (alpha*potential-amplitude; default=0.035)

           omegas= - pattern speed (default=0.65)

           m= number of arms
           
           Either provide:

              a) alpha=
               
              b) p= pitch angle (rad)
              
           tform - start of spiral growth / spiral period (default: -Infinity)

           tsteady - time from tform at which the spiral is fully grown / spiral period (default: tform+2 periods)

        OUTPUT:

           (none)

        HISTORY:

           2011-03-27 - Started - Bovy (NYU)

        """
        planarPotential.__init__(self,amp=amp)
        self._omegas= omegas
        self._A= A
        self._m= m
        self._gamma= gamma
        if not p is None:
            self._alpha= self._m/math.tan(p)
        else:
            self._alpha= alpha
        self._ts= 2.*math.pi/self._omegas
        if not tform is None:
            self._tform= tform*self._ts
        else:
            self._tform= None
        if not tsteady is None:
            self._tsteady= self._tform+tsteady*self._ts
        else:
            if self._tform is None: self._tsteady= None
            else: self._tsteady= self._tform+2.*self._ts
        self.hasC= True
Exemple #5
0
    def __init__(self,
                 amp=1.,
                 omegas=0.65,
                 A=-0.035,
                 alpha=-7.,
                 m=2,
                 gamma=math.pi / 4.,
                 p=None,
                 tform=None,
                 tsteady=None):
        """
        NAME:

           __init__

        PURPOSE:

           initialize a logarithmic spiral potential

        INPUT:

           amp - amplitude to be applied to the potential (default:
           1., A below)

           gamma - angle between sun-GC line and the line connecting the 
                  peak of the spiral pattern at the Solar radius 
                  (in rad; default=45 degree)
        
           A - force amplitude (alpha*potential-amplitude; default=0.035)

           omegas= - pattern speed (default=0.65)

           m= number of arms
           
           Either provide:

              a) alpha=
               
              b) p= pitch angle (rad)
              
           tform - start of spiral growth / spiral period (default: -Infinity)

           tsteady - time from tform at which the spiral is fully grown 
                     / spiral period (default: tform+2 periods)

        OUTPUT:

           (none)

        HISTORY:

           2011-03-27 - Started - Bovy (NYU)

        """
        planarPotential.__init__(self, amp=amp)
        self._omegas = omegas
        self._A = A
        self._m = m
        self._gamma = gamma
        if not p is None:
            self._alpha = self._m / math.tan(p)
        else:
            self._alpha = alpha
        self._ts = 2. * math.pi / self._omegas
        if not tform is None:
            self._tform = tform * self._ts
        else:
            self._tform = None
        if not tsteady is None:
            self._tsteady = self._tform + tsteady * self._ts
        else:
            if self._tform is None: self._tsteady = None
            else: self._tsteady = self._tform + 2. * self._ts
        self.hasC = True
Exemple #6
0
    def __init__(self,amp=1.,omegab=None,rb=None,chi=0.8,
                 rolr=0.9,barphi=25.*_degtorad,
                 tform=-4.,tsteady=None,beta=0.,
                 alpha=0.01,Af=None):
        """
        NAME:

           __init__

        PURPOSE:

           initialize a Dehnen bar potential

        INPUT:

           amp - amplitude to be applied to the potential (default:
           1., see alpha or Ab below)

           barphi - angle between sun-GC line and the bar's major axis
           (in rad; default=25 degree)

           tform - start of bar growth / bar period (default: -4)

           tsteady - time at which the bar is fully grown / bar period
           (default: tform/2)

           Either provide:

              a) rolr - radius of the Outer Lindblad Resonance for a
                 circular orbit
              
                 chi - fraction R_bar / R_CR (corotation radius of bar)

                 alpha - relative bar strength (default: 0.01)

                 beta - power law index of rotation curve (to
                 calculate OLR, etc.)
               
              b) omegab - rotation speed of the bar
              
                 rb - bar radius
                 
                 Af - bar strength
              
        OUTPUT:

           (none)

        HISTORY:

           2010-11-24 - Started - Bovy (NYU)

        """
        planarPotential.__init__(self,amp=amp)
        self.hasC= True
        self._barphi= barphi
        if omegab is None:
            self._rolr= rolr
            self._chi= chi
            self._beta= beta
            #Calculate omegab and rb
            self._omegab= 1./((self._rolr**(1.-self._beta))/(1.+m.sqrt((1.+self._beta)/2.)))
            self._rb= self._chi*self._omegab**(1./(self._beta-1.))
            self._alpha= alpha
            self._af= self._alpha/3./self._rb**3.
        else:
            self._omegab= omegab
            self._rb= rb
            self._af= Af
        self._tb= 2.*m.pi/self._omegab
        self._tform= tform*self._tb
        if tsteady is None:
            self._tsteady= self._tform/2.
        else:
            self._tsteady= tsteady*self._tb
Exemple #7
0
    def __init__(self,amp=1.,phib=25.*_degtorad,
                 p=0.,twophio=0.01,
                 tform=None,tsteady=None,
                 cp=None,sp=None):
        """
        NAME:

           __init__

        PURPOSE:

           initialize an Elliptical disk potential

           phi(R,phi) = phio (R/Ro)^p cos[2(phi-phib)]

        INPUT:

           amp=  amplitude to be applied to the potential (default:
           1.), see twophio below

           tform= start of growth (to smoothly grow this potential

           tsteady= time delay at which the perturbation is fully grown (default: 2.)

           p= power-law index of the phi(R) = (R/Ro)^p part

           Either:
           
              a) phib= angle (in rad; default=25 degree)

                 twophio= potential perturbation (in terms of 2phio/vo^2 if vo=1 at Ro=1)
                 
              b) cp, sp= twophio * cos(2phib), twophio * sin(2phib)

        OUTPUT:

           (none)

        HISTORY:

           2011-10-19 - Started - Bovy (IAS)

        """
        planarPotential.__init__(self,amp=amp)
        self.hasC= True
        if cp is None or sp is None:
            self._phib= phib
            self._twophio= twophio
        else:
            self._twophio= m.sqrt(cp*cp+sp*sp)
            self._phib= m.atan(sp/cp)/2.
        self._p= p
        if not tform is None:
            self._tform= tform
        else:
            self._tform= None
        if not tsteady is None:
            self._tsteady= self._tform+tsteady
        else:
            if self._tform is None: self._tsteady= None
            else: self._tsteady= self._tform+2.
    def __init__(self,
                 amp=1.,
                 omegas=0.65,
                 A=-0.035,
                 alpha=-7.,
                 m=2,
                 gamma=math.pi / 4.,
                 p=None,
                 sigma=1.,
                 to=0.):
        """
        NAME:

           __init__

        PURPOSE:

           initialize a transient logarithmic spiral potential localized 
           around to

        INPUT:

           amp - amplitude to be applied to the potential (default:
           1., A below)

           gamma - angle between sun-GC line and the line connecting the 
                  peak of the spiral pattern at the Solar radius 
                  (in rad; default=45 degree)
        
           A - force amplitude (alpha*potential-amplitude; default=0.035)

           omegas= - pattern speed (default=0.65)

           m= number of arms
           
           to= time at which the spiral peaks

           sigma= "spiral duration" (sigma in Gaussian amplitude)
           
           Either provide:

              a) alpha=
               
              b) p= pitch angle (rad)
              
        OUTPUT:

           (none)

        HISTORY:

           2011-03-27 - Started - Bovy (NYU)

        """
        planarPotential.__init__(self, amp=amp)
        self._omegas = omegas
        self._A = A
        self._m = m
        self._gamma = gamma
        self._to = to
        self._sigma2 = sigma**2.
        if not p is None:
            self._alpha = self._m / math.tan(p)
        else:
            self._alpha = alpha
        self.hasC = True