Skip to content

Adding resonance module#14

Open
TVTien83 wants to merge 16 commits intoBlackHolePerturbationToolkit:mainfrom
TVTien83:resonance
Open

Adding resonance module#14
TVTien83 wants to merge 16 commits intoBlackHolePerturbationToolkit:mainfrom
TVTien83:resonance

Conversation

@TVTien83
Copy link

@TVTien83 TVTien83 commented Apr 1, 2025

I implemented some calculation of finding resonance in a new module resonance.py, include:

  • Finding p of $r\text{-}\theta$, $r\text{-}\phi$ and $\phi\text{-}\theta$ resonant orbit
  • Finding possible $\phi$-modes, $\theta$-modes or $r$-modes for triple resonance with 2 given other modes so that
    $mode_r\cdot\omega_r=mode_\theta\cdot\omega_\theta=mode_\phi\cdot\omega_\phi$
  • Finding $z_-^2$ of $r\text{-}\theta$ and $r\text{-}\phi$ resonant orbit in the weak-field (deleted because they are't needed)
  • Frequency ratio of $r\text{-}\theta$, $r\text{-}\phi$ and $\phi\text{-}\theta$ in the equatorial limit and polar limit (used for finding triple resonance)

@TVTien83
Copy link
Author

TVTien83 commented May 23, 2025

I am sorry for changing so much after the first commit of the pull request. I've just remembered that I hadn't changed the README and the comments in this update, so I will introduce everything again. Now every option of finding resonance are unified in the generic function findResonance(a, e=None, p=None, x=None, intergers=[0, 0, 0])

  • intergers are the given tuple of resonant integers: [r-integer, theta-integer, phi-theta] satisfies
    $\omega_r\ :\ \omega_\theta\ :\ \omega_\phi=\text{r-integer}\ :\ \text{theta-integer}\ :\ \text{phi-integer}$
  • If you want to find double resonance, i.e. r-theta, r-phi or phi-theta; set the integer that you are not interested to 0. To find double resonance, you have to give two of a, e, and p; the function return the remaining one. For example:
    findResonance(0.9, e=0.6, x=0.5, integers=[1, 2, 0])
    This function also supports finding e with given (a, p, x) or x with given (a, p, e). If there is no solution, the function return Nan and give the possible range for p.
  • Specify 3 non-zero integers to find triple resonance, i.e. r-theta-phi resonance. This option only support finding (p, x) with given (a, e). If there is no solution, the function return Nan and give the possible range for the integers. Then you change 1 of the integers to the value in the corresponding interval to have a triple resonance.
  • Notice, in retrograde case, sign of x have to be same as sign of the integer ratio in case of r-phi and r-theta. In phi-theta case, the ratio >1 if it is prograde, ratio <1 if it is retrograde.
  • You shouldn't pick the integers too far from each other; the result might be too close to the separatrix that unable to find, or there might be no resonance.
    I believe this code is ready now and wait for review to see if there is any error or anything needed to be improved.

…ition of stable, make use of the existing function in resonance.py, and add option of finding triple resonance with given a and x.
@znasipak znasipak self-assigned this Oct 15, 2025
@znasipak znasipak self-requested a review October 15, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants