beam-tracing / Scotty

Beam tracing code for diagnostics
https://scotty.readthedocs.io/en/latest/
GNU General Public License v3.0
8 stars 4 forks source link

Attempt to more robustly find entry point #112

Closed ZedThree closed 1 year ago

ZedThree commented 1 year ago

Fixes #111

Now uses a the roots of a polynomial fit to the poloidal flux along a straight line from the launch position to make an initial guess as to the entry point, before using more the accurate root finder.

This does unfortunately change the initial Psi R-zeta component a little. @valerian-chen Does it make sense to enforce those components to be exactly zero when launching the beam?

@fongkenrui Please could you check this for your cases?

fongkenrui commented 1 year ago

Sorry just saw this, I've tested a bunch of different parameters in the -1 to -3 toroidal steering range and they all turned out fine, so I think this solves the issue.

valerian-chen commented 1 year ago

@ZedThree I don't understand why Psi_{R,zeta) changes at all compared to the previous method. I can definitely see situations where it should not be zero. Perhaps we should have a call?

valerian-chen commented 1 year ago

Just summarising our chat: the issue is that Psi has some very large components and some smaller ones, so the tolerances have to be adjusted correctly. I should really have normalised quantities for Scotty.