Hello all,
I'm simulating PhC resonators by launching pulses into the system. Like
in the bend waveguide example I put a field measurement at the output to
make sure that the fields at the output are decayed enough. I put the
decay value to 1e-3.
The fields generally tend to decay first, but after a while they start
to ramp up to infinity. This cannot be a valid outcome, the pml's should
absorb all energy in the end (or am I wrong here?), so there must be a
maximum of the field values.
Has anyone seen this kind of behavior before? What can be the solution?
I have already started trying several things including removing all
holes from the PML, using a normal gaussian pulse point source without
the envelope, increasing the resolution (which seems to worsen the
problem). I'm currently experimenting with the PML strength.
My question, is it just the PML that is set wrong? Or do I do unhandy
things with the launched pulse like ramp it on too fast? Or can this
weird behavior of the simulator be explained otherwise?
I attach one typical simulation (sorry for the dirty programming in the
PhC functions) and some (un)nice field plots.
the simulation can be run with:
./runsimulation.sh resonator005 fcen=0.285 df=0.08 nfreq=1000
resolution=10
to obtain a reflection transmissionplot (octave ../retrplot.oct in
output dir)
and with:
./runsimulation.sh resonator005
to obtain the (un)nice plots below, these were obtained by running:
h5topng -t 0:143 -m -1 -M 1 -Zc dkbluered -a yarg -A
measure-eps-00.00.h5 measure-hz.h5
in the output dir (I scaled them) (note: look first how much datasets
are there after killing the simulation because it wont stop automatically).
I hope these things can also help you to improve meep, its a nice simulator.
Yours, Tjeerd Pinkert
P.S. better versions of the field plots (and a few more) can be found
at: http://www.scintilla.utwente.nl/~tjeerdp/study/fieldplots/
;
; PhC funtions for MEEP.
;
;;mylattice: (vector3 basis1) (vector3 basis2) (vector3 basis3) (vector3
basis-size) (vector3 size) -
;; (#(x y z) #(x y z) #(x y z))
;;take latice parameters and return a list of lattice coordinates in cartesian
(vector3's)
(define (mylattice basis1 basis2 basis3 basis-size size)
(let ; set locale variabelen
(
(thelattice (crystal basis1 basis2 basis3 basis-size (vector3- size
(vector3 1 1 1
)
; transpose everything half-a-lattice down
(shiftlattice thelattice (vector3* (latticesize basis1 basis2 basis3
basis-size size) (/ -2)))
)
)
;;mysqlattice: (vector3 basis1) (vector3 basis2) (vector3 basis3) (vector3
basis-size) (vector3 size)
;; mylattice
;;takes lattice parameters but makes the lattice square with regard to vector
basis1.
(define (mysqlattice basis1 basis2 basis3 basis-size size)
(let* ; set locale variabelen
(
; maak het crystal
(thelattice (crystal basis1 basis2 basis3 basis-size (vector3- size
(vector3 1 1 1
; maak het vierkant
(thelattice (makelatticesquare thelattice basis1 basis2 basis3 basis-size
size))
; shift half rooster naar beneden
(thelattice (shiftlattice thelattice (vector3* (latticesize basis1 basis2
basis3 basis-size size) (/ -2
)
thelattice
)
)
;;shiftlattice: (mylattice lattice) (vector3 shiftvector)
;; returns: mylattice
;;shifts lattice by shiftvector
(define (shiftlattice lattice shiftvector)
(if (not (null? lattice))
(begin
(append
(list
(vector3+ (car lattice) shiftvector)
)
(shiftlattice (cdr lattice) shiftvector)
)
)
(list)
)
)
;;latticesize: (vector3 basis1) (vector3 basis2) (vector3 basis3) (vector3
basis-size) (vector3 size)
;; returns: (vector3 x-size y-size z-size)
;;calculate the size of a general lattice with input parameters
(define (latticesize basis1 basis2 basis3 basis-size size)
(vector3
(max
(* (vector3-x basis1) (vector3-x basis-size) (- (vector3-x size) 1))
(* (vector3-x basis2) (vector3-x basis-size) (- (vector3-x size) 1))
(* (vector3-x basis3) (vector3-x basis-size) (- (vector3-x size) 1))
)
(max
(* (vector3-y basis1) (vector3-y basis-size) (- (vector3-y size) 1))
(* (vector3-y basis2) (vector3-y basis-size) (- (vector3-y size) 1))
(* (vector3-y basis3) (vector3-y basis-size) (- (vector3-y size) 1))
)
(max
(* (vector3-z basis1) (vector3-z basis-size) (- (vector3-z size) 1))
(* (vector3-z basis2) (vector3-z basis-size) (- (vector3-z size) 1))
(* (vector3-z basis3) (vector3-z basis-size) (- (vector3-z size) 1))
)
)
)
;;mirror-x: (mylattice lattice)
;; returns: (mylattice lattice)
;;mirrors a list of points in the x-axis
(define (mirror-x lattice)
(if (not (null? lattice))
(begin
(append
(list (vector3 (- (vector3-x (car lattice))) (vector3-y (car lattice))
(vector3-z (car lattice
(mirror-x (cdr lattice))
)
)
(list)
)
)