Fictitious forces in non-intertial frames¶
- class galpy.potential.NonInertialFrameForce(amp=1.0, Omega=None, Omegadot=None, x0=None, v0=None, a0=None, cinterp=True, cinterp_n=3000, ro=None, vo=None)[source]¶
Class that implements the fictitious forces present when integrating orbits in a non-intertial frame. Coordinates in the inertial frame \(\mathbf{x}\) and in the non-inertial frame \(\mathbf{r}\) are related through rotation and linear motion as
\[\mathbf{x} = \mathbf{R}\,\left(\mathbf{r} + \mathbf{x}_0\right)\]where \(\mathbf{R}\) is a rotation matrix and \(\mathbf{x}_0\) is the motion of the origin. The rotation matrix has angular frequencies \(\boldsymbol{\Omega}\) with time derivative \(\dot{\boldsymbol{\Omega}}\); \(\boldsymbol{\Omega}\) can be any function of time (note that the sign of \(\boldsymbol{\Omega}\) is such that \(\boldsymbol{\Omega}\) is the frequency of the rotating frame as seen from the inertial frame). The motion of the origin can also be any function of time. This leads to the fictitious force
\[\mathbf{F} = -\mathbf{a}_0 - \boldsymbol{\Omega} \times ( \boldsymbol{\Omega} \times \left[\mathbf{r} + \mathbf{x}_0\right]) - \dot{\boldsymbol{\Omega}} \times \left[\mathbf{r}+\mathbf{x}_0\right] -2\boldsymbol{\Omega}\times \left[\dot{\mathbf{r}}+\mathbf{v}_0\right]\]where \(\mathbf{a}_0\), \(\mathbf{v}_0\), and \(\mathbf{x}_0\) are the acceleration, velocity, and position of the origin of the non-inertial frame, respectively, as a function of time. Note that if the non-inertial frame is not rotating, it is not necessary to specify \(\mathbf{v}_0\) and \(\mathbf{x}_0\). In that case, the fictitious force is simply
\[\mathbf{F} = -\mathbf{a}_0\quad (\boldsymbol{\Omega} = 0)\]If the non-inertial frame only rotates without any motion of the origin, the fictitious force is the familiar combination of the centrifugal force and the Coriolis force (plus an additional term if \(\dot{\boldsymbol{\Omega}}\) is not constant)
\[\mathbf{F} = - \boldsymbol{\Omega} \times ( \boldsymbol{\Omega} \times \mathbf{r}) - \dot{\boldsymbol{\Omega}} \times \mathbf{r} -2\boldsymbol{\Omega}\times \dot{\mathbf{r}}\quad (\mathbf{a}_0=\mathbf{v}_0=\mathbf{x}_0=0)\]For fast orbit integration in C, by default (
cinterp=True) the time-dependent inputs are replaced by cubic-spline interpolations built over the integration’s time range (see thecinterpkeyword), so the provided functions only need to be evaluatedcinterp_ntimes when setting up the integration and are not called from C at every step. Alternatively, withcinterp=Falsethe functions are passed directly to the C code, which attempts to build fastnumbaversions of them; significant speed-ups then require that the provided functions can be turned intonopython=Truenumbafunctions (try runningnumba.njiton them and then evaluating them to check).- __init__(amp=1.0, Omega=None, Omegadot=None, x0=None, v0=None, a0=None, cinterp=True, cinterp_n=3000, ro=None, vo=None)[source]¶
Initialize a NonInertialFrameForce.
- Parameters:
amp (float, optional) – Amplitude to be applied to the potential (default: 1).
Omega (float or list of floats or Quantity or list of Quantities or callable or list of callables, optional) – Angular frequency of the rotation of the non-inertial frame as seen from an inertial one; can either be a function of time or a number (when the frequency is assumed to be Omega + Omegadot x t) and in each case can be a list [Omega_x,Omega_y,Omega_z] or a single value Omega_z (when not a function, can be a Quantity; when a function, need to take input time in internal units and output the frequency in internal units; see galpy.util.conversion.time_in_Gyr and galpy.util.conversion.freq_in_XXX conversion functions).
Omegadot (float or list of floats or Quantity or list of Quantities or callable or list of callables, optional) – Time derivative of the angular frequency of the non-intertial frame’s rotation. Must match the kind of Omega: a [list of] function[s] when Omega is one, or a number/list/Quantity when Omega is one (a mismatch raises an error). When a function, need to take input time in internal units and output the frequency derivative in internal units; see galpy.util.conversion.time_in_Gyr and galpy.util.conversion.freq_in_XXX conversion functions. If Omega is a function of time and Omegadot is omitted, Omegadot is derived as the time-derivative of Omega (a warning is issued); if Omega is constant and Omegadot is omitted, the frequency is taken to be constant in time.
x0 (list of callables, optional) – Position vector x_0 (cartesian) of the center of mass of the non-intertial frame (see definition in the class documentation); list of functions [x_0x,x_0y,x_0z]; only necessary when considering both rotation and center-of-mass acceleration of the inertial frame (functions need to take input time in internal units and output the position in internal units; see galpy.util.conversion.time_in_Gyr and divided physical positions by the ro parameter in kpc).
v0 (list of callables, optional) – Velocity vector v_0 (cartesian) of the center of mass of the non-intertial frame (see definition in the class documentation); list of functions [v_0x,v_0y,v_0z]; only necessary when considering both rotation and center-of-mass acceleration of the inertial frame (functions need to take input time in internal units and output the velocity in internal units; see galpy.util.conversion.time_in_Gyr and divided physical positions by the vo parameter in km/s).
a0 (float or list of callables, optional) – Acceleration vector a_0 (cartesian) of the center of mass of the non-intertial frame (see definition in the class documentation); constant or a list of functions [a_0x,a_0y, a_0z] (functions need to take input time in internal units and output the acceleration in internal units; see galpy.util.conversion.time_in_Gyr and galpy.util.conversion.force_in_XXX conversion functions [force is actually acceleration in galpy]).
cinterp (bool, optional) – If True (default), build cubic-spline interpolations of the time-dependent inputs (
a0,x0,v0,Omega, withOmegadottaken as the spline derivative ofOmega) over the integration’s time range and evaluate them in C, instead of calling the supplied functions from C at every integration step; this is typically much faster, especially when the inputs are notnumba-compatible. Only affects C orbit integration (the pure-Python integration always uses the exact functions) and is not supported for surface-of-section integration (usecinterp=False).cinterp_n (int, optional) – Number of grid points used for the C interpolation over the integration time range (default: 3000); only used when
cinterp=True.ro (float, optional) – Distance scale for translation into internal units (default from configuration file).
vo (float, optional) – Velocity scale for translation into internal units (default from configuration file).
Notes
2022-03-02 - Started - Bovy (UofT)
2022-03-26 - Generalized Omega to any function of time - Bovy (UofT)