diff --git a/docs/source/_autosummary/kerrgeopy.bound_orbit.BoundOrbit.rst b/docs/source/_autosummary/kerrgeopy.bound_orbit.BoundOrbit.rst deleted file mode 100644 index a50bf40..0000000 --- a/docs/source/_autosummary/kerrgeopy.bound_orbit.BoundOrbit.rst +++ /dev/null @@ -1,32 +0,0 @@ -BoundOrbit -========== - -.. currentmodule:: kerrgeopy.bound_orbit - -.. autoclass:: BoundOrbit - :members: - :show-inheritance: - :inherited-members: - - - .. automethod:: __init__ - - - .. rubric:: Methods - - .. autosummary:: - - ~BoundOrbit.__init__ - ~BoundOrbit.animate - ~BoundOrbit.constants_of_motion - ~BoundOrbit.is_visible - ~BoundOrbit.mino_frequencies - ~BoundOrbit.observer_frequencies - ~BoundOrbit.plot - ~BoundOrbit.trajectory - - - - - - \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.constants.rst b/docs/source/_autosummary/kerrgeopy.constants.rst index 9faa5c9..24b1e70 100644 --- a/docs/source/_autosummary/kerrgeopy.constants.rst +++ b/docs/source/_autosummary/kerrgeopy.constants.rst @@ -1,4 +1,4 @@ -constants +constants ========= .. automodule:: kerrgeopy.constants diff --git a/docs/source/_autosummary/kerrgeopy.frequencies.fundamental_frequencies.rst b/docs/source/_autosummary/kerrgeopy.frequencies.fundamental_frequencies.rst new file mode 100644 index 0000000..fd7fa95 --- /dev/null +++ b/docs/source/_autosummary/kerrgeopy.frequencies.fundamental_frequencies.rst @@ -0,0 +1,6 @@ +fundamental\_frequencies +======================== + +.. currentmodule:: kerrgeopy.frequencies + +.. autofunction:: fundamental_frequencies \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies.observer_frequencies.rst b/docs/source/_autosummary/kerrgeopy.frequencies.observer_frequencies.rst deleted file mode 100644 index c28949f..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies.observer_frequencies.rst +++ /dev/null @@ -1,6 +0,0 @@ -observer\_frequencies -===================== - -.. currentmodule:: kerrgeopy.frequencies - -.. autofunction:: observer_frequencies \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies.rst b/docs/source/_autosummary/kerrgeopy.frequencies.rst index 0bc2705..9dc4a02 100644 --- a/docs/source/_autosummary/kerrgeopy.frequencies.rst +++ b/docs/source/_autosummary/kerrgeopy.frequencies.rst @@ -1,4 +1,4 @@ -frequencies +frequencies =========== .. automodule:: kerrgeopy.frequencies @@ -15,9 +15,9 @@ frequencies :toctree: :template: custom-base-template.rst + fundamental_frequencies gamma mino_frequencies - observer_frequencies phi_frequency r_frequency theta_frequency diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.gamma_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.gamma_from_constants.rst deleted file mode 100644 index 52d9081..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.gamma_from_constants.rst +++ /dev/null @@ -1,6 +0,0 @@ -gamma\_from\_constants -====================== - -.. currentmodule:: kerrgeopy.frequencies_from_constants - -.. autofunction:: gamma_from_constants \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.mino_frequencies_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.mino_frequencies_from_constants.rst deleted file mode 100644 index 25f1ad1..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.mino_frequencies_from_constants.rst +++ /dev/null @@ -1,6 +0,0 @@ -mino\_frequencies\_from\_constants -================================== - -.. currentmodule:: kerrgeopy.frequencies_from_constants - -.. autofunction:: mino_frequencies_from_constants \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.observer_frequencies_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.observer_frequencies_from_constants.rst deleted file mode 100644 index f113939..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.observer_frequencies_from_constants.rst +++ /dev/null @@ -1,6 +0,0 @@ -observer\_frequencies\_from\_constants -====================================== - -.. currentmodule:: kerrgeopy.frequencies_from_constants - -.. autofunction:: observer_frequencies_from_constants \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.phi_frequency_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.phi_frequency_from_constants.rst deleted file mode 100644 index 735efb6..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.phi_frequency_from_constants.rst +++ /dev/null @@ -1,6 +0,0 @@ -phi\_frequency\_from\_constants -=============================== - -.. currentmodule:: kerrgeopy.frequencies_from_constants - -.. autofunction:: phi_frequency_from_constants \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.r_frequency_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.r_frequency_from_constants.rst deleted file mode 100644 index 33b5f76..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.r_frequency_from_constants.rst +++ /dev/null @@ -1,6 +0,0 @@ -r\_frequency\_from\_constants -============================= - -.. currentmodule:: kerrgeopy.frequencies_from_constants - -.. autofunction:: r_frequency_from_constants \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.rst index 9607512..769a55e 100644 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.rst +++ b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.rst @@ -1,4 +1,4 @@ -frequencies\_from\_constants +frequencies\_from\_constants ============================ .. automodule:: kerrgeopy.frequencies_from_constants @@ -9,19 +9,6 @@ frequencies\_from\_constants - .. rubric:: Functions - - .. autosummary:: - :toctree: - :template: custom-base-template.rst - - gamma_from_constants - mino_frequencies_from_constants - observer_frequencies_from_constants - phi_frequency_from_constants - r_frequency_from_constants - theta_frequency_from_constants - diff --git a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.theta_frequency_from_constants.rst b/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.theta_frequency_from_constants.rst deleted file mode 100644 index ec0f59b..0000000 --- a/docs/source/_autosummary/kerrgeopy.frequencies_from_constants.theta_frequency_from_constants.rst +++ /dev/null @@ -1,6 +0,0 @@ -theta\_frequency\_from\_constants -================================= - -.. currentmodule:: kerrgeopy.frequencies_from_constants - -.. autofunction:: theta_frequency_from_constants \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.orbit.rst b/docs/source/_autosummary/kerrgeopy.orbit.rst index 1e46e86..7a11cdb 100644 --- a/docs/source/_autosummary/kerrgeopy.orbit.rst +++ b/docs/source/_autosummary/kerrgeopy.orbit.rst @@ -1,4 +1,4 @@ -orbit +orbit ===== .. automodule:: kerrgeopy.orbit diff --git a/docs/source/_autosummary/kerrgeopy.plunging_orbit.rst b/docs/source/_autosummary/kerrgeopy.plunging_orbit.rst index b84902a..4fb1c2d 100644 --- a/docs/source/_autosummary/kerrgeopy.plunging_orbit.rst +++ b/docs/source/_autosummary/kerrgeopy.plunging_orbit.rst @@ -1,4 +1,4 @@ -plunging\_orbit +plunging\_orbit =============== .. automodule:: kerrgeopy.plunging_orbit diff --git a/docs/source/_autosummary/kerrgeopy.plunging_solutions.rst b/docs/source/_autosummary/kerrgeopy.plunging_solutions.rst index c7fb6bb..bf400f1 100644 --- a/docs/source/_autosummary/kerrgeopy.plunging_solutions.rst +++ b/docs/source/_autosummary/kerrgeopy.plunging_solutions.rst @@ -1,4 +1,4 @@ -plunging\_solutions +plunging\_solutions =================== .. automodule:: kerrgeopy.plunging_solutions diff --git a/docs/source/_autosummary/kerrgeopy.rst b/docs/source/_autosummary/kerrgeopy.rst index e789a56..ad8febc 100644 --- a/docs/source/_autosummary/kerrgeopy.rst +++ b/docs/source/_autosummary/kerrgeopy.rst @@ -28,8 +28,6 @@ :template: custom-module-template.rst :recursive: - ~kerrgeopy.bound_orbit - ~kerrgeopy.bound_solutions ~kerrgeopy.constants ~kerrgeopy.frequencies ~kerrgeopy.frequencies_from_constants @@ -37,5 +35,7 @@ ~kerrgeopy.plunging_orbit ~kerrgeopy.plunging_solutions ~kerrgeopy.spacetime + ~kerrgeopy.stable_orbit + ~kerrgeopy.stable_solutions ~kerrgeopy.units diff --git a/docs/source/_autosummary/kerrgeopy.spacetime.rst b/docs/source/_autosummary/kerrgeopy.spacetime.rst index 9dc3b64..f544feb 100644 --- a/docs/source/_autosummary/kerrgeopy.spacetime.rst +++ b/docs/source/_autosummary/kerrgeopy.spacetime.rst @@ -1,4 +1,4 @@ -spacetime +spacetime ========= .. automodule:: kerrgeopy.spacetime diff --git a/docs/source/_autosummary/kerrgeopy.stable_orbit.StableOrbit.rst b/docs/source/_autosummary/kerrgeopy.stable_orbit.StableOrbit.rst new file mode 100644 index 0000000..38393b2 --- /dev/null +++ b/docs/source/_autosummary/kerrgeopy.stable_orbit.StableOrbit.rst @@ -0,0 +1,32 @@ +StableOrbit +=========== + +.. currentmodule:: kerrgeopy.stable_orbit + +.. autoclass:: StableOrbit + :members: + :show-inheritance: + :inherited-members: + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~StableOrbit.__init__ + ~StableOrbit.animate + ~StableOrbit.constants_of_motion + ~StableOrbit.fundamental_frequencies + ~StableOrbit.is_visible + ~StableOrbit.mino_frequencies + ~StableOrbit.plot + ~StableOrbit.trajectory + + + + + + \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.bound_orbit.rst b/docs/source/_autosummary/kerrgeopy.stable_orbit.rst similarity index 65% rename from docs/source/_autosummary/kerrgeopy.bound_orbit.rst rename to docs/source/_autosummary/kerrgeopy.stable_orbit.rst index 13e2166..887e148 100644 --- a/docs/source/_autosummary/kerrgeopy.bound_orbit.rst +++ b/docs/source/_autosummary/kerrgeopy.stable_orbit.rst @@ -1,7 +1,7 @@ -bound\_orbit -============ +stable\_orbit +============= -.. automodule:: kerrgeopy.bound_orbit +.. automodule:: kerrgeopy.stable_orbit @@ -19,7 +19,7 @@ bound\_orbit :toctree: :template: custom-class-template.rst - BoundOrbit + StableOrbit diff --git a/docs/source/_autosummary/kerrgeopy.bound_solutions.polar_solutions.rst b/docs/source/_autosummary/kerrgeopy.stable_solutions.polar_solutions.rst similarity index 60% rename from docs/source/_autosummary/kerrgeopy.bound_solutions.polar_solutions.rst rename to docs/source/_autosummary/kerrgeopy.stable_solutions.polar_solutions.rst index 37232d0..ecf287d 100644 --- a/docs/source/_autosummary/kerrgeopy.bound_solutions.polar_solutions.rst +++ b/docs/source/_autosummary/kerrgeopy.stable_solutions.polar_solutions.rst @@ -1,6 +1,6 @@ polar\_solutions ================ -.. currentmodule:: kerrgeopy.bound_solutions +.. currentmodule:: kerrgeopy.stable_solutions .. autofunction:: polar_solutions \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.bound_solutions.radial_solutions.rst b/docs/source/_autosummary/kerrgeopy.stable_solutions.radial_solutions.rst similarity index 61% rename from docs/source/_autosummary/kerrgeopy.bound_solutions.radial_solutions.rst rename to docs/source/_autosummary/kerrgeopy.stable_solutions.radial_solutions.rst index 1814e71..bcc336c 100644 --- a/docs/source/_autosummary/kerrgeopy.bound_solutions.radial_solutions.rst +++ b/docs/source/_autosummary/kerrgeopy.stable_solutions.radial_solutions.rst @@ -1,6 +1,6 @@ radial\_solutions ================= -.. currentmodule:: kerrgeopy.bound_solutions +.. currentmodule:: kerrgeopy.stable_solutions .. autofunction:: radial_solutions \ No newline at end of file diff --git a/docs/source/_autosummary/kerrgeopy.bound_solutions.rst b/docs/source/_autosummary/kerrgeopy.stable_solutions.rst similarity index 72% rename from docs/source/_autosummary/kerrgeopy.bound_solutions.rst rename to docs/source/_autosummary/kerrgeopy.stable_solutions.rst index f02172b..6c0981b 100644 --- a/docs/source/_autosummary/kerrgeopy.bound_solutions.rst +++ b/docs/source/_autosummary/kerrgeopy.stable_solutions.rst @@ -1,7 +1,7 @@ -bound\_solutions -================ +stable\_solutions +================= -.. automodule:: kerrgeopy.bound_solutions +.. automodule:: kerrgeopy.stable_solutions diff --git a/docs/source/_autosummary/kerrgeopy.units.rst b/docs/source/_autosummary/kerrgeopy.units.rst index fb8cab2..96ef338 100644 --- a/docs/source/_autosummary/kerrgeopy.units.rst +++ b/docs/source/_autosummary/kerrgeopy.units.rst @@ -1,4 +1,4 @@ -units +units ===== .. automodule:: kerrgeopy.units diff --git a/docs/source/index.rst b/docs/source/index.rst index 7cf1341..e3e387c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -40,8 +40,8 @@ See `Getting Started `_ for basic usage. See the `API R :caption: Tutorials notebooks/Tutorial - notebooks/Trajectory notebooks/Orbital Properties + notebooks/Trajectory notebooks/Graphics .. _API Reference: @@ -60,8 +60,8 @@ API Reference :toctree: _autosummary :template: custom-module-template.rst :recursive: - - ~kerrgeopy.bound_orbit.BoundOrbit + + ~kerrgeopy.stable_orbit.StableOrbit ~kerrgeopy.plunging_orbit.PlungingOrbit ~kerrgeopy.orbit.Orbit ~kerrgeopy.spacetime.KerrSpacetime diff --git a/docs/source/notebooks/Graphics.ipynb b/docs/source/notebooks/Graphics.ipynb index db8e641..b202c7c 100644 --- a/docs/source/notebooks/Graphics.ipynb +++ b/docs/source/notebooks/Graphics.ipynb @@ -21,7 +21,7 @@ "id": "d714c093", "metadata": {}, "source": [ - "To plot a [`BoundOrbit`](bound_orbit.BoundOrbit), simply use the [`plot()`](bound_orbit.BoundOrbit.plot) method and pass in the starting and ending Mino time." + "To plot a [`StableOrbit`](stable_orbit.StableOrbit), simply use the [`plot()`](stable_orbit.StableOrbit.plot) method and pass in the starting and ending Mino time." ] }, { @@ -45,7 +45,7 @@ "import kerrgeopy as kg\n", "from math import pi, cos\n", "\n", - "orbit = kg.BoundOrbit(0.998,3,0.6,cos(pi/4))\n", + "orbit = kg.StableOrbit(0.998,3,0.6,cos(pi/4))\n", "fig, ax = orbit.plot(0,5)" ] }, @@ -104,7 +104,7 @@ } ], "source": [ - "orbit = kg.BoundOrbit(0.998,3,0.6,1)\n", + "orbit = kg.StableOrbit(0.998,3,0.6,1)\n", "fig, ax = orbit.plot(0,20,elevation=90, azimuth=0, grid=False, axes=False, thickness=0.01)" ] }, @@ -121,7 +121,7 @@ "id": "100bca66", "metadata": {}, "source": [ - "To create an animation of a [`BoundOrbit`](bound_orbit.BoundOrbit) and save it as an mp4 file, use the [`animate()`](bound_orbit.BoundOrbit.animate) method and pass in the starting and ending Mino time. Note that this method requires ffmpeg to be installed and may take several minutes to run depending on the length of the animation." + "To create an animation of a [`StableOrbit`](stable_orbit.StableOrbit) and save it as an mp4 file, use the [`animate()`](stable_orbit.StableOrbit.animate) method and pass in the starting and ending Mino time. Note that this method requires ffmpeg to be installed and may take several minutes to run depending on the length of the animation." ] }, { @@ -131,7 +131,7 @@ "metadata": {}, "outputs": [], "source": [ - "orbit = kg.BoundOrbit(0.998,3,0.6,cos(pi/4))\n", + "orbit = kg.StableOrbit(0.998,3,0.6,cos(pi/4))\n", "orbit.animate(\"animation1.mp4\",0,10)" ] }, @@ -144,7 +144,7 @@ " \n", "\n", "\n", - "All of the options available when plotting are also available within the [`animate()`](bound_orbit.BoundOrbit.animate) method. In addition, the `tail_length` option can be set to `\"short\"` or `\"none\"` to change the length of the orbital tail." + "All of the options available when plotting are also available within the [`animate()`](stable_orbit.StableOrbit.animate) method. In addition, the `tail_length` option can be set to `\"short\"` or `\"none\"` to change the length of the orbital tail." ] }, { diff --git a/docs/source/notebooks/Orbital Properties.ipynb b/docs/source/notebooks/Orbital Properties.ipynb index 4041745..22f322d 100644 --- a/docs/source/notebooks/Orbital Properties.ipynb +++ b/docs/source/notebooks/Orbital Properties.ipynb @@ -5,19 +5,7 @@ "id": "8b0aefcc", "metadata": {}, "source": [ - "# Orbital Properties\n", - "\n", - "## Background\n", - "\n", - "The symmetries of Kerr spacetime generate three constants of motion for any given orbit: \n", - "\n", - "$\\mathcal{E}$ - Energy\n", - "
\n", - "$\\mathcal{L}$ - Angular Momentum\n", - "
\n", - "$\\mathcal{Q}$ - Carter Constant\n", - "\n", - "Energy and angular momentum are generated by time translation symmetry and azimuthal symmetry respectively. The Carter constant is generated by a higher order symmetry of the Kerr metric which comes from a second order Killing tensor known as the Carter tensor. " + "# Orbital Properties" ] }, { @@ -27,24 +15,29 @@ "source": [ "## Constants of Motion\n", "\n", - "These constants of motion can be computed for a [`BoundOrbit`](bound_orbit.BoundOrbit) using the [`constants_of_motion()`](bound_orbit.BoundOrbit.constants_of_motion) method. By default, the quantities returned by this method are given in geometrized units where $G=c=1$ and are scale invariant, meaning that they are normalized using the masses of the two bodies as follows:\n", - "\\begin{equation}\n", - "\\tilde{\\mathcal{E}} = \\frac{\\mathcal{E}}{\\mu}, \\quad \\tilde{\\mathcal{L}} = \\frac{\\mathcal{L}}{\\mu M}, \\quad \\tilde{\\mathcal{Q}} = \\frac{\\mathcal{Q}}{\\mu^2 M^2}\n", - "\\end{equation}\n", + "The symmetries of Kerr spacetime generate three constants of motion for any given orbit: \n", "\n", - "Here, $M$ is the mass of the primary body and $\\mu$ is the mass of the secondary." + "$E$ - Energy\n", + "
\n", + "$L$ - $z$-component of Angular Momentum\n", + "
\n", + "$Q$ - Carter Constant\n", + "\n", + "Energy and angular momentum are generated by time translation symmetry and azimuthal symmetry respectively. The Carter constant is generated by a higher order symmetry of the Kerr metric which comes from a second order Killing tensor known as the Carter tensor. \n", + "\n", + "These constants of motion can be computed for a [`StableOrbit`](stable_orbit.StableOrbit) using the [`constants_of_motion()`](stable_orbit.StableOrbit.constants_of_motion) method. By default, this method returns dimensionless quantities that are normalized as described in [Getting Started](orbital-properties)." ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "id": "a4b56ebb", "metadata": {}, "outputs": [ { "data": { "text/latex": [ - "$\\displaystyle E = 0.942 \\quad L = 2.028 \\quad Q = 4.160$" + "$\\displaystyle \\mathcal{E} = 0.942 \\quad \\mathcal{L} = 2.028 \\quad \\mathcal{Q} = 4.160$" ], "text/plain": [ "" @@ -59,10 +52,10 @@ "from math import pi, cos\n", "from IPython.display import display, Math\n", "\n", - "orbit = kg.BoundOrbit(0.9,5,0.6,cos(pi/4))\n", + "orbit = kg.StableOrbit(0.9,5,0.6,cos(pi/4))\n", "E, L, Q = orbit.constants_of_motion()\n", "\n", - "display(Math(fr\"E = {E:.3f} \\quad L = {L:.3f} \\quad Q = {Q:.3f}\"))" + "display(Math(rf\"\\mathcal{{E}} = {E:.3f} \\quad \\mathcal{{L}} = {L:.3f} \\quad \\mathcal{{Q}} = {Q:.3f}\"))" ] }, { @@ -97,7 +90,7 @@ } ], "source": [ - "orbit = kg.BoundOrbit(0.9,5,0.6,cos(pi/4), M=1e6,mu=10)\n", + "orbit = kg.StableOrbit(0.9,5,0.6,cos(pi/4), M=1e6,mu=10)\n", "\n", "E, L, Q = orbit.constants_of_motion(units=\"mks\")\n", "\n", @@ -145,7 +138,7 @@ "source": [ "## Frequencies of Motion\n", "\n", - "To compute the frequencies of motion in Mino time for a [`BoundOrbit`](bound_orbit.BoundOrbit), use the [`mino_frequencies()`](bound_orbit.BoundOrbit.mino_frequencies) method. This method returns the frequencies of motion for each of the three spatial coordinates $(\\Upsilon_r,\\Upsilon_\\theta,\\Upsilon_\\phi)$ along with $\\Gamma$, which measures the average rate at which observer time accumulates in Mino time. The frequencies of motion can be computed in observer time by simply dividing each of the Mino frequencies by $\\Gamma$, or by using the [`observer_frequencies()`](bound_orbit.BoundOrbit.observer_frequencies) method. By default, both methods return all quantities in dimensionless units where $G=c=M=1$." + "To compute the frequencies of motion in Mino time for a [`StableOrbit`](stable_orbit.StableOrbit), use the [`mino_frequencies()`](stable_orbit.StableOrbit.mino_frequencies) method. This method returns the frequencies of motion for each of the three spatial coordinates $(\\Upsilon_r,\\Upsilon_\\theta,\\Upsilon_\\phi)$ along with $\\Gamma$, which measures the average rate at which observer time accumulates in Mino time. The frequencies of motion can be computed in observer time by simply dividing each of the Mino frequencies by $\\Gamma$, or by using the [`fundamental_frequencies()`](stable_orbit.StableOrbit.fundamental_frequencies) method. This method returns the Boyer-Lindquist frequencies $(\\Omega_r,\\Omega_\\theta,\\Omega_\\phi)$. By default, the frequencies returned by both methods are given in geometrized units where $G=c=1$ and are normalized by $M$ so that they are dimensionless." ] }, { @@ -185,10 +178,10 @@ } ], "source": [ - "orbit = kg.BoundOrbit(0.9,5,0.6,cos(pi/4))\n", + "orbit = kg.StableOrbit(0.9,5,0.6,cos(pi/4))\n", "\n", "upsilon_r, upsilon_theta, upsilon_phi, gamma = orbit.mino_frequencies()\n", - "omega_r, omega_theta, omega_phi = orbit.observer_frequencies()\n", + "omega_r, omega_theta, omega_phi = orbit.fundamental_frequencies()\n", "\n", "\n", "display(Math(fr\"\"\"\\Upsilon_r = {upsilon_r:.3f} \\quad \n", @@ -208,7 +201,7 @@ "source": [ "### Physical Units\n", "\n", - "As with constants of motion, frequencies can be computed in physical units if `M` and `mu` are specified. Note that Mino frequencies have units of seconds, while $\\Gamma$ has units of $\\text{s}^2$. Observer frequencies can be given in units of Hz or mHz." + "As with constants of motion, frequencies can be computed in physical units if `M` and `mu` are specified. Note that Mino frequencies have units of seconds, while $\\Gamma$ has units of $\\text{s}^2$. Observer-time frequencies can be given in units of Hz or mHz." ] }, { @@ -248,10 +241,10 @@ } ], "source": [ - "orbit = kg.BoundOrbit(0.9,5,0.6,cos(pi/4), M=1e6,mu=10)\n", + "orbit = kg.StableOrbit(0.9,5,0.6,cos(pi/4), M=1e6,mu=10)\n", "\n", "upsilon_r, upsilon_theta, upsilon_phi, gamma = orbit.mino_frequencies(units=\"mks\")\n", - "omega_r, omega_theta, omega_phi = orbit.observer_frequencies(units=\"mHz\")\n", + "omega_r, omega_theta, omega_phi = orbit.fundamental_frequencies(units=\"mHz\")\n", "\n", "display(Math(fr\"\"\"\\Upsilon_r = {upsilon_r:.3f} \\text{{ s}} \\quad \n", " \\Upsilon_\\theta = {upsilon_theta:.3f} \\text{{ s}} \\quad \n", @@ -270,7 +263,7 @@ "source": [ "### Utility Methods\n", "\n", - "There are also utility methods for computing frequencies of motion directly from the orbital parameters $(a,p,e,x)$. Use the [`mino_frequencies()`](frequencies.mino_frequencies) and [`observer_frequencies()`](frequencies.observer_frequencies) methods to compute the frequencies as a tuple, or use the [`r_frequency()`](frequencies.r_frequency), [`theta_frequency()`](frequencies.theta_frequency), [`phi_frequency()`](frequencies.phi_frequency), and [`gamma()`](frequencies.gamma) methods to compute each of the Mino frequencies individually." + "There are also utility methods for computing frequencies of motion directly from the orbital parameters $(a,p,e,x)$. Use the [`mino_frequencies()`](frequencies.mino_frequencies) and [`fundamental_frequencies()`](frequencies.fundamental_frequencies) methods to compute the frequencies as a tuple, or use the [`r_frequency()`](frequencies.r_frequency), [`theta_frequency()`](frequencies.theta_frequency), [`phi_frequency()`](frequencies.phi_frequency), and [`gamma()`](frequencies.gamma) methods to compute each of the Mino frequencies individually." ] }, { @@ -281,7 +274,7 @@ "outputs": [], "source": [ "upsilon_r, upsilon_theta, upsilon_phi, gamma = kg.mino_frequencies(0.9,5,0.6,cos(pi/4))\n", - "omega_r, omega_theta, omega_phi = kg.observer_frequencies(0.9,5,0.6,cos(pi/4))" + "omega_r, omega_theta, omega_phi = kg.fundamental_frequencies(0.9,5,0.6,cos(pi/4))" ] }, { @@ -297,6 +290,152 @@ "gamma = kg.gamma(0.9,5,0.6,cos(pi/4))" ] }, + { + "cell_type": "markdown", + "id": "822e076a", + "metadata": {}, + "source": [ + "## Stability\n", + "\n", + "Note that not all combinations of orbital parameters $(a,p,e,x)$ define a stable orbit. The boundary in parameter space between stable and unstable orbits is known as the separatrix. It is most convenient to think of the separatrix as defining a minimum stable value of $p$ for a given set of parameters $(a,e,x)$. Use the [`separatrix()`](constants.separatrix) method to compute this minimum value." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6573b1d7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4.462323556641868" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import kerrgeopy as kg\n", + "from math import pi, cos\n", + "\n", + "kg.separatrix(0.9,0.6,cos(pi/3))" + ] + }, + { + "cell_type": "markdown", + "id": "ca838e8f", + "metadata": {}, + "source": [ + "Use the [`is_stable()`](constants.is_stable) method to test if an orbit is stable. Running `kg.is_stable(a,p,e,x)` is equivalent to checking if `p >= kg.separatrix(a,e,x)`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e1a1e8da", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "kg.is_stable(0.9,5,0.6,cos(pi/3))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5d49a72f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "kg.is_stable(0.9,4,0.6,cos(pi/3))" + ] + }, + { + "cell_type": "markdown", + "id": "00524dd8", + "metadata": {}, + "source": [ + "For better performance, use the [`fast_separatrix()`](constants.fast_separatrix) method to construct a faster separatrix function for a given value of $a$ by interpolating from a grid of $e$ and $x$ values. The function returned by this method is slightly less accurate but runs around 100 times faster." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d6062257", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[5.86056037]])" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fast_sep = kg.fast_separatrix(a=0.5)\n", + "fast_sep(0.5,0.5)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "074e3ae7", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "89.9 µs ± 463 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)\n" + ] + } + ], + "source": [ + "%timeit kg.separatrix(0.5,0.5,0.5)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a8f5af6e", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "938 ns ± 2.85 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n" + ] + } + ], + "source": [ + "%timeit fast_sep(0.5,0.5)" + ] + }, { "cell_type": "markdown", "id": "cfa7b475", diff --git a/docs/source/notebooks/Trajectory.ipynb b/docs/source/notebooks/Trajectory.ipynb index 1c004ef..d8611eb 100644 --- a/docs/source/notebooks/Trajectory.ipynb +++ b/docs/source/notebooks/Trajectory.ipynb @@ -20,104 +20,9 @@ "\\end{equation}\n", "Here, $\\Delta=r^2-2 M r+a^2$, $\\Sigma=r^2+a^2 \\cos ^2 \\theta$ and $z = \\cos{\\theta}$. $\\mathcal{E}$, $\\mathcal{L}$, and $\\mathcal{Q}$ represent the energy, angular momentum, and Carter constant respectively. In order to solve this system analytically, the trajectory must be reparametrized in terms of a new parameter $\\lambda$ which is defined such that $\\frac{d\\tau}{d\\lambda} = \\Sigma$. This new parameter is known as Mino time.\n", "\n", - "## Bound Orbits\n", + "## Stable Bound Orbits\n", "\n", - "Taking $M$ to represent the mass of the primary body and working in dimensionless units where $G=c=M=1$, bound orbits are parametrized using the following variables:\n", - "\n", - "$a$ - spin of the primary body\n", - "
\n", - "$p$ - orbital semilatus rectum ($\\frac{2r_{\\text{min}}r_{\\text{max}}}{r_{\\text{min}}+r_{\\text{max}}}$)\n", - "
\n", - "$e$ - orbital eccentricity ($\\frac{r_{\\text{max}}-r_{\\text{min}}}{r_{\\text{max}}+r_{\\text{min}}}$)\n", - "
\n", - "$x$ - cosine of the orbital inclination ($\\cos{\\theta_{\\text{inc}}}$)\n", - "
\n", - "\n", - "Note that $a$ and $x$ are restricted to values between -1 and 1, while $e$ is restricted to values between 0 and 1. Retrograde orbits are represented using a negative value for $a$ or for $x$. Polar orbits, marginally bound orbits, and orbits around an extreme Kerr black hole are not supported. \n", - "\n", - "### Stability\n" - ] - }, - { - "cell_type": "markdown", - "id": "cc6dc455", - "metadata": {}, - "source": [ - "Note that not all combinations of orbital parameters define a stable orbit. The boundary in parameter space between stable and unstable orbits is known as the separatrix. It is most convenient to think of the separatrix as defining a minimum stable value of $p$ for a given set of parameters $(a,e,x)$. Use the [`separatrix()`](constants.separatrix) method to compute this minimum value." - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "id": "2390a8b5", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "4.462323556641868" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import kerrgeopy as kg\n", - "from math import pi, cos\n", - "\n", - "kg.separatrix(0.9,0.6,cos(pi/3))" - ] - }, - { - "cell_type": "markdown", - "id": "f8810bde", - "metadata": {}, - "source": [ - "Use the [`is_stable()`](constants.is_stable) method to test if an orbit is stable. Running `kg.is_stable(a,p,e,x)` is equivalent to checking if `p >= kg.separatrix(a,e,x)`" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "269e764b", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kg.is_stable(0.9,5,0.6,cos(pi/3))" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "3772eaf2", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "False" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kg.is_stable(0.9,4,0.6,cos(pi/3))" + "For stable bound orbits, kerrgeopy uses the $(a,p,e,x)$ parametrization described in [Getting Started](stable-orbits). \n" ] }, { @@ -127,7 +32,7 @@ "source": [ "### Trajectory\n", "\n", - "To compute a trajectory, first construct a [`BoundOrbit`](bound_orbit.BoundOrbit) by specifying the four orbital parameters described above. Then use the [`trajectory()`](bound_orbit.BoundOrbit.trajectory) method to compute the time, radial, polar and azimuthal components of the trajectory as a function of Mino time. Use the `initial_phases` option to set the initial phases $(q_{t_0},q_{r_0},q_{\\theta_0},q_{\\phi_0})$ of the orbit. Phases are defined as follows:\n", + "To compute a trajectory, first construct a [`StableOrbit`](stable_orbit.StableOrbit) by specifying a set of orbital parameters $(a,p,e,x)$. Then use the [`trajectory()`](stable_orbit.StableOrbit.trajectory) method to compute the time, radial, polar and azimuthal components of the trajectory as a function of Mino time. Use the `initial_phases` option to set the initial phases $(q_{t_0},q_{r_0},q_{\\theta_0},q_{\\phi_0})$ of the orbit. Phases are defined as follows:\n", "\n", "\\begin{equation}\n", "\\begin{aligned}\n", @@ -138,7 +43,7 @@ "\\end{aligned}\n", "\\end{equation}\n", "\n", - "Here, $\\Gamma$ is the average rate at which Mino time accumulates in observer time, and $\\Upsilon_r$, $\\Upsilon_\\theta$ and $\\Upsilon_\\phi$ are the orbital frequencies of motion in $r$, $\\theta$ and $\\phi$ respectively. By default, all phases are set to zero and the trajectory is computed assuming the initial conditions $r_0 = r_{\\text{min}}$ and $\\theta_0 = \\theta_{\\text{min}}$. In order to start the orbit from $r_{\\text{max}}$ instead, set $q_{r_0} = \\pi$." + "By default, all initial phases are set to zero and the trajectory is computed assuming that the orbit begins at the inner turning point, i.e. $(t_0,r_0,\\theta_0,\\phi_0) = (0, r_{\\text{min}},\\theta_{\\text{min}},0)$. In order to start the orbit from $r_{\\text{max}}$ instead, set $q_{r_0} = \\pi$." ] }, { @@ -148,7 +53,7 @@ "metadata": {}, "outputs": [], "source": [ - "orbit = kg.BoundOrbit(0.9,5,0.6,cos(pi/3))\n", + "orbit = kg.StableOrbit(0.9,5,0.6,cos(pi/3))\n", "\n", "t, r, theta, phi = orbit.trajectory(initial_phases=(0,pi,0,0))" ] @@ -216,7 +121,7 @@ "source": [ "### Physical Units\n", "\n", - " If the masses of the two bodies are specified, the radial and time components of the trajectory can also be computed in physical units. `M` and `mu` define the mass of the primary and secondary body respectively in solar masses. Use the `distance_units` and `time_units` options to set units for the radial and time components. See the [`trajectory()`](bound_orbit.BoundOrbit.trajectory) documentation page for a full list of available units." + " If the masses of the two bodies are specified, the radial and time components of the trajectory can also be computed in physical units. `M` and `mu` define the mass of the primary and secondary body respectively in solar masses. Use the `distance_units` and `time_units` options to set units for the radial and time components. See the [`trajectory()`](stable_orbit.StableOrbit.trajectory) documentation page for a full list of available units." ] }, { @@ -226,7 +131,7 @@ "metadata": {}, "outputs": [], "source": [ - "orbit = kg.BoundOrbit(0.9,5,0.6,cos(pi/3), M=1e6, mu=10)\n", + "orbit = kg.StableOrbit(0.9,5,0.6,cos(pi/3), M=1e6, mu=10)\n", "\n", "t, r, theta, phi = orbit.trajectory(distance_units='au', time_units='mks')" ] @@ -294,18 +199,9 @@ "source": [ "## Plunging Orbits\n", "\n", - "Plunging orbits are parametrized using the spin parameter and the three constants of motion.\n", - "\n", - "$a$ - dimensionless spin of the primary\n", - "
\n", - "$\\mathcal{E}$ - dimensionless energy\n", - "
\n", - "$\\mathcal{L}$ - dimensionless angular momentum\n", - "
\n", - "$Q$ - dimensionless carter constant\n", - "
\n", + "Plunging orbits are parametrized using the $(a,\\mathcal{E},\\mathcal{L},\\mathcal{Q})$ parametrization described in [Getting Started](plunging-orbits).\n", "\n", - "Construct a [`PlungingOrbit`](plunging_orbit.PlungingOrbit) by passing in these four parameters and use the [`trajectory()`](plunging_orbit.PlungingOrbit.trajectory) method to compute the trajectory. As with non-plunging orbits, the `initial_phases` option sets the initial phases $(q_{t_0},q_{r_0},q_{\\theta_0},q_{\\phi_0})$ and the `distance_units` and `time_units` options can be used to specify units if `M` and `mu` are given." + "Construct a [`PlungingOrbit`](plunging_orbit.PlungingOrbit) by passing in these four parameters and use the [`trajectory()`](plunging_orbit.PlungingOrbit.trajectory) method to compute the trajectory. As with stable orbits, the `initial_phases` option sets the initial phases $(q_{t_0},q_{r_0},q_{\\theta_0},q_{\\phi_0})$ and the `distance_units` and `time_units` options can be used to specify units if `M` and `mu` are given." ] }, { @@ -440,7 +336,7 @@ "source": [ "### Four-Velocity\n", "\n", - "Use the [`four_velocity()`](spacetime.KerrSpacetime.four_velocity) method to compute the components of the four velocity by passing in the components of the trajectory and the constants of motion. This method computes the four velocity by subsituting the trajectory and constants of motion into the geodesic equation at the top of this page." + "Use the [`four_velocity()`](spacetime.KerrSpacetime.four_velocity) method to compute the components of the four velocity by passing in the components of the trajectory and the constants of motion. This method computes the four velocity by substituting the trajectory and constants of motion into the geodesic equation at the top of this page." ] }, { @@ -450,7 +346,7 @@ "metadata": {}, "outputs": [], "source": [ - "orbit = kg.BoundOrbit(0.99,7,0.2,cos(pi/3))\n", + "orbit = kg.StableOrbit(0.99,7,0.2,cos(pi/3))\n", "\n", "t, r, theta, phi = orbit.trajectory()\n", "constants = orbit.constants_of_motion()\n", diff --git a/docs/source/notebooks/Tutorial.ipynb b/docs/source/notebooks/Tutorial.ipynb index f760df1..2145c9f 100644 --- a/docs/source/notebooks/Tutorial.ipynb +++ b/docs/source/notebooks/Tutorial.ipynb @@ -14,23 +14,26 @@ "```bash\n", "pip install kerrgeopy\n", "```\n", + "(stable-orbits)=\n", + "## Stable Bound Orbits\n", "\n", - "## Bound Orbits\n", + "Kerrgeopy computes orbits in Boyer-Lindquist coordinates $(t,r,\\theta,\\phi)$. Let $M$ to represent the mass of the primary body and let $J$ represent its angular momentum. Working in geometrized units where $G=c=1$, bound orbits are parametrized using the following variables:\n", "\n", - "Kerrgeopy computes orbits in Boyer-Lindquist coordinates $(t,r,\\theta,\\phi)$. Taking $M$ to represent the mass of the primary body and working in dimensionless units where $G=c=M=1$, bound orbits are parametrized using the following variables:\n", - "\n", - "$a$ - spin of the primary body\n", - "
\n", - "$p$ - orbital semilatus rectum ($\\frac{2r_{\\text{min}}r_{\\text{max}}}{r_{\\text{min}}+r_{\\text{max}}}$)\n", + "$a$ - spin of the primary body \n", "
\n", - "$e$ - orbital eccentricity ($\\frac{r_{\\text{max}}-r_{\\text{min}}}{r_{\\text{max}}+r_{\\text{min}}}$)\n", + "$p$ - orbital semilatus rectum\n", "
\n", - "$x$ - cosine of the orbital inclination ($\\cos{\\theta_{\\text{inc}}}$)\n", + "$e$ - orbital eccentricity\n", "
\n", + "$x$ - cosine of the orbital inclination\n", + "\n", + "\\begin{equation}\n", + "a = \\frac{J}{M}, \\quad\\quad p = \\frac{2r_{\\text{min}}r_{\\text{max}}}{M(r_{\\text{min}}+r_{\\text{max}})}, \\quad\\quad e = \\frac{r_{\\text{max}}-r_{\\text{min}}}{r_{\\text{max}}+r_{\\text{min}}}, \\quad\\quad x = \\cos{\\theta_{\\text{inc}}}\n", + "\\end{equation}\n", "\n", "Note that $a$ and $x$ are restricted to values between -1 and 1, while $e$ is restricted to values between 0 and 1. Retrograde orbits are represented using a negative value for $a$ or for $x$. Polar orbits, marginally bound orbits, and orbits around an extreme Kerr black hole are not supported. \n", "\n", - "First, construct a [`BoundOrbit`](bound_orbit.BoundOrbit) using the four parameters described above." + "First, construct a [`StableOrbit`](stable_orbit.StableOrbit) using the four parameters described above." ] }, { @@ -43,7 +46,7 @@ "import kerrgeopy as kg\n", "from math import cos, pi\n", "\n", - "orbit = kg.BoundOrbit(0.999,3,0.4,cos(pi/6))" + "orbit = kg.StableOrbit(0.999,3,0.4,cos(pi/6))" ] }, { @@ -51,7 +54,7 @@ "id": "bb1022f0", "metadata": {}, "source": [ - "Plot the orbit from $\\lambda = 0$ to $\\lambda = 10$ using the [`plot()`](bound_orbit.BoundOrbit.plot) method" + "Plot the orbit from $\\lambda = 0$ to $\\lambda = 10$ using the [`plot()`](stable_orbit.StableOrbit.plot) method" ] }, { @@ -80,7 +83,7 @@ "id": "268961e0", "metadata": {}, "source": [ - "Next, compute the time, radial, polar and azimuthal components of the trajectory as a function of Mino time using the [`trajectory()`](bound_orbit.BoundOrbit.trajectory) method" + "Next, compute the time, radial, polar and azimuthal components of the trajectory as a function of Mino time using the [`trajectory()`](stable_orbit.StableOrbit.trajectory) method. By default, the time and radial components of the trajectory are given in geometrized units and are normalized using $M$ so that they are dimensionless." ] }, { @@ -154,6 +157,7 @@ "id": "30f5c248", "metadata": {}, "source": [ + "(orbital-properties)=\n", "## Orbital Properties" ] }, @@ -162,12 +166,20 @@ "id": "6fc7c3ec", "metadata": {}, "source": [ - "Use the [`constants_of_motion()`](bound_orbit.BoundOrbit.constants_of_motion) method to compute the dimensionless energy, angular momentum and carter constant. Frequencies of motion can be computed in Mino time using the [`mino_frequencies()`](bound_orbit.BoundOrbit.mino_frequencies) method and in Boyer-Lindquist time using the [`observer_frequencies()`](bound_orbit.BoundOrbit.observer_frequencies) method." + "Use the [`constants_of_motion()`](stable_orbit.StableOrbit.constants_of_motion) method to compute the dimensionless energy, angular momentum and Carter constant. By default, constants of motion are given in geometrized units where $G=c=1$ and are scale-invariant, meaning that they are normalized according to the masses of the two bodies as follows:\n", + "\n", + "\\begin{equation}\n", + "\\mathcal{E} = \\frac{E}{\\mu}, \\quad \\mathcal{L} = \\frac{L}{\\mu M}, \\quad \\mathcal{Q} = \\frac{Q}{\\mu^2 M^2}\n", + "\\end{equation}\n", + "\n", + "Here, $M$ is the mass of the primary body and $\\mu$ is the mass of the secondary body. \n", + "\n", + "Frequencies of motion can be computed in Mino time using the [`mino_frequencies()`](stable_orbit.StableOrbit.mino_frequencies) method and in Boyer-Lindquist time using the [`fundamental_frequencies()`](stable_orbit.StableOrbit.fundamental_frequencies) method. As with constants of motion, the frequencies returned by both methods are given in geometrized units and are normalized by $M$ so that they are dimensionless." ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "id": "2b8cb67a", "metadata": {}, "outputs": [ @@ -186,7 +198,7 @@ { "data": { "text/latex": [ - "$\\displaystyle E = 0.877 \\quad L = 1.903 \\quad Q = 1.265$" + "$\\displaystyle \\mathcal{E} = 0.877 \\quad \\mathcal{L} = 1.903 \\quad \\mathcal{Q} = 1.265$" ], "text/plain": [ "" @@ -232,12 +244,12 @@ "\n", "upsilon_r, upsilon_theta, upsilon_phi, gamma = orbit.mino_frequencies()\n", "\n", - "omega_r, omega_theta, omega_phi = orbit.observer_frequencies()\n", + "omega_r, omega_theta, omega_phi = orbit.fundamental_frequencies()\n", "\n", "\n", "display(Math(fr\"a = {orbit.a} \\quad p = {orbit.p} \\quad e = {orbit.e} \\quad x = {orbit.x}\"))\n", "\n", - "display(Math(fr\"E = {E:.3f} \\quad L = {L:.3f} \\quad Q = {Q:.3f}\"))\n", + "display(Math(fr\"\\mathcal{{E}} = {E:.3f} \\quad \\mathcal{{L}} = {L:.3f} \\quad \\mathcal{{Q}} = {Q:.3f}\"))\n", "\n", "display(Math(fr\"\"\"\\Upsilon_r = {upsilon_r:.3f} \\quad \n", " \\Upsilon_\\theta = {upsilon_theta:.3f} \\quad \n", @@ -249,139 +261,12 @@ " \\Omega_\\phi = {omega_phi:.3f}\"\"\"))" ] }, - { - "cell_type": "markdown", - "id": "c75dfb7b", - "metadata": {}, - "source": [ - "## Units" - ] - }, - { - "cell_type": "markdown", - "id": "56e2bc20", - "metadata": {}, - "source": [ - "If the masses of the two bodies are defined, then kerrgeopy can also compute constants and frequencies of motion in physical units. `M` and `mu` define the mass of the primary and secondary body respectively in solar masses." - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "65c7d79d", - "metadata": {}, - "outputs": [], - "source": [ - "orbit = kg.BoundOrbit(0.999,3,0.4,cos(pi/6), M=1e6, mu=10)" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "89203943", - "metadata": {}, - "outputs": [ - { - "data": { - "text/latex": [ - "$\\displaystyle M = 1e+06 \\text{ M}_\\odot \\quad \\mu = 10 \\text{ M}_\\odot$" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/latex": [ - "$\\displaystyle a = 0.999 \\quad p = 3 \\quad e = 0.4 \\quad x = 0.8660254037844387$" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/latex": [ - "$\\displaystyle E = 1.568e+48 \\text{ J} \n", - " \\quad L = 3.332e+79 \\text{ kg m}^2 \\text{s}^{-1} \n", - " \\quad Q = 3.876e+158 \\text{ kg}^2 \\text{m}^4 \\text{s}^{-2}$" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/latex": [ - "$\\displaystyle \\Upsilon_r = 5.638 \\text{ s} \\quad \n", - " \\Upsilon_\\theta = 11.049 \\text{ s} \\quad \n", - " \\Upsilon_\\phi = 15.358 \\text{ s} \\quad \n", - " \\Gamma = 498.078 \\text{ s}^2$" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/latex": [ - "$\\displaystyle \\Omega_r = 11.319 \\text{ mHz} \\quad\n", - " \\Omega_\\theta = 22.183 \\text{ mHz}\\quad\n", - " \\Omega_\\phi = 30.835 \\text{ mHz}$" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "from IPython.display import display, Math\n", - "\n", - "E, L, Q = orbit.constants_of_motion(units=\"mks\")\n", - "\n", - "upsilon_r, upsilon_theta, upsilon_phi, gamma = orbit.mino_frequencies(units=\"mks\")\n", - "\n", - "omega_r, omega_theta, omega_phi = orbit.observer_frequencies(units=\"mHz\")\n", - "\n", - "\n", - "display(Math(fr\"M = {orbit.M:g} \\text{{ M}}_\\odot \\quad \\mu = {orbit.mu} \\text{{ M}}_\\odot\"))\n", - "\n", - "display(Math(fr\"a = {orbit.a} \\quad p = {orbit.p} \\quad e = {orbit.e} \\quad x = {orbit.x}\"))\n", - "\n", - "display(Math(fr\"\"\"E = {E:.3e} \\text{{ J}} \n", - " \\quad L = {L:.3e} \\text{{ kg m}}^2 \\text{{s}}^{{-1}} \n", - " \\quad Q = {Q:.3e} \\text{{ kg}}^2 \\text{{m}}^4 \\text{{s}}^{{-2}}\"\"\"))\n", - "\n", - "display(Math(fr\"\"\"\\Upsilon_r = {upsilon_r:.3f} \\text{{ s}} \\quad \n", - " \\Upsilon_\\theta = {upsilon_theta:.3f} \\text{{ s}} \\quad \n", - " \\Upsilon_\\phi = {upsilon_phi:.3f} \\text{{ s}} \\quad \n", - " \\Gamma = {gamma:.3f} \\text{{ s}}^2\"\"\"))\n", - "\n", - "display(Math(fr\"\"\"\\Omega_r = {omega_r:.3f} \\text{{ mHz}} \\quad\n", - " \\Omega_\\theta = {omega_theta:.3f} \\text{{ mHz}}\\quad\n", - " \\Omega_\\phi = {omega_phi:.3f} \\text{{ mHz}}\"\"\"))" - ] - }, { "cell_type": "markdown", "id": "1a0a4c44", "metadata": {}, "source": [ + "(plunging-orbits)=\n", "## Plunging Orbits" ] }, @@ -390,17 +275,23 @@ "id": "3447e86e", "metadata": {}, "source": [ - "Plunging orbits are parametrized using the spin parameter and the three constants of motion.\n", + "Plunging orbits are parametrized using the spin parameter and the three constants of motion. \n", "\n", - "$a$ - dimensionless spin of the primary\n", + "$a$ - spin of the primary body\n", "
\n", - "$\\mathcal{E}$ - dimensionless energy\n", + "$\\mathcal{E}$ - Energy\n", "
\n", - "$\\mathcal{L}$ - dimensionless angular momentum\n", + "$\\mathcal{L}$ - $z$-component of angular momentum\n", "
\n", - "$Q$ - dimensionless carter constant\n", + "$\\mathcal{Q}$ - Carter constant\n", "
\n", "\n", + "It is assumed that all orbital parameters are given in geometrized units where $G=c=1$ and are normalized according to the masses of the two bodies as follows:\n", + "\n", + "\\begin{equation}\n", + "a = \\frac{J}{M}, \\quad \\mathcal{E} = \\frac{E}{\\mu}, \\quad \\mathcal{L} = \\frac{L}{\\mu M}, \\quad \\mathcal{Q} = \\frac{Q}{\\mu^2 M^2}\n", + "\\end{equation}\n", + "\n", "Construct a [`PlungingOrbit`](plunging_orbit.PlungingOrbit) by passing in these four parameters." ] }, @@ -419,7 +310,7 @@ "id": "31281448", "metadata": {}, "source": [ - "As before, the components of the trajectory can be computed using the [`trajectory()`](plunging_orbit.PlungingOrbit.trajectory) method" + "As with stable orbits, the components of the trajectory can be computed using the [`trajectory()`](plunging_orbit.PlungingOrbit.trajectory) method" ] }, { @@ -487,109 +378,6 @@ "plt.xlabel(\"$\\lambda$\")\n", "plt.ylabel(r\"$\\phi(\\lambda)$\")" ] - }, - { - "cell_type": "markdown", - "id": "8b75f0af", - "metadata": {}, - "source": [ - "## Separatrix" - ] - }, - { - "cell_type": "markdown", - "id": "f52bdce3", - "metadata": {}, - "source": [ - "The separatrix is the boundary in parameter space between stable and unstable orbits. Kerrgeopy provides a [`separatrix()`](constants.separatrix) method for computing the value of $p$ at the separatrix given values for $a$, $e$ and $x$. If $e$ is set to 0 and $x$ is set to 1, this gives the radius of the innermost stable circular orbit." - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "id": "48d6d09e", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "5.860560368032176" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "kg.separatrix(0.5,0.5,0.5)" - ] - }, - { - "cell_type": "markdown", - "id": "cc1bab19", - "metadata": {}, - "source": [ - "For better performance, use the [`fast_separatrix()`](constants.fast_separatrix) method to construct a faster separatrix function for a given value of $a$ by interpolating from a grid of $e$ and $x$ values. The function returned by this method is slightly less accurate but runs around 100 times faster." - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "id": "a674c8be", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[5.86056037]])" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "fast_sep = kg.fast_separatrix(a=0.5)\n", - "fast_sep(0.5,0.5)" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "id": "108c0885", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "86.7 µs ± 200 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)\n" - ] - } - ], - "source": [ - "%timeit kg.separatrix(0.5,0.5,0.5)" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "id": "22bc4ec9", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "947 ns ± 5.48 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n" - ] - } - ], - "source": [ - "%timeit fast_sep(0.5,0.5)" - ] } ], "metadata": { diff --git a/kerrgeopy/__init__.py b/kerrgeopy/__init__.py index b099857..f9998b2 100644 --- a/kerrgeopy/__init__.py +++ b/kerrgeopy/__init__.py @@ -1,11 +1,11 @@ """ Python package for computing plunging and non-plunging geodesics in Kerr spacetime. """ -__all__ = ["units","constants", "frequencies", "bound_orbit", "plunging_orbit"] +__all__ = ["units","constants", "frequencies", "stable_orbit", "plunging_orbit"] from kerrgeopy import * from kerrgeopy.frequencies import * from kerrgeopy.constants import * -from kerrgeopy.bound_orbit import BoundOrbit +from kerrgeopy.stable_orbit import StableOrbit from kerrgeopy.plunging_orbit import PlungingOrbit from kerrgeopy.orbit import Orbit from kerrgeopy.spacetime import KerrSpacetime diff --git a/kerrgeopy/frequencies.py b/kerrgeopy/frequencies.py index d98f885..9214498 100644 --- a/kerrgeopy/frequencies.py +++ b/kerrgeopy/frequencies.py @@ -237,7 +237,7 @@ def mino_frequencies(a,p,e,x): return upsilon_r, abs(upsilon_theta), upsilon_phi, Gamma -def observer_frequencies(a,p,e,x): +def fundamental_frequencies(a,p,e,x): r""" Computes frequencies of orbital motion in Boyer-Lindquist time using the method derived in Fujita and Hikida (arXiv:0906.1420) diff --git a/kerrgeopy/frequencies_from_constants.py b/kerrgeopy/frequencies_from_constants.py index 4708b2c..d212ca4 100644 --- a/kerrgeopy/frequencies_from_constants.py +++ b/kerrgeopy/frequencies_from_constants.py @@ -78,7 +78,7 @@ def r_frequency_from_constants(constants,radial_roots): :param constants: dimensionless constants of motion for the orbit in the form :math:`(E,L,Q)` :type constants: tuple(double, double, double) - :param radial_roots: tuple containing the four roots of the radial equation :math:`(r_1, r_2, r_3, r_4)`. Assumes that motion is between r1 and r2 and that roots are otherwise in ascending order. + :param radial_roots: tuple containing the four roots of the radial equation :math:`(r_1, r_2, r_3, r_4)`. :type radial_roots: tuple(double, double, double, double) :rtype: double @@ -99,7 +99,7 @@ def theta_frequency_from_constants(a,constants,radial_roots,polar_roots): :type a: double :param constants: dimensionless constants of motion for the orbit in the form :math:`(E,L,Q)` :type constants: tuple(double, double, double) - :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. Assumes that motion is between r1 and r2 and that roots are otherwise in ascending order. + :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. :type radial_roots: tuple(double, double, double, double) :param polar_roots: tuple containing the roots of the polar equation :math:`(z_-, z_+)` :type polar_roots: tuple(double, double) @@ -133,7 +133,7 @@ def phi_frequency_from_constants(a,constants,radial_roots,polar_roots,upsilon_r= :type a: double :param constants: dimensionless constants of motion for the orbit in the form :math:`(E,L,Q)` :type constants: tuple(double, double, double) - :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. Assumes that motion is between r1 and r2 and that roots are otherwise in ascending order. + :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. :type radial_roots: tuple(double, double, double, double) :param polar_roots: tuple containing the roots of the polar equation :math:`(z_-, z_+)` :type polar_roots: tuple(double, double) @@ -187,7 +187,7 @@ def gamma_from_constants(a,constants,radial_roots,polar_roots,upsilon_r=None,ups :type a: double :param constants: dimensionless constants of motion for the orbit in the form :math:`(E,L,Q)` :type constants: tuple(double, double, double) - :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. Assumes that motion is between r1 and r2 and that roots are otherwise in ascending order. + :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. :type radial_roots: tuple(double, double, double, double) :param polar_roots: tuple containing the roots of the polar equation :math:`(z_-, z_+)` :type polar_roots: tuple(double, double) @@ -245,7 +245,7 @@ def mino_frequencies_from_constants(a,constants,radial_roots,polar_roots): :type a: double :param constants: dimensionless constants of motion for the orbit in the form :math:`(E,L,Q)` :type constants: tuple(double, double, double) - :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. Assumes that motion is between r1 and r2 and that roots are otherwise in ascending order. + :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. :type radial_roots: tuple(double, double, double, double) :param polar_roots: tuple containing the roots of the polar equation :math:`(z_-, z_+)` :type polar_roots: tuple(double, double) @@ -253,14 +253,14 @@ def mino_frequencies_from_constants(a,constants,radial_roots,polar_roots): :return: tuple of frequencies in the form :math:`(\Upsilon_r, \Upsilon_\theta, \Upsilon_\phi, \Gamma)` :rtype: tuple(double, double, double, double) """ - upsilon_r = r_frequency_from_constants(a,constants,radial_roots) + upsilon_r = r_frequency_from_constants(constants,radial_roots) upsilon_theta = theta_frequency_from_constants(a,constants,radial_roots,polar_roots) upsilon_phi = phi_frequency_from_constants(a,constants,radial_roots,polar_roots,upsilon_r,upsilon_theta) Gamma = gamma_from_constants(a,constants,radial_roots,polar_roots,upsilon_r,upsilon_theta) return upsilon_r, abs(upsilon_theta), upsilon_phi, Gamma -def observer_frequencies_from_constants(a,constants,radial_roots,polar_roots): +def frequencies_from_constants(a,constants,radial_roots,polar_roots): r""" Computes frequencies of orbital motion in Boyer-Lindquist time using the method derived in Fujita and Hikida (arXiv:0906.1420) @@ -268,7 +268,7 @@ def observer_frequencies_from_constants(a,constants,radial_roots,polar_roots): :type a: double :param constants: dimensionless constants of motion for the orbit in the form :math:`(E,L,Q)` :type constants: tuple(double, double, double) - :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. Assumes that motion is between r1 and r2 and that roots are otherwise in ascending order. + :param radial_roots: tuple containing the four roots of the radial polynomial :math:`(r_1, r_2, r_3, r_4)`. :type radial_roots: tuple(double, double, double, double) :param polar_roots: tuple containing the roots of the polar equation :math:`(z_-, z_+)` :type polar_roots: tuple(double, double) @@ -276,7 +276,7 @@ def observer_frequencies_from_constants(a,constants,radial_roots,polar_roots): :return: tuple of frequencies in the form :math:`(\Omega_r, \Omega_\theta, \Omega_\phi)` :rtype: tuple(double, double, double) """ - upsilon_r = r_frequency_from_constants(a,constants,radial_roots) + upsilon_r = r_frequency_from_constants(constants,radial_roots) upsilon_theta = theta_frequency_from_constants(a,constants,radial_roots,polar_roots) upsilon_phi = phi_frequency_from_constants(a,constants,radial_roots,polar_roots,upsilon_r,upsilon_theta) Gamma = gamma_from_constants(a,constants,radial_roots,polar_roots,upsilon_r,upsilon_theta) diff --git a/kerrgeopy/plunging_orbit.py b/kerrgeopy/plunging_orbit.py index c319300..f4ac559 100644 --- a/kerrgeopy/plunging_orbit.py +++ b/kerrgeopy/plunging_orbit.py @@ -3,7 +3,7 @@ """ from .plunging_solutions import * from .plunging_solutions import _plunging_radial_roots -from .bound_solutions import * +from .stable_solutions import * from .orbit import Orbit import matplotlib.pyplot as plt diff --git a/kerrgeopy/plunging_solutions.py b/kerrgeopy/plunging_solutions.py index 694cede..fd87c9b 100644 --- a/kerrgeopy/plunging_solutions.py +++ b/kerrgeopy/plunging_solutions.py @@ -5,7 +5,7 @@ from numpy.polynomial import Polynomial import numpy as np from scipy.special import ellipj, ellipeinc, ellipk -from .bound_solutions import _ellippiinc +from .stable_solutions import _ellippiinc def _plunging_radial_roots(a,E,L,Q): """ @@ -33,6 +33,7 @@ def _plunging_radial_roots(a,E,L,Q): r_minus = 1-sqrt(1-a**2) + # if there are 4 real roots, by convention r4 < r3 < r2 < r1 if len(real_roots) == 4: # if there are three roots outside the event horizon swap r1/r3 and r2/r4 if real_roots[1] > r_minus: @@ -41,8 +42,9 @@ def _plunging_radial_roots(a,E,L,Q): r3 = real_roots[3] r4 = real_roots[2] else: - r1, r2, r3, r4 = real_roots + r4, r3, r2, r1 = real_roots + # in the case of two complex roots, r1 < r2 are real and r3/r4 are complex conjugates elif len(real_roots) == 2: r1, r2 = real_roots r3, r4 = complex_roots @@ -90,6 +92,7 @@ def plunging_mino_frequencies(a,E,L,Q): def plunging_radial_integrals(a,E,L,Q): r""" Computes the radial integrals :math:`I_r`, :math:`I_{r^2}` and :math:`I_{r_\pm}` defined in equation 39 of Dyson and van de Meent (arXiv:2302.03704) as a function of the radial phase. + Used to compute the radial solutions for the case of two complex roots. :param a: dimensionless spin parameter :type a: double @@ -190,7 +193,7 @@ def plunging_radial_solutions_complex(a,E,L,Q): roots = _plunging_radial_roots(a,E,L,Q) if np.iscomplex(roots).sum() != 2: raise ValueError("There should be two complex roots") - r1, r2, r3, r4 = roots + r1, r2, r3, r4 = roots # r1 < r2 are real and r3/r4 are complex conjugates rho_r = np.real(r3) rho_i = np.imag(r4) diff --git a/kerrgeopy/spacetime.py b/kerrgeopy/spacetime.py index a839530..cca019b 100644 --- a/kerrgeopy/spacetime.py +++ b/kerrgeopy/spacetime.py @@ -16,7 +16,7 @@ class KerrSpacetime: :ivar a: dimensionless angular momentum :ivar M: mass of the black hole """ - def __init__(self,a,M): + def __init__(self,a,M=None): self.a = a self.M = M diff --git a/kerrgeopy/bound_orbit.py b/kerrgeopy/stable_orbit.py similarity index 97% rename from kerrgeopy/bound_orbit.py rename to kerrgeopy/stable_orbit.py index 55c3b28..5f7d79f 100644 --- a/kerrgeopy/bound_orbit.py +++ b/kerrgeopy/stable_orbit.py @@ -3,16 +3,16 @@ """ from .constants import * from .frequencies import * -from .bound_solutions import * +from .stable_solutions import * from .units import * from .frequencies_from_constants import _radial_roots, _polar_roots from .orbit import Orbit import numpy as np import matplotlib.pyplot as plt -class BoundOrbit(Orbit): +class StableOrbit(Orbit): """ - Class representing a bound orbit in Kerr spacetime. + Class representing a stable bound orbit in Kerr spacetime. :param a: dimensionless angular momentum (must satisfy 0 <= a < 1) :type a: double @@ -53,7 +53,7 @@ def __init__(self,a,p,e,x,M = None,mu=None): self.E, self.L, self.Q = constants self.upsilon_r, self.upsilon_theta, self.upsilon_phi, self.gamma = mino_frequencies(a,p,e,x) - self.omega_r, self.omega_theta, self.omega_phi = observer_frequencies(a,p,e,x) + self.omega_r, self.omega_theta, self.omega_phi = fundamental_frequencies(a,p,e,x) def constants_of_motion(self, units="natural"): """ @@ -104,7 +104,7 @@ def mino_frequencies(self, units="natural"): raise ValueError("units must be one of 'natural', 'mks', or 'cgs'") - def observer_frequencies(self, units="natural"): + def fundamental_frequencies(self, units="natural"): r""" Computes orbital frequencies in Boyer-Lindquist time. Returns dimensionless frequencies in geometrized units by default. M and mu must be defined in order to convert to physical units. diff --git a/kerrgeopy/bound_solutions.py b/kerrgeopy/stable_solutions.py similarity index 98% rename from kerrgeopy/bound_solutions.py rename to kerrgeopy/stable_solutions.py index 1fe2bff..2f75981 100644 --- a/kerrgeopy/bound_solutions.py +++ b/kerrgeopy/stable_solutions.py @@ -38,7 +38,7 @@ def radial_solutions(a,constants,radial_roots): :type a: double :param constants: tuple of constants :math:`(E,L,Q)` :type constants: tuple(double,double,double) - :param radial_roots: tuple of roots :math:`(r_1,r_2,r_3,r_4)` + :param radial_roots: tuple of roots :math:`(r_1,r_2,r_3,r_4)`. Assumes that motion is between :math:`r_1` and :math:`r_2` and that roots are otherwise in decreasing order. :type radial_roots: tuple(double,double,double,double) :return: tuple of functions in the form :math:`(r, t^{(r)}, \phi^{(r)})` diff --git a/tests/test_orbit.py b/tests/test_stable_orbit.py similarity index 75% rename from tests/test_orbit.py rename to tests/test_stable_orbit.py index 79a063a..9823dfa 100644 --- a/tests/test_orbit.py +++ b/tests/test_stable_orbit.py @@ -1,6 +1,6 @@ import unittest import numpy as np -from kerrgeopy.bound_orbit import * +from kerrgeopy.stable_orbit import * from pathlib import Path THIS_DIR = Path(__file__).parent @@ -9,20 +9,20 @@ class TestOrbit(unittest.TestCase): def test_extreme_kerr(self): - with self.assertRaises(ValueError): BoundOrbit(1,12,0.5,0.5) + with self.assertRaises(ValueError): StableOrbit(1,12,0.5,0.5) def test_polar(self): - with self.assertRaises(ValueError): BoundOrbit(0.5,12,0.5,0) + with self.assertRaises(ValueError): StableOrbit(0.5,12,0.5,0) def test_marginally_bound(self): - with self.assertRaises(ValueError): BoundOrbit(0.5,12,1,0.5) + with self.assertRaises(ValueError): StableOrbit(0.5,12,1,0.5) def test_invalid_arguments(self): - with self.assertRaises(ValueError): BoundOrbit(2,5,0.5,0.5) - with self.assertRaises(ValueError): BoundOrbit(0.5,5,-0.5,0.5) + with self.assertRaises(ValueError): StableOrbit(2,5,0.5,0.5) + with self.assertRaises(ValueError): StableOrbit(0.5,5,-0.5,0.5) def test_unstable(self): - with self.assertRaises(ValueError): BoundOrbit(0.5,5,0.5,0.5) + with self.assertRaises(ValueError): StableOrbit(0.5,5,0.5,0.5) def test_random(self): components = ["t","r","theta","phi"] @@ -31,7 +31,7 @@ def test_random(self): for i, orbit in enumerate(orbit_values): mathematica_trajectory = np.genfromtxt(DATA_DIR / f"orbits/trajectory{i}.txt", delimiter=",") - test_orbit = BoundOrbit(*orbit) + test_orbit = StableOrbit(*orbit) t, r , theta, phi = test_orbit.trajectory() python_trajectory = np.transpose( np.apply_along_axis(lambda x: np.array([t(x),r(x),theta(x),phi(x)]),0,orbit_times) diff --git a/tests/test_bound_solutions.py b/tests/test_stable_solutions.py similarity index 97% rename from tests/test_bound_solutions.py rename to tests/test_stable_solutions.py index 001a671..92cea5c 100644 --- a/tests/test_bound_solutions.py +++ b/tests/test_stable_solutions.py @@ -1,6 +1,6 @@ import unittest import numpy as np -from kerrgeopy.bound_solutions import * +from kerrgeopy.stable_solutions import * from kerrgeopy.frequencies_from_constants import _radial_roots, _polar_roots from pathlib import Path