怎么通过脚本建立一个特定MFD的TM模式光源

OtisOtis Member Posts: 1

老师您好,我之前通过mode generate脚本成功建立过光源,但是均为TE模式,不知道需要通过哪些改动利用代码生成TM模式光源?

代码如下

# define position vectors

thick_Si=0;

y_span=10e-6;

z_span=10e-6;

dh_laser=0;

degree_y=0;

degree_z=0;

wavelength=1550*1e-9;

radius_y=1e-6*1;

radius_z=1e-6*1;


z0=thick_Si/2;


x = 0;

y = linspace(-y_span/2,y_span/2,101);

z = linspace(z0-z_span/2,z0+z_span/2,101);

X = meshgrid3dx(x,y,z);

Y = meshgrid3dy(x,y,z);

Z = meshgrid3dz(x,y,z-dh_laser);


thetay = degree_y*pi/180; #injection angle

thetaz = degree_z*pi/180; #injection angle

f = c/wavelength;

w = 2*pi*f;

k = 2*pi/wavelength;

phase_correction = exp(1i*sin(thetay)*k*Y)*exp(1i*sin(thetaz)*k*Z);


# define field profile to import

Ex = 0*X;

Ey = exp( - (Y/radius_y)^2 - (Z/radius_z)^2 )*phase_correction;

Ez = 0*X;

Hx = 0*X;

Hy = 0*X;

Hz = sqrt(eps0/mu0)*Ey;


# create dataset

EM = rectilineardataset("EM fields",x,y,z);

EM.addattribute("E",Ex,Ey,Ez);

EM.addattribute("H",Hx,Hy,Hz);


cd('');

# save dataset to .mat file which can be imported

matlabsave("laser_mode.mat",EM);

Tagged:

Answers

Sign In or Register to comment.