资源描述:
《一维FDTD色散媒质》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、%%%%%%%%Frequency-dependentmedia%%%%%%%%%%%%%%%%MoreonOne-dimensionalsimulation2_3%%%%%%%%%%%%%%%%1DFDTDsimulation%%%%%%%%KE=200;%%%%%%%%spacelong%%%%%%%%ex=zeros(1,KE+1);hy=zeros(1,KE+1);dx=zeros(1,KE+1);ix=zeros(1,KE+1);sx=zeros(1,KE+1);ga=zeros(1,KE+1);gb=zeros(1,KE+1);gc=zer
2、os(1,KE+1);mag=zeros(1,KE+1);arg=zeros(1,3);%%%%%%%%RealandimaginarypartsoftheFourierTransform%%%%%%%%real_pt=zeros(3,KE+1);imag_pt=zeros(3,KE+1);%%%%%%%%AmplitudeandphaseoftheFourierTransform%%%%%%%%ampn=zeros(3,KE+1);phasen=zeros(3,KE+1);%%%%%%%%Amplitudeandphaseofinputpulse%%
3、%%%%%%amp_in=zeros(1,3);phase_in=zeros(1,3);%%%%%%%%FourierTrans.ofinputpulse%%%%%%%%real_in=zeros(1,3);imag_in=zeros(1,3);%%%%%%%%Parameters%%%%%%%%ex_low_m1=0;ex_low_m2=0;ex_high_m1=0;ex_high_m2=0;T=0;NSTEP=500;%%%%%%%%timestep%%%%%%%%kc=KE/2;%%%%%%%%Mediuminterface%%%%%%%%t0=
4、50;%%%%%%%%Gaussianpulseparameter%%%%%%%%spread=10;%%%%%%%%Gaussianpulseparameter%%%%%%%%ddx=0.01;%%%%%%%%setthecellsizeto1cm%%%%%%%%dt=ddx/(2*3e8);%%%%%%%%calculatethetimestep%%%%%%%%freq_in=7*1e8;%%%%%%%%signalfrequency%%%%%%%%epsilon=2;%%%%%%%%relativedielectricconstant%%%%%%
5、%%kstart=100;%%%%%%%%positionofthedielectricmedium%%%%%%%%epsz=8.85419e-12;%%%%%%%%absolutedielectricconstant%%%%%%%%sigma=0.01;%%%%%%%%conductivity%%%%%%%%chil=2;tau=1e-9;%%%%%%%%signalfrequency%%%%%%%%freq=[50.e6,200.e6,500.e6];fori=1:3arg(i)=2*pi*freq(i)*dt;end%%%%%%%%initial
6、izetofreespace%%%%%%%%forn=1:KE+1ga(n)=1;gb(n)=0;gc(n)=0;enddel_exp=exp(-dt/tau);forn=kstart:KE+1ga(n)=1/(epsilon+(sigma*dt/epsz)+chil*dt/tau);gb(n)=sigma*dt/epsz;gc(n)=chil*dt/tau;endforn=1:NSTEPT=T+1;%%%%%%%%calculatedxfield%%%%%%%%fork=2:KE+1dx(k)=dx(k)+0.5*(hy(k-1)-hy(k));en
7、d%%%%%%%%insertsource%%%%%%%%pulse=exp(-0.5*(t0-T)^2/spread^2);%%%%%%%%sin(2*pi*freq_in*dt*T);%%%%%%%%dx(5)=dx(5)+pulse;%%%%%%%%calculateExfromdx%%%%%%%%fork=2:KE+1ex(k)=ga(k)*(dx(k)-ix(k)-del_exp*sx(k));ix(k)=ix(k)+gb(k)*ex(k);sx(k)=del_exp*sx(k)+gc(k)*ex(k);end%%%%%%%%calculat
8、etheFouriertransformofEx%%%%%%%%fork=2:KE+1fori