eje temporal

# From the Meep tutorial: plotting permittivity and fields of a straight waveguide
import meep as mp
cell     = mp.Vector3(10, 10, 0)
geometry = [mp.Block(mp.Vector3(0.1, 0.1, mp.inf),center=mp.Vector3(4,4),material=mp.Medium(epsilon=1.1),)]
sources = [mp.Source(mp.ContinuousSource(frequency=0.8), component=mp.Ez, center=mp.Vector3(0, 0))]
pml_layers = [mp.PML(1.0)]
resolution = 10
sim = mp.Simulation(cell_size=cell,boundary_layers=pml_layers,geometry=geometry,sources=sources,resolution=resolution,)
sim.run(mp.at_beginning(mp.output_epsilon),mp.to_appended("ez", mp.at_every(0.05, mp.output_efield_z)),until=20)
Initializing structure...
time for choose_chunkdivision = 8.29697e-05 s
Working in 2D dimensions.
Computational cell is 10 x 10 x 0 with resolution 10
     block, center = (4,4,0)
          size (0.1,0.1,1e+20)
          axes (1,0,0), (0,1,0), (0,0,1)
          dielectric constant epsilon diagonal = (1.1,1.1,1.1)
time for set_epsilon = 0.019645 s
-----------
creating output file "./eps-000000.00.h5"...
creating output file "./ez.h5"...
run 0 finished at t = 20.0 (400 timesteps)
import h5py
import numpy as np
# Abre el archivo HDF5 en modo lectura
with h5py.File('eps-000000.00.h5', 'r') as f:
    # Muestra las claves principales del archivo
    print(f"Claves principales del archivo: {list(f.keys())}")
with h5py.File('eps-000000.00.h5', 'r') as f:
 dataset = f['eps']
 data_array = np.array(dataset)
import matplotlib.pyplot as plt
plt.imshow(data_array)
import h5py
import numpy as np
# Abre el archivo HDF5 en modo lectura
with h5py.File('ez.h5', 'r') as f:
    # Muestra las claves principales del archivo
    print(f"Claves principales del archivo: {list(f.keys())}")
with h5py.File('ez.h5', 'r') as f:
 dataset2 = f['ez']
 data_array2 = np.array(dataset2)
Scanned-Document

import math
shapes = data_array2.shape
d = 1e-6
c = 3e8
untill = 20

ti = 0
tf = untill
dt =  (tf-ti)/shapes[2]
time = np.zeros(shapes[2])
signal = np.zeros(shapes[2])
auxi1     = np.zeros(shapes[2])
auxi2     = np.zeros(shapes[2])



    

fi = 0.5
ff = 1.0
Nf = 100
df = (ff-fi)/Nf
Vf = np.zeros(Nf)
VFT    = np.zeros(Nf)




    

for iff in range(Nf):
 f = fi+iff*df
 Vf[iff] = f

 auxi3 = 0
 auxi4 = 0

 for i in range(shapes[2]):
  time[i] = ti+i*dt
  signal[i] = data_array2[50,50,i]
  auxi1[i] = math.cos(2.0*math.pi*f*time[i])
  auxi2[i] = math.sin(2.0*math.pi*f*time[i])
  auxi3=auxi3+signal[i]*auxi1[i]
  auxi4=auxi4+signal[i]*auxi2[i]
 auxi5 = math.sqrt(auxi3*auxi3+auxi4*auxi4)
 VFT[iff]=auxi5