资源简介
用FDTD方法计算电磁波,在前一百不电磁波在自由空间中传播,后一百步在有耗介质中传播,并观察波形的变化。
代码片段和文件信息
#include
#include
#include
#define KE 200
#define pi 3.14159
void main()
{float ex[KE]hy[KE]cb[KE];
int nknstepskstart;
float pulse;
float Tddxdtepsilon;
float freq_in;
float ex_low_m1ex_low_m2ex_high_m1ex_high_m2;
FILE *fp;
for(k=0;k {ex[k]=0;
hy[k]=0;
cb[k]=0;
ex_low_m1=0;
ex_low_m2=0;
ex_high_m1=0;
ex_high_m2=0;}
ddx=0.01;
dt=ddx/(2*3e8);
printf(“Dielectric starts at-->“);
scanf(“%d“&kstart);
printf(“Epsilon-->“);
scanf(“%f“&epsilon);
printf(“%d %6.2f \n“kstartepsilon);
printf(“Input freq(MHz)-->“);
scanf(“%f“&freq_in);
freq_in=freq_in*1e6;
printf(“%8.0f \n“freq_in);
for(k=1;k {cb[k]=0.5;}
for(k=kstart;k {cb[k]=0.5/epsilon;}
- 上一篇:LabVIEW调用库函数节点.rar
- 下一篇:C++ HMAC SHA1
评论
共有 条评论