【光学】基于Matlab实现二维光子晶体的能带图和场

1 内容介绍

为了了解电磁波在光子晶体中的传输特性,用MATLAB与时域有限差分法把电磁波在真空与光子晶体中的传播实时可视化,并给出了场的空间静态分布.数值模拟的结果表明,禁带中的波被光子晶体控制,其能量分布在介质柱中,并观察到了电磁波局域化现象.

2 部分代码

clear alllose allclc%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Constants %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

c=2.99792458e8;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%  Plotting parameter %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

band=1;

Field=1;

Epsilon=0;

AAbs=1;               %% Plot abs(E)

RReal=0;              %% Plot real(E)

IImag=0;              %% Plot imag(E)

%%%%%%%%%%%%%%%%

你可能感兴趣的:(物理应用,Matlab各类代码,matlab,开发语言,python)