RFC: neff for large step-index fibre #373
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to fix #372
The problem with very large step-index fibres is that the
w
parameter becomes very large:Luna.jl/src/StepIndexFibre.jl
Line 141 in 38ce40b
Then in two terms in the characteristic equations you need to calculate the ratio of modified Bessel functions:
Luna.jl/src/StepIndexFibre.jl
Line 147 in 38ce40b
For large
w
(>800), one or both ofbesselk
andbesselkp
evaluates to zero within floating-point precision, so we cannot compute the ratio properly.This PR fixes this by adopting an approximate expression for the ratio of
besselkp
andbesselk
when either are zero. The basic point is that K_n(x) approaches the same limit regardless of the value of n: https://dlmf.nist.gov/10.25#E3So then the ratio of K_n and K_(n-1) approaches 1, which in turn leads to the approximate expression here.
With this I can run the following example, which is basically #372
And I get these plots of the characteristic equation and its roots. Note that I had to set
xatol=0
infind_zeros
because the roots get very close together.