RF Example

An example of using LayerLumos to simulate the Shielding Effectiveness(SE), demo here is a single Ag layer

[1]:
import numpy as np
from scipy.constants import c
from layerlumos.utils import load_material, interpolate_material, load_material_RF
from layerlumos.layerlumos import stackrt, stackrt0
import matplotlib.pyplot as plt
import numpy as np
[4]:
frequencies = np.linspace(8e9, 18e9, 100)  # Convert wavelengths to frequencies

# Interpolate n and k values for SiO2 over the specified frequency range
n_k_Ag = load_material_RF('Ag', frequencies)
n_Ag = n_k_Ag[:, 1] + 1j*n_k_Ag[:, 2]  # Combine n and k into a complex refractive index

# Define stack configuration
n_air = np.ones_like(frequencies)  # Refractive index of air
d_air = np.array([0])
d_Ag = np.array([2e-8])  # Thickness of SiO2 layer in meters (e.g., 2 microns)

# Stack refractive indices and thicknesses for air-SiO2-air
n_stack = np.vstack([n_air, n_Ag, n_air]).T  # Transpose to match expected shape (Nlayers x Nfreq)
d_stack = np.vstack([d_air, d_Ag, d_air])  # No frequency dependence on thickness

# Calculate R and T over the frequency (wavelength) range
R_TE, T_TE, R_TM, T_TM = stackrt0(n_stack, d_stack, frequencies)

# Calculate average R and T
SE_TE = -10 * np.log10(T_TE)
SE_TM = -10 * np.log10(T_TM)
SE = (SE_TE + SE_TM) / 2

[5]:
# Get the Sheilding Efficiency
print(np.mean(SE))
47.49071678079014

Now we can try multiple metal layer in the structure, considering Fabry–Pérot effect

[16]:
# Interpolate n and k values for SiO2 over the specified frequency range
n_k_Ag = load_material_RF('Ag', frequencies)
n_Ag = n_k_Ag[:, 1] + 1j*n_k_Ag[:, 2]  # Combine n and k into a complex refractive index

n_k_SiO2 = load_material_RF('SiO2', frequencies)
n_SiO2 = n_k_SiO2[:, 1] + 1j*n_k_SiO2[:, 2]  # Combine n and k into a complex refractive index


# Define stack configuration
n_air = np.ones_like(frequencies)  # Refractive index of air
d_air = np.array([0])
d_SiO2 = np.array([2e-4])
d_Ag = np.array([1e-8])  # Thickness of SiO2 layer in meters (e.g., 2 microns)

# Stack refractive indices and thicknesses for air-SiO2-air
n_stack = np.vstack([n_air, n_Ag, n_SiO2, n_Ag, n_air]).T  # Transpose to match expected shape (Nlayers x Nfreq)
d_stack = np.vstack([d_air, d_Ag, d_SiO2, d_Ag, d_air])  # No frequency dependence on thickness

# Calculate R and T over the frequency (wavelength) range
R_TE, T_TE, R_TM, T_TM = stackrt0(n_stack, d_stack, frequencies)

# Calculate average R and T
SE_TE = -10 * np.log10(T_TE)
SE_TM = -10 * np.log10(T_TM)
SE = (SE_TE + SE_TM) / 2
[17]:
# Get the Sheilding Efficiency
print(np.mean(SE))
63.574706852860174