This notebook demonstrates how to perform simulations of a finite size suspended silicon nitride membrane with a periodic 2D array of holes and compares the results with the fully periodic case.
Periodic Simulation¶
First, we will perform a fully periodic simulation of a unit cell using periodic boundary conditions.
import matplotlib.pyplot as plt
import numpy as np
import tidy3d as td
import tidy3d.web as web
Definite wavelength and frequency ranges.
# Convert input wavelength to frequency
wl_min = 0.755
wl_max = 0.8
f_max = td.C_0 / wl_min
f_min = td.C_0 / wl_max
f0 = (f_min + f_max) / 2
f_width = f_max - f_min
Define materials used.
Vacuum = td.Medium()
SiN = td.material_library["Si3N4"]["Luke2015PMLStable"]
We define a function to set up the simulation.
def Setup_Periodic_Membrane_simulation(period, r_hole, t_slab, Nfreq, sim_time_ps):
Farray = np.linspace(f_min, f_max, Nfreq) # Array of frequency to probe
planewave_0 = td.PlaneWave(
center=[0, 0, 1.6],
size=[td.inf, td.inf, 0],
source_time=td.GaussianPulse(
freq0=f0,
fwidth=f_width,
),
direction="-",
)
fluxmonitor_0 = td.FluxMonitor(
name="fluxmonitor_0",
center=[0, 0, -1.6],
size=[td.inf, td.inf, 0],
freqs=Farray,
)
box_0 = td.Structure(geometry=td.Box(size=[td.inf, td.inf, t_slab]), medium=SiN)
cylinder_1 = td.Structure(
geometry=td.Cylinder(radius=r_hole, length=t_slab), medium=Vacuum
)
override_structure_0 = td.MeshOverrideStructure(
geometry=td.Box(size=[r_hole * 2, r_hole * 2, t_slab]),
dl=[0.04, 0.04, 0.02],
)
sim = td.Simulation(
size=[period, period, 4.2],
boundary_spec=td.BoundarySpec(
x=td.Boundary.periodic(), y=td.Boundary.periodic(), z=td.Boundary.pml()
),
grid_spec=td.GridSpec.auto(
min_steps_per_wvl=20, wavelength=(wl_min + wl_max) / 2
),
run_time=sim_time_ps * 1e-12,
sources=[planewave_0],
monitors=[fluxmonitor_0],
structures=[box_0, cylinder_1],
shutoff=1e-8,
)
return sim
We can now define the membrane geometrical parameters and visualize the geometry.
# Expressed in micrometers
period = 0.9695
r_hole = 0.1
t_slab = 0.0495
sim_time_ps = 5 # in ps
Nfreq_periodic = 251
sim3d = Setup_Periodic_Membrane_simulation(
period, r_hole, t_slab, Nfreq_periodic, sim_time_ps
)
sim3d.plot_3d()
Now, we run the simulation of the periodic structure to obtain the transmission.
sim = Setup_Periodic_Membrane_simulation(
period, r_hole, t_slab, Nfreq_periodic, sim_time_ps
)
sim_data = web.run(
sim,
task_name=f"FDTD_Periodic_SN_membrane_sim_time_ps{sim_time_ps}",
path=f"./Periodic_SN_membranesim_time_ps{sim_time_ps}.hdf5",
)
sim_air = sim.copy(update={"structures": []})
sim_data_air = web.run(
sim_air,
task_name=f"FDTD_Periodic_Air_membrane",
path=f"./Periodic_Air_membrane.hdf5",
)
monitor_data = sim_data.monitor_data
monitor_air = sim_data_air.monitor_data
# Convert input wavelength to frequency
Farray_periodic = np.linspace(
f_min, f_max, Nfreq_periodic
) # Array of frequency to probe
wl_array_periodic = td.C_0 / Farray_periodic
# Access the flux monitor by name
flux_data = monitor_data["fluxmonitor_0"].flux
flux_air = monitor_air["fluxmonitor_0"].flux
flux_periodic = flux_data / flux_air
# Plot simulation results
plt.plot(wl_array_periodic, flux_periodic, linewidth=2.5)
plt.xlabel("Wavelength (μm)")
plt.ylabel("Transmission")
plt.show()
12:07:25 Eastern Daylight Time Created task 'FDTD_Periodic_SN_membrane_sim_time_ps5' with task_id 'fdve-74f43e3a-aa43-4958-bfea-d121a747425a' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-74f43e3a-aa43-4958-bfea-d121a747425a'.
Task folder: 'default'.
Output()
12:07:26 Eastern Daylight Time Maximum FlexCredit cost: 0.025. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:07:27 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:07:35 Eastern Daylight Time starting up solver
12:07:36 Eastern Daylight Time running solver
Output()
12:07:56 Eastern Daylight Time early shutoff detected at 76%, exiting.
status = postprocess
Output()
status = success
12:07:58 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-74f43e3a-aa43-4958-bfea-d121a747425a'.
Output()
12:07:59 Eastern Daylight Time loading simulation from ./Periodic_SN_membranesim_time_ps5.hdf5
12:08:00 Eastern Daylight Time Created task 'FDTD_Periodic_Air_membrane' with task_id 'fdve-0ce21f40-a2c4-4b5b-81bb-e3ba1ee344fe' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-0ce21f40-a2c4-4b5b-81bb-e3ba1ee344fe'.
Task folder: 'default'.
Output()
12:08:01 Eastern Daylight Time Maximum FlexCredit cost: 0.025. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:08:02 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:08:10 Eastern Daylight Time starting up solver
12:08:11 Eastern Daylight Time running solver
Output()
early shutoff detected at 4%, exiting.
status = success
View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-0ce21f40-a2c4-4b5b-81bb-e3ba1ee344fe'.
Output()
12:08:12 Eastern Daylight Time loading simulation from ./Periodic_Air_membrane.hdf5

