Dear Steven,
Thank you for your reply.
I tried to find the answers to my questions in the meep-discuss, but I am still
confused about how to set the parameters of my NTF code.
I compared my parameters and meep’s parameters.
My code:
meep
resolution=40
a=wavelength=1,Δx=Δy=a/40
a=wavelength=1, Δx=Δy =a/40
Δt=Δx/2c=a/80c time step
Δt=Δx/2=a/80
w=2*pi*c/λ=2*pi*c
c =1
w=a/λ=1
For an plane wave (incident wave) For an
plane wave,
Sin(n*wΔt), n is the number of the time steps Sin(n*wΔt), n
is the number of the time steps
Sin(n*wΔt)=sin(n*(pi/40))
Sin(n*wΔt)=sin(n*(a/80))
Therefore, for one period, n=80,
Still for n=80, The phase change is 1 per period
which means the plane wave
Propagates one wavelength for 80 time steps.
The phase change is 2pi per period
In my code, I set omiga=pi/40,
omiga=1/80
which is the phase change of the plane wave per time step.
K=2*pi/λ=2*pi
k=(2*pi/λ)/(2*pi/a)=a/λ=1
For exp(i*k*r), r=m*Δx= m*a/40 For
exp(i*k*r), r=m*a/40
r is distance. M is the number of the grids
Exp(i*k*r)= Exp (m*(2*pi/40))
Exp(i*k*r)= Exp (m/40)
I set rk=k*Δx=2*pi/40
rk=k*Δx=1/40
which is the phase change per space step
Therefore, c (the speed of light) is cancelled for my code, whose value will
not affect the result.
If my NTF code is consistent for the meep, I do need to divide the parameters
(omiga and rk) of my code by 2*pi.
However, the phase change for sin(wt) or exp(ikr) is 1 per period. Could you
tell me how you deal with this problem? I tried to find it in the source but I
just touch the c++ for a short time.
Best regards,
Lei
________________________________
From: [EMAIL PROTECTED] 代表 Steven G. Johnson
Sent: 2008-8-1 (星期五) 17:46
To: [email protected]
Subject: Re: [Meep-discuss] Questions about using meep to do near tofarfield
transformation.
On Aug 1, 2008, at 6:05 PM, Zhu, Lei wrote:
First, if I want to get scattered fields, I did the simulation twice.
One has object, one without object.
Then I use the fields (Ez, Hx, Hy) that I got with object subtract the
fields without the object. These fields are the scattered fields, right?
Yes.
Second, for my ntf code, I want to make the code match the data gotten
by meep.
I set the parameters like this:
Eps0=1
Mu0=1
Z (intrinsic impedance of free space) =1
K=1 (the wave vector of incident wave)
Omiga (angular frequency)=1
Wavelength=a=1 (also a=wavelength)
Wl=40 (resolution)
Are these parameters right?
Especially for the omiga, for my ntf code I used to set eps0, mu0… as
the real value (8.85e-12…) and omiga=pi/wl, so now how should I set the omiga
then it can match the data from meep?
Your parameters are inconsistent - if you have a wavelength = 1, then your
wavevector and omega should be 1/2pi in vacuum for c=1 units.
In Meep, when you specify frequency or wavevector it already divided by 2pi, so
a wavelength of 1 in vacuum corresponds to a wavevector with magnitude 1 and a
frequency 1. So the above is fine and consistent for Meep, but not for your
NTF code unless your NTF code also divides by 2pi implicitly like Meep does.
Steven
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss