Skip to content

Commit

Permalink
more plotting, peak power for gaussian, window thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbrahms committed Apr 27, 2024
1 parent 4773576 commit 1d1b1ef
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 35 deletions.
58 changes: 45 additions & 13 deletions src/Compressor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
entrance_window=true, exit_window=true)
factor = τfwhm_in/τfwhm_out

ρcrit = critical_density(gas, λ0, τfwhm_in, energy)
ρcrit = critical_density(gas, λ0, τfwhm_in, energy; shape=:gauss)
ρ = ρcrit/S_sf
pr = pressure(gas, ρ)
n2 = n2_gas(gas, pr)
Expand All @@ -26,7 +26,7 @@ function optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
@debug(@sprintf("pressure: %.3f bar", pr))
@debug(@sprintf("n₂: %.4e m²/W", n2))

_, P0 = T0P0(τfwhm_in, energy)
_, P0 = T0P0(τfwhm_in, energy; shape=:gauss)

φm = nonlinear_phase(factor)

Expand Down Expand Up @@ -92,12 +92,12 @@ function params_maxlength(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
thickness=1e-3, material=:SiO2, Bmax=0.2, S_sf=1.5,
entrance_window=true, exit_window=true, LIDT=2000, S_fluence=5)

ρcrit = critical_density(gas, λ0, τfwhm_in, energy)
ρcrit = critical_density(gas, λ0, τfwhm_in, energy; shape=:gauss)
ρ = ρcrit/S_sf
pr = pressure(gas, ρ)
n2 = n2_gas(gas, pr)

_, P0 = T0P0(τfwhm_in, energy)
_, P0 = T0P0(τfwhm_in, energy; shape=:gauss)

broadfac_req = τfwhm_in/τfwhm_out
φnl_req = nonlinear_phase(broadfac_req)
Expand Down Expand Up @@ -134,7 +134,8 @@ end
function plot_optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
thickness=1e-3, material=:SiO2, Bmax=0.2, S_sf=1.5, S_ion=10,
entrance_window=true, exit_window=true, LIDT=2000, S_fluence=5,
amin=25e-6, amax=500e-6, Na=512)
amin=25e-6, amax=500e-6, Na=512,
dot=nothing)
factor = τfwhm_in/τfwhm_out

f = params_maxlength(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
Expand All @@ -151,6 +152,8 @@ function plot_optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
flength = getindex.(params, :flength)
t = getindex.(params, :transmission)
intensity = getindex.(params, :intensity)
window_distance = getindex.(params, :window_distance)
Ltot = flength .+ (entrance_window ? window_distance : zero(flength)) .+ (exit_window ? window_distance : zero(flength))
P0 = params[1].P0
pr = params[1].pressure

Expand All @@ -160,41 +163,67 @@ function plot_optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
global aopt, flopt, _, topt = optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
thickness, material, Bmax, S_sf, S_ion, LIDT, S_fluence, entrance_window, exit_window)
global intopt = P0/(A0*aopt^2)
global optparams = f(aopt)
catch e
global aopt = missing
end

if ~isnothing(dot)
dotparams = f(dot)
end

fig = plt.figure()
fig.set_size_inches(15, 4)
plt.subplot(1, 4, 1)
plt.plot(1e6a, broadfac)
if ~ismissing(aopt)
plt.plot(1e6aopt, factor, "o"; color="k", label=@sprintf("%.1f μm", 1e6aopt))
end
if ~isnothing(dot)
plt.plot(1e6dot, dotparams.broadening_factor, "o"; color="b", label=@sprintf("%.1f μm", 1e6dot))
end
plt.axhline(factor; linestyle="--", color="k", label="Required")
plt.xlim(1e6.*extrema(a))
plt.ylim(ymin=0)
plt.legend()
plt.legend(;frameon=false, fontsize=10)
plt.xlabel("Core radius (μm)")
plt.ylabel("Broadening factor")