Finite Array Simulations¶
We are now ready to set up the finite size simulation. It is useful to define a function also in this case to perform stability tests of the domain and mesh sizes and then study the Fano resonance as a function of the number of cells. Beware that simulating long living photonic modes might lead to a high computational cost. Although it is possible to perform such a simulation in Tidy3D, you should carefully judge the FlexCredit cost of such simulations.
def array_cylinders(Ncells, period, r_hole, t_slab):
geometries = []
for Nx in range(0, Ncells + 1):
for Ny in range(0, Ncells + 1):
geometries.append(
td.Cylinder(
radius=r_hole,
center=[(Nx - Ncells / 2) * period, (Ny - Ncells / 2) * period, 0],
length=t_slab,
)
)
return geometries
# Finer mesh in the cylinder array
def finer_hole_mesh(Ncells, period, r_hole, t_slab):
override_structure = []
for Nx in range(0, Ncells + 1):
for Ny in range(0, Ncells + 1):
# Set Finer mesh in the holes
override_structure.append(
td.MeshOverrideStructure(
name=f"override_structure_{Nx}_{Ny}",
geometry=td.Box(
center=[
(Nx - Ncells / 2) * period,
(Ny - Ncells / 2) * period,
0,
],
size=[r_hole * 2, r_hole * 2, t_slab],
),
dl=[0.04, 0.04, 0.02],
)
)
return override_structure
def Setup_Finite_Membrane_simulation(
Ncells, period, r_hole, t_slab, Nfreq, Henv, Wside, sim_time_ps
):
W_env = (
Ncells * period + Wside
) # 2 um around structure are chosen from stability simulations
box_0 = td.Structure(geometry=td.Box(size=[td.inf, td.inf, t_slab]), medium=SiN)
geometrygroup_1 = td.Structure(
geometry=td.GeometryGroup(
geometries=array_cylinders(Ncells, period, r_hole, t_slab)
),
medium=Vacuum,
)
## Setup Source
planewave_0 = td.PlaneWave(
center=[0, 0, Henv / 2 - 0.3],
size=[td.inf, td.inf, 0],
source_time=td.GaussianPulse(
freq0=f0,
fwidth=f_width,
),
direction="-",
)
### Setup Monitors
Farray = np.linspace(
f_min, f_max, Nfreq
) # Array of frequency to probe. Values must be in increasing order
# Flux Monitor
fluxmonitor_0 = td.FluxMonitor(
name="fluxmonitor_0",
center=[0, 0, -Henv / 2 + 0.3],
size=[td.inf, td.inf, 0],
freqs=Farray,
)
sim = td.Simulation(
size=[W_env, W_env, Henv],
grid_spec=td.GridSpec.auto(
min_steps_per_wvl=20,
wavelength=(wl_min + wl_max) / 2,
override_structures=finer_hole_mesh(Ncells, period, r_hole, t_slab),
),
run_time=sim_time_ps * 1e-12,
sources=[planewave_0],
monitors=[fluxmonitor_0],
structures=[box_0, geometrygroup_1],
symmetry=(-1, 1, 0),
)
return sim
def Finite_Membrane_simulation(
Ncells, period, r_hole, t_slab, Nfreq, Henv, Wside, sim_time_ps
):
sim_finite_size = Setup_Finite_Membrane_simulation(
Ncells, period, r_hole, t_slab, Nfreq, Henv, Wside, sim_time_ps
)
sim_data = web.run(
sim_finite_size,
task_name=f"FDTD_Finite_SN_membrane_N{Ncells}_Henv{Henv}_Wside{Wside}_sim_time_ps{sim_time_ps}",
path=f"./Finite_SN_membrane_N{Ncells}_Henv{Henv}_Wside{Wside}_sim_time_ps{sim_time_ps}.hdf5",
)
sim_air = sim_finite_size.copy(update={"structures": []})
sim_data_air = web.run(
sim_air,
task_name=f"FDTD_Finite_Air_membrane_N{Ncells}_Henv{Henv}_Wside{Wside}",
path=f"./Finite_Air_membrane_N{Ncells}_Henv{Henv}_Wside{Wside}.hdf5",
)
monitor_data = sim_data.monitor_data
monitor_air = sim_data_air.monitor_data
Farray = np.linspace(f_min, f_max, Nfreq) # Array of frequency to probe
wl_array = td.C_0 / Farray
# Access the flux monitor by name
flux_data = monitor_data["fluxmonitor_0"].flux
flux_air = monitor_air["fluxmonitor_0"].flux
flux = flux_data / flux_air
# Plot simulation results
plt.plot(wl_array, flux, label=f"{Ncells:.2f}")
plt.xlabel("Wavelength (μm)")
plt.ylabel("Transmission")
plt.legend()
return wl_array, flux
We first plot the geometry for the case N=10 to check our simulation domain. We also define the size of the simulation domain.
Ncells = 10
Henv = 2.1
Wside = 8 # total length of unpatterned area around the square array of holes
sim_time_finite_size_ps = 1
Nfreq_finite_size = 101
sim3d = Setup_Finite_Membrane_simulation(
Ncells,
period,
r_hole,
t_slab,
Nfreq_finite_size,
Henv,
Wside,
sim_time_finite_size_ps,
)
sim3d.plot_3d()
Define the number of elements of the N x N array and simulate different cases.
Ncell_start = 5
Ncell_max = 30
Nstep = 5
total_flux_N = np.zeros((Nstep, Nfreq_finite_size))
for i, N in enumerate(range(Ncell_start, Ncell_max, Nstep)):
wl, flux = Finite_Membrane_simulation(
N,
period,
r_hole,
t_slab,
Nfreq_finite_size,
Henv,
Wside,
sim_time_finite_size_ps,
)
total_flux_N[i, :] = flux
12:08:13 Eastern Daylight Time Created task 'FDTD_Finite_SN_membrane_N5_Henv2.1_Wside8_sim_ti me_ps1' with task_id 'fdve-3039c6aa-ff52-4ca4-9555-140b8eda50c6' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-3039c6aa-ff52-4ca4-9555-140b8eda50c6'.
Task folder: 'default'.
Output()
12:08:14 Eastern Daylight Time Maximum FlexCredit cost: 0.126. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:08:25 Eastern Daylight Time status = preprocess
12:08:30 Eastern Daylight Time starting up solver
running solver
Output()
12:08:34 Eastern Daylight Time early shutoff detected at 12%, exiting.
status = postprocess
Output()
12:08:36 Eastern Daylight Time status = success
12:08:38 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-3039c6aa-ff52-4ca4-9555-140b8eda50c6'.
Output()
12:08:39 Eastern Daylight Time loading simulation from ./Finite_SN_membrane_N5_Henv2.1_Wside8_sim_time_p s1.hdf5
12:08:40 Eastern Daylight Time Created task 'FDTD_Finite_Air_membrane_N5_Henv2.1_Wside8' with task_id 'fdve-97331d2d-3f51-47a0-a209-0ea829c5934a' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-97331d2d-3f51-47a0-a209-0ea829c5934a'.
Task folder: 'default'.
Output()
12:08:41 Eastern Daylight Time Maximum FlexCredit cost: 0.025. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:08:48 Eastern Daylight Time status = preprocess
12:08:52 Eastern Daylight Time starting up solver
running solver
Output()
12:08:54 Eastern Daylight Time early shutoff detected at 8%, exiting.
status = postprocess
Output()
12:08:57 Eastern Daylight Time status = success
12:08:59 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-97331d2d-3f51-47a0-a209-0ea829c5934a'.
Output()
12:09:00 Eastern Daylight Time loading simulation from ./Finite_Air_membrane_N5_Henv2.1_Wside8.hdf5
Created task 'FDTD_Finite_SN_membrane_N10_Henv2.1_Wside8_sim_t ime_ps1' with task_id 'fdve-a5c7595c-eb7d-4fe6-9c66-71fc8abbb546' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-a5c7595c-eb7d-4fe6-9c66-71fc8abbb546'.
Task folder: 'default'.
Output()
12:09:01 Eastern Daylight Time Maximum FlexCredit cost: 0.246. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:09:02 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:09:06 Eastern Daylight Time status = preprocess
12:09:11 Eastern Daylight Time starting up solver
running solver
Output()
12:09:23 Eastern Daylight Time early shutoff detected at 16%, exiting.
status = success
View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-a5c7595c-eb7d-4fe6-9c66-71fc8abbb546'.
Output()
12:09:24 Eastern Daylight Time loading simulation from ./Finite_SN_membrane_N10_Henv2.1_Wside8_sim_time_ ps1.hdf5
Created task 'FDTD_Finite_Air_membrane_N10_Henv2.1_Wside8' with task_id 'fdve-fc9e235b-e232-464f-b1ad-b353adcf04b4' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-fc9e235b-e232-464f-b1ad-b353adcf04b4'.
Task folder: 'default'.
Output()
12:09:25 Eastern Daylight Time Maximum FlexCredit cost: 0.045. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:09:26 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:09:41 Eastern Daylight Time starting up solver
running solver
Output()
12:09:43 Eastern Daylight Time early shutoff detected at 8%, exiting.
status = postprocess
Output()
12:09:45 Eastern Daylight Time status = success
12:09:47 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-fc9e235b-e232-464f-b1ad-b353adcf04b4'.
Output()
12:09:48 Eastern Daylight Time loading simulation from ./Finite_Air_membrane_N10_Henv2.1_Wside8.hdf5
12:09:49 Eastern Daylight Time Created task 'FDTD_Finite_SN_membrane_N15_Henv2.1_Wside8_sim_t ime_ps1' with task_id 'fdve-abe291bc-e627-4917-8814-4828a9359c9b' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-abe291bc-e627-4917-8814-4828a9359c9b'.
Task folder: 'default'.
Output()
12:09:50 Eastern Daylight Time Maximum FlexCredit cost: 0.375. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:09:51 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:09:57 Eastern Daylight Time status = preprocess
12:10:02 Eastern Daylight Time starting up solver
running solver
Output()
12:10:16 Eastern Daylight Time early shutoff detected at 24%, exiting.
status = success
View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-abe291bc-e627-4917-8814-4828a9359c9b'.
Output()
12:10:17 Eastern Daylight Time loading simulation from ./Finite_SN_membrane_N15_Henv2.1_Wside8_sim_time_ ps1.hdf5
12:10:18 Eastern Daylight Time Created task 'FDTD_Finite_Air_membrane_N15_Henv2.1_Wside8' with task_id 'fdve-68e9b23d-4665-45a3-bb7d-d844a6684020' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-68e9b23d-4665-45a3-bb7d-d844a6684020'.
Task folder: 'default'.
Output()
12:10:19 Eastern Daylight Time Maximum FlexCredit cost: 0.071. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:10:20 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:10:31 Eastern Daylight Time starting up solver
running solver
Output()
12:10:34 Eastern Daylight Time early shutoff detected at 8%, exiting.
status = postprocess
Output()
12:10:36 Eastern Daylight Time status = success
12:10:38 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-68e9b23d-4665-45a3-bb7d-d844a6684020'.
Output()
12:10:39 Eastern Daylight Time loading simulation from ./Finite_Air_membrane_N15_Henv2.1_Wside8.hdf5
12:10:40 Eastern Daylight Time Created task 'FDTD_Finite_SN_membrane_N20_Henv2.1_Wside8_sim_t ime_ps1' with task_id 'fdve-5d59f6c0-0a12-4a46-9660-d725d2c80409' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-5d59f6c0-0a12-4a46-9660-d725d2c80409'.
Task folder: 'default'.
Output()
12:10:41 Eastern Daylight Time Maximum FlexCredit cost: 0.576. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:10:42 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:10:49 Eastern Daylight Time status = preprocess
12:10:53 Eastern Daylight Time starting up solver
running solver
Output()
12:11:13 Eastern Daylight Time status = success
View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-5d59f6c0-0a12-4a46-9660-d725d2c80409'.
Output()
12:11:14 Eastern Daylight Time loading simulation from ./Finite_SN_membrane_N20_Henv2.1_Wside8_sim_time_ ps1.hdf5
Created task 'FDTD_Finite_Air_membrane_N20_Henv2.1_Wside8' with task_id 'fdve-ec06ad0e-7acc-4a34-89a8-9f69d3932605' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-ec06ad0e-7acc-4a34-89a8-9f69d3932605'.
Task folder: 'default'.
Output()
12:11:16 Eastern Daylight Time Maximum FlexCredit cost: 0.104. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:11:25 Eastern Daylight Time status = preprocess
12:11:30 Eastern Daylight Time starting up solver
running solver
Output()
12:11:34 Eastern Daylight Time early shutoff detected at 8%, exiting.
status = postprocess
Output()
status = success
12:11:36 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-ec06ad0e-7acc-4a34-89a8-9f69d3932605'.
Output()
12:11:37 Eastern Daylight Time loading simulation from ./Finite_Air_membrane_N20_Henv2.1_Wside8.hdf5
12:11:38 Eastern Daylight Time Created task 'FDTD_Finite_SN_membrane_N25_Henv2.1_Wside8_sim_t ime_ps1' with task_id 'fdve-0bb8db1b-937c-4253-ace6-f19489393af0' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-0bb8db1b-937c-4253-ace6-f19489393af0'.
Task folder: 'default'.
Output()
12:11:40 Eastern Daylight Time Maximum FlexCredit cost: 0.756. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:11:47 Eastern Daylight Time status = preprocess
12:11:51 Eastern Daylight Time starting up solver
running solver
Output()
12:12:13 Eastern Daylight Time early shutoff detected at 36%, exiting.
status = success
12:12:14 Eastern Daylight Time View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-0bb8db1b-937c-4253-ace6-f19489393af0'.
Output()
loading simulation from ./Finite_SN_membrane_N25_Henv2.1_Wside8_sim_time_ ps1.hdf5
12:12:15 Eastern Daylight Time Created task 'FDTD_Finite_Air_membrane_N25_Henv2.1_Wside8' with task_id 'fdve-22baacd0-e51b-4f7a-84cd-be43a2639726' and task_type 'FDTD'.
View task using web UI at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-22baacd0-e51b-4f7a-84cd-be43a2639726'.
Task folder: 'default'.
Output()
12:12:17 Eastern Daylight Time Maximum FlexCredit cost: 0.143. Minimum cost depends on task execution details. Use 'web.real_cost(task_id)' to get the billed FlexCredit cost after a simulation run.
12:12:18 Eastern Daylight Time status = queued
To cancel the simulation, use 'web.abort(task_id)' or 'web.delete(task_id)' or abort/delete the task in the web UI. Terminating the Python script will not stop the job running on the cloud.
Output()
12:12:29 Eastern Daylight Time starting up solver
running solver
Output()
12:12:33 Eastern Daylight Time early shutoff detected at 8%, exiting.
status = success
View simulation result at 'https://tidy3d.simulation.cloud/workbench?taskId =fdve-22baacd0-e51b-4f7a-84cd-be43a2639726'.
Output()
12:12:34 Eastern Daylight Time loading simulation from ./Finite_Air_membrane_N25_Henv2.1_Wside8.hdf5

Finally, we compare the results obtained for the fully periodic structure and the finite size structure.
plt.figure(figsize=(10, 6))
plt.plot(wl_array_periodic, flux_data / flux_air, label=f"Periodic", linewidth=2.5)
for i, N in enumerate(range(Ncell_start, Ncell_max, Nstep)):
plt.plot(wl, total_flux_N[i, :], label=f"N={N}", linewidth=2.5)
plt.xlim(wl_min, wl_max)
plt.ylim(0.58, 0.83)
plt.xlabel("Wavelength (um)")
plt.ylabel("Transmission")
plt.legend(
ncol=1, loc="lower left", columnspacing=0.5, handletextpad=0.3, handlelength=1.2
)
