S4 icon indicating copy to clipboard operation
S4 copied to clipboard

Change the angle of incidence,and outputs the fresnel coefficients

Open samehole opened this issue 5 years ago • 0 comments

Hi everyone,

I am trying to use S4 to generate some reflection/transmission curves changing the angle of incidence. The code that I am using is the following one: S = S4.NewSimulation() S:SetLattice({1,0}, {0,1}) S:SetNumG(1)

-- Material definition S:AddMaterial("Dielectric", {4,0}) -- real and imag parts S:AddMaterial("Vacuum", {1,0})

S:AddLayer( 'Above', --name 0, --thickness 'Vacuum') --background material S:AddLayer('Slab1', 10, 'Dielectric') S:AddLayer('Slab2', 10, 'Vacuum') S:AddLayer('Below', 0, 'Vacuum')

S:SetFrequency(1);

for angle=0,90,1 do S:SetExcitationPlanewave( {angle,0}, -- incidence angles (spherical coordinates: phi in [0,180], theta in [0,360]) {0,0}, -- s-polarization amplitude and phase (in degrees) {1,0}) -- p-polarization amplitude and phase inc1,backward1 = S:GetPoyntingFlux('Above', 0) forward1 = S:GetPoyntingFlux('Below', 0) backward1 = -backward1/inc1 forward1 = forward1/inc1

S:SetExcitationPlanewave(
	{angle,0}, -- incidence angles (spherical coordinates: phi in [0,180], theta in [0,360])
	{1,0},     -- s-polarization amplitude and phase (in degrees)
	{0,0})     -- p-polarization amplitude and phase
inc2,backward2 = S:GetPoyntingFlux('Above', 0)
forward2       = S:GetPoyntingFlux('Below', 0)
backward2 = -backward2/inc2
forward2  =  forward2/inc2

print(angle .. '\t' .. forward1 .. '\t' .. backward1 .. '\t' .. forward2 .. '\t' .. backward2);

end ` Light is transmitted from the medium with a refractive index of 2 to the air, and total reflection should occur at 30 degrees, but no total reflection occurs in the S4 calculation.

samehole avatar Jul 31 '19 09:07 samehole