1%1D FDTD Simulation with a simple absorbing boundary condition2% andA TFSF boundary between hy[49] andEz[50]. 3% Dielectric material located ez[100]4SIZE = 400;5LOSS = 0.01;6Loss_layer =250;7EZ = Zeros (1, SIZE);8hy = Zeros (1,size-1);9Ceze = Zeros (1, SIZE);TenCezh = Zeros (1, SIZE); OneChyh = Zeros (1,size-1); AChye = Zeros (1,size-1); -imp0=377.0; -MaxTime = 10000; the%Initialize update coefficient - forMM = 1:1: SIZE-1 - ifMM < 100 -Ceze (mm) = 1.0; +Cezh (mm) =imp0; - Else ifMM <Loss_layer +Ceze (mm) = 1.0; ACezh (mm) = imp0/9.0; at Else -Ceze (mm) = (1-loss)/(1 +LOSS); -Cezh (mm) = imp0/9/(1 +LOSS); - End - - End in End - forMM = 1:1: SIZE-1 to ifMM <Loss_layer +CHYH (mm) = 1.0; -Chye (mm) = 1.0/imp0; the Else *CHYH (mm) = (1-loss)/(1 +LOSS); $Chye (mm) = 1.0/imp0/(1 +LOSS);Panax Notoginseng - End the End + forQtime = 0:1: MaxTime A% hy (SIZE) =hy (SIZE-1); the +%Update magnetic field - forMM = 1:1: SIZE-1 $Hy (mm) = hy (mm) *chyh (mm) + (EZ (mm+1)-EZ (mm)) *Chye (mm); $ End -% correction forHy adjacent to TFSF boundary */ -Hy (=hy)-exp (-(qTime-30) * (qTime-30)/100)/imp0; the -Figure (1);WuyiSubplot (211); t_hy =plot (HY); theTitle'Magnetic Field'); - Wu%ABC -EZ (1) =ez (2); About% EZ (SIZE) =ez (SIZE-1); $ - forMM = 2:1: SIZE-1 -EZ (mm) = EZ (mm) *ceze (mm) + (hy (mm)-hy (mm-1)) *Cezh (mm); - End A% Figure (2); +Subplot (212); theT_ez =plot (EZ); -Title'Electric Field') $EZ (Wuyi) = EZ (ON) + exp (-(qtime+0.5-( -0.5) -30.0) * (qtime+0.5-(-0.5)-30.0)/100.0); the the% Pause (0.01); the% %RefreshData (t_hy); the%RefreshData (T_ez); -%Drawnow; inEnd
Propagation of waves between matched media