示例#1
0
thz_time = 0  # 0 fs
# Find indices
thz_loc_ind = np.argmin(np.abs(np.subtract(z, thz_loc)))
thz_time_ind = np.argmin(np.abs(np.subtract(t, thz_time)))
# Find start and end indices in time
spread = 3500
thz_time_ind_start = thz_time_ind - spread
thz_time_ind_end = thz_time_ind + spread
# Make pulse
thzpulse = np.append(
    np.diff(
        np.diff(
            np.exp(-((t[thz_time_ind_start:thz_time_ind_end] - thz_time)**2) /
                   (8e-27)))), [0, 0])
# Create Current object
thzpulse = Current(thz_loc_ind, thz_time_ind_start, ilen, nlen, thzpulse)

# ----------------------------------
# Define the dynamic material bounds
# ----------------------------------
#  Set material length
material_length = 0.050e-6  # 50 nm
# Set locations
material_start = 0
material_end = material_start + material_length
# Find indices
material_ind_start = np.argmin(np.abs(np.subtract(z, material_start)))
material_ind_end = np.argmin(np.abs(np.subtract(z, material_end)))
# Determine matrix length in indices
material_ind_len = material_ind_end - material_ind_start
示例#2
0
cp_loc_val = -50  # -250 um
cp_time_val = 0  # 0 fs
# Find current indicies
cp_loc_ind = np.argmin(np.abs(np.subtract(z, cp_loc_val)))
cp_time_ind = np.argmin(np.abs(np.subtract(t, cp_time_val)))
# Find current start and end indicies in time
spread = int(500 / 1)  # (500 fs) / (1 fs/step) = 500 steps
cp_time_s = cp_time_ind - spread
cp_time_e = cp_time_ind + spread
# Make pulse
cpulse = np.append(
    np.diff(
        np.diff(np.exp(-((t[cp_time_s:cp_time_e] - cp_time_val)**2) / (2e4)))),
    [0, 0])
# Create Current object
current = Current(nlen, ilen, cp_time_s, cp_loc_ind, cpulse)

# ==============
# SETUP MATERIAL
# ==============
# Set material length
m_len_val = 1000  # 1000 um = 1mm
# Set locations
m_s_val = 0
m_e_val = m_s_val + m_len_val
# Find indicies
m_s_ind = np.argmin(np.abs(np.subtract(z, m_s_val)))
m_e_ind = np.argmin(np.abs(np.subtract(z, m_e_val)))
# Set constants
inf_perm = 4
a = np.complex64(2)
示例#3
0
cp_z_val = -0.5e-6  # -0.5 um
cp_n_val = 0  # 0 fs
# Find indicies
cp_z_ind = np.argmin(np.abs(np.subtract(z, cp_z_val)))
cp_n_ind = np.argmin(np.abs(np.subtract(t, cp_n_val)))
# Find start and end indicies in time
spread = 3500
cp_n_start = cp_n_ind - spread
cp_n_end = cp_n_ind + spread
# Make pulse
cpulse = np.append(
    np.diff(
        np.diff(np.exp(-((t[cp_n_start:cp_n_end] - cp_n_val)**2) / (8e-27)))),
    [0, 0])
# Create Current object
thzpulse = Current(cp_z_ind, cp_n_start, ilen, nlen, cpulse)

# -------------------------
# Setup material dimensions
# -------------------------
# Set material length
m_len_val = 0.05e-6  # 50 nm
# Set locations
m_z_start_val = 0
m_z_end_val = m_z_start_val + m_len_val
# Calculate indices
m_z_start_ind = np.argmin(np.abs(np.subtract(z, m_z_start_val)))
m_z_end_ind = np.argmin(np.abs(np.subtract(z, m_z_end_val)))
# Determine matrix length in indicies
m_len_ind = m_z_end_ind - m_z_start_ind