BlackHolePerturbationToolkit / Teukolsky

A Mathematica package for computing solutions to the Teukolsky equation.
http://bhptoolkit.org/Teukolsky/
MIT License
21 stars 3 forks source link

Higher derivs #21

Closed barrywardell closed 2 years ago

barrywardell commented 2 years ago

Compute second and higher derivatives using the field equations. This is both more efficient and significantly more accurate for higher derivatives.

nielsw2 commented 2 years ago

I implemented a message if the user requests the value of the retarded field at the particle or inside the libration region (depending on the orbit). The message suggests they user uses the ["ExtendedHomogeneous" -> "H/I"] if they want the extended homogeneous solution instead.

I wonder if instead of ["ExtendedHomogeneous" -> "H/I"] we could just use ["H/I"]. The former is great to explain what is being calculating, but tedious to write each time.

For the higher derivatives I checked that the second and third derivative agree with a numerical derivative taken by interpolating the data and taking the derivative.

barrywardell commented 2 years ago

I wonder if instead of ["ExtendedHomogeneous" -> "H/I"] we could just use ["H/I"]. The former is great to explain what is being calculating, but tedious to write each time.

I wondered about this also. I decided to err on the verbose side so that the user was really clear about what is happening. To save typing the used can define an intermediate symbol, i.e.

orbit = KerrGeoOrbit[0.1, 10.0, 0.1, Cos[\[Pi]/4.]];
Psi = TeukolskyPointParticleMode[0, 2, 2, 0, 0, orbit, "Domain" -> {4, 14}]
PsiH = Psi["ExtendedHomogeneous" -> "\[ScriptCapitalH]"];

PsiH[10]

If that's still too inconvenient, then we could also introduce Psi["\[ScriptCapitalH]"] as a shorthand for Psi["ExtendedHomogeneous" -> "\[ScriptCapitalH]"].

nielsw2 commented 2 years ago

I think erring on the side of being verbose is good. We can always define the shorthand later if it is requested. If you are happy with the warning message I added we can merge this branch.

barrywardell commented 2 years ago

I will merge this now since there is general agreement that it is a good idea. I have opened a separate issue #22 to discuss whether we should also allow the shorthand Psi["[ScriptCapitalH]"].