Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulating a large step-index fibre #372

Open
ojphi20 opened this issue Nov 1, 2024 · 4 comments · May be fixed by #373
Open

Simulating a large step-index fibre #372

ojphi20 opened this issue Nov 1, 2024 · 4 comments · May be fixed by #373

Comments

@ojphi20
Copy link

ojphi20 commented Nov 1, 2024

Hi Chris and John,

I'm new to Julia (so apologies in advance for any rookie errors!) and I want to use Luna to simulate a solid-core step-index fibre that is very large with a very short pulse in the UV. These lead to quite a large number of allowed modes.

a = 300e-6 # With the other parameters, the highest I can set this to is 5e-6
NA = 0.22
flength = 1
fr = 0.18
τfwhm = 200e-15
λ0 = 250e-9
energy = 1e-6

When I modify the step_modeAvg_env.jl file to update these parameters. It gives me the error ERROR: DomainError with no non-zero initial points found.: . I tracked this down to an issue with the findneff function. I've been gradually playing with the parameters to try and work out where the error comes in and it seems to occur when doing something which will increase the number of modes in the fibre by a large amount. Is this a limitation from having too many modes or is there a way around this?

Any advice is greatly appreciated.

Thanks,
Oliver

@chrisbrahms
Copy link
Collaborator

Hi,

Could you put the whole script in here so we can reproduce this error? You must have changed the wavelength limits on the grid and the StepIndexMode since you changed the central wavelength to 250 nm.

Thanks.

@ojphi20
Copy link
Author

ojphi20 commented Nov 7, 2024

Here it is:


# propagation in step index fibre

using Luna

# multi mode fibre at 256 nm
a = 300e-6 # 5e-6
NA = 0.22
flength = 2.0
fr = 0.18
τfwhm = 200e-15
λ0 = 256e-9
energy = 1e-6

grid = Grid.EnvGrid(flength, λ0, (150e-9, 450e-9), 1e-12)

m = StepIndexFibre.StepIndexMode(a, NA, accellims=(150e-9, 450e-9, 100))
aeff = let aeffc=Modes.Aeff(m, z=0.0)
    z -> aeffc
end
densityfun = z -> 1.0

linop, βfun!, β1, αfun = LinearOps.make_const_linop(grid, m, λ0)

responses = (Nonlinear.Kerr_env((1 - fr)*PhysData.χ3(:SiO2)),
             Nonlinear.RamanPolarEnv(grid.to, Raman.raman_response(grid.to, :SiO2, fr*PhysData.ε_0*PhysData.χ3(:SiO2))))

inputs = Fields.GaussField(λ0=λ0, τfwhm=τfwhm, energy=energy)
Eω, transform, FT = Luna.setup(grid, densityfun, responses, inputs, βfun!, aeff)

statsfun = Stats.default(grid, Eω, m, linop, transform)
output = Output.MemoryOutput(0, grid.zmax, 201, statsfun)
Luna.run(Eω, grid, linop, transform, FT, output)

##
Plotting.pygui(true)
#Plotting.stats(output)
Plotting.prop_2D(output, :λ, dBmin=-40.0,  λrange=(200-9, 300e-9), trange=(-2e-12, 2e-12))
#Plotting.time_1D(output, [0.0, 2.5, 5.0], trange=(-5e-12, 5e-12))
Plotting.spec_1D(output, [0.0, 2.5, 5.0], λrange=(200-9, 300e-9))

@chrisbrahms
Copy link
Collaborator

So far I've traced the problem to the fact that for such short wavelengths, one of the besselk evaluations in the characteristic equation evaluates to 0.0 within floating-point precision. This is then divided by, which turns everything into NaNs, and hence the root-finding algorithm fails. Haven't found a solution yet.

@chrisbrahms chrisbrahms linked a pull request Nov 14, 2024 that will close this issue
@chrisbrahms
Copy link
Collaborator

Hi @ojphi20
Sorry this has languished a while. We haven't had a chance to properly review #373 which addresses at least part of this issue. Just to check--is this still relevant for you?

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 a pull request may close this issue.

2 participants