begin
import Pkg
Pkg.activate(joinpath(@__DIR__, ".."))
using CoupledDipole
using CairoMakie
end
Core-shell orientation-averaged spectra
This notebook evaluates simulate_core_shell with three interaction settings:
sphere-mediated coupling + self-reaction (
full),sphere-mediated coupling without mediated self-reaction (
no self-reaction),no sphere-mediated dipole-dipole coupling (
uncoupled).
The output matrix columns are: [cext, cabs, csca, dext, dabs, dsca, cd_ext, cd_abs, cd_sca], all normalized per shell dipole.
begin
wavelengths = collect(380.0:2.0:580.0)
rho_dye = 0.5
tensor_type = 1 # isotropic radial
position_type = 1 # fibonacci
medium = 1.33
R0 = 3.0
d = 0.5
N_inc = 8
N_sca = 10
N_mie = 16
N_esa = 120
N_theta = 241
end
241
begin
x_full = simulate_core_shell(
rho_dye,
tensor_type,
position_type,
wavelengths,
medium,
R0,
d,
N_inc;
N_sca=N_sca,
N_mie=N_mie,
N_esa=N_esa,
N_theta=N_theta,
coupling=true,
self_reaction=true,
)
x_no_self = simulate_core_shell(
rho_dye,
tensor_type,
position_type,
wavelengths,
medium,
R0,
d,
N_inc;
N_sca=N_sca,
N_mie=N_mie,
N_esa=N_esa,
N_theta=N_theta,
coupling=true,
self_reaction=false,
)
x_uncoupled = simulate_core_shell(
rho_dye,
tensor_type,
position_type,
wavelengths,
medium,
R0,
d,
N_inc;
N_sca=N_sca,
N_mie=N_mie,
N_esa=N_esa,
N_theta=N_theta,
coupling=false,
self_reaction=true,
)
@assert all(isfinite, x_full)
@assert all(isfinite, x_no_self)
@assert all(isfinite, x_uncoupled)
end
let
fig = Figure(size=(900, 390))
ax1 = Axis(fig[1, 1], xlabel="Wavelength / nm", ylabel="Extinction / nm² per dye")
ax2 = Axis(fig[1, 2], xlabel="Wavelength / nm", ylabel="Differential absorption / nm² per dye")
lines!(ax1, wavelengths, x_full[:, 1], label="full")
lines!(ax1, wavelengths, x_no_self[:, 1], label="no self-reaction")
lines!(ax1, wavelengths, x_uncoupled[:, 1], label="uncoupled")
axislegend(ax1, position=:rt)
lines!(ax2, wavelengths, x_full[:, 5], label="full")
lines!(ax2, wavelengths, x_no_self[:, 5], label="no self-reaction")
lines!(ax2, wavelengths, x_uncoupled[:, 5], label="uncoupled")
axislegend(ax2, position=:rt)
fig
end