
实验项目:FDTD方法模拟电磁波传播
班级:
姓名:
学号:
指导教师:
实验日期:
一、 实验目的要求
1、了解数值方法的基本原理,熟悉时域有限差分方法(FDTD)的计算思路。
2、学习Matlab语言,学习编程的基本技巧和编程思路。
3、加强对电磁波理论的了解。
4、形象展示电磁波的传播过程。
二、 实验内容
利用FDTD(时域有限差分法)方法模拟电磁波传播过程
三、 实验结果
四、 原程序
五、附录(matlab程序)
%FDTD_1.1.m. 1D FDTD simulation in free space
clear all
max_time = 400;
max_space=200;
eta=1/2;
E=zeros(max_space,1); %Initialize Electric array
H=E; %Initialize Magnetic array
center_problem_space=max_space/2; % center of the problem space
t0=40; % center of the incident pulse
spread=12; % width of the incident pulse
for n=1:max_time
%Inner loop E-Increments electric wave in space
for k=2:max_space
E(k)=E(k)+eta *( H(k-1)-H(k) );
end
%Hardsource-imposes a value on the grid
pulse=exp((-0.5)*( (t0-n)/spread )^2);
E(center_problem_space )=pulse + E(center_problem_space );
for j=1:(max_space-1)
H(j)=H(j)+eta*(E(j)-E(j+1));
end
%plot progreesion of the electric wave
figure(1);
plot(E);
%axis([1 max_space -1.1 1.1]);
title('FDTD Simulation of and electric pulse in Free Space');
xlabel('problem space');
ylabel('E_x');
pause(0.00001);
end
%Plots electric and magnetic fields at max_time
figure(2);
subplot(2,1,2);
plot(E,'r');
title('Simulation of Electric Pulse');
ylabel('E_x');
axis([0 max_space -1.1 1.1]);
subplot(2,1,1);
plot(H,'g');
ylabel('H_y');
title('Simulation of Magnetic Pulse');
axis([0 max_space -1.1 1.1]);
六、心得体会
通过这次实验,加深了我对C语言以及MATLAB的理解以及运用,锻炼了我的程序编写能力,同时初步了解了电磁工程仿真与设计的相关知识。