plt.subplot(1, 4, 2)
plt.plot(1e6a, flength)
plt.plot(1e6a, flength; label="HCF")
plt.plot(1e6a, Ltot, "--"; label="Total")
if ~ismissing(aopt)
plt.plot(1e6aopt, flopt, "o"; color="k", label=@sprintf("%.3f m", flopt))
plt.legend()
Ltot_opt = (flopt
.+ (entrance_window ? optparams.window_distance : 0)
.+ (exit_window ? optparams.window_distance : 0)
)
plt.plot(1e6aopt, flopt, "o"; color="k", label=@sprintf("%.2f m", flopt))
plt.plot(1e6aopt, Ltot_opt, "o"; fillstyle="none", color="k", label=@sprintf("%.2f m", Ltot_opt))
end
if ~isnothing(dot)
Ltot_dot = (dotparams.flength
.+ (entrance_window ? dotparams.window_distance : 0)
.+ (exit_window ? dotparams.window_distance : 0)
)
plt.plot(1e6dot, dotparams.flength, "o"; color="b", label=@sprintf("%.2f m", dotparams.flength))
plt.plot(1e6dot, Ltot_dot, "o"; fillstyle="none", color="b", label=@sprintf("%.2f m", Ltot_dot))
end
plt.legend(;frameon=false, fontsize=10)
plt.xlim(1e6.*extrema(a))
plt.ylim(ymin=0)
plt.xlabel("Core radius (μm)")
plt.ylabel("Fibre length (m)")
plt.ylabel("Length (m)")

plt.subplot(1, 4, 3)
plt.plot(1e6a, 100*t)
if ~ismissing(aopt)
plt.plot(1e6aopt, 100*topt, "o"; color="k", label=@sprintf("%.1f %%", 100*topt))
plt.legend()
plt.legend(;frameon=false, fontsize=10)
end
if ~isnothing(dot)
plt.plot(1e6dot, 100dotparams.transmission, "o"; color="b", label=@sprintf("%.1f %%", 100dotparams.transmission))
plt.legend(;frameon=false, fontsize=10)
end
plt.xlim(1e6.*extrema(a))
plt.ylim(ymin=0)
Expand All @@ -206,11 +235,14 @@ function plot_optimise(τfwhm_in, τfwhm_out, gas, λ0, energy, maxlength;
plt.axhline(Isupp*1e-4/S_ion; linestyle="--", color="r", label="Limit")
if ~ismissing(aopt)
plt.plot(1e6aopt, intopt*1e-4, "o"; color="k", label=@sprintf("%.2e W/cm\$^{-2}\$", intopt*1e-4))
plt.legend()
end
if ~isnothing(dot)
intdot = P0/(A0*dot^2)
plt.plot(1e6dot, intdot*1e-4, "o"; color="b", label=@sprintf("%.2e W/cm\$^{-2}\$", intdot*1e-4))
end
plt.xlim(1e6.*extrema(a))
plt.ylim(0, 2*Isupp*1e-4/S_ion)
plt.legend()
plt.legend(;frameon=false, fontsize=10)
plt.xlabel("Core radius (μm)")
plt.ylabel("Intensity (W/cm\$^{-2}\$)")

Expand Down
20 changes: 20 additions & 0 deletions src/Data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ function n2_solid(material)
elseif material == :CaF2
# Ensley Optics Express Vol. 27, No. 26 / 23 December 2019
return 1.8e-20
elseif material == :CaCO3
# Kabaciński et al., 10.1364/OE.27.011018
return 3.22e-20
else
error("Unkown glass $material")
end
end

function elastic_limit(material)
# https://www.crystran.co.uk/media/wysiwyg/Datasheets/design-of-pressure-windows_1.pdf
if material == :SiO2
return 55e6
elseif material == :MgF2
return 49.6e6
elseif material == :CaF2
return 36.5e6
elseif material == :Al2O3
return 276e6
else
error("Unkown glass $material")
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/Design.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Design
import PyPlot: plt, PyCall
import PyPlot: plt
import Polynomials: Polynomial, roots
import Luna: PhysData
import Luna.Plotting: cmap_colours
Expand Down
Loading

0 comments on commit 1d1b1ef

Please sign in to comment.