Hello MEEP users,

I am facing problem with Harminv Function.
In my code I am simulating a TM111 mode in cylindrical resonator(r=10mm, h=20mm) for which the eigen-frequency is 19.44 GHz. But Harminv is giving a frequency of 18.85GHz. Setting a sharp width is also not helping.

Moreover I have simulated TE011 mode which is degenerate with TM111. For this I have used the same code but changed source as Hz and position as (0 0 0) and I am getting a very good result too.

Here's my code:


(reset-meep)

(define-param ra 10)
(define-param ha 20)

(define-param rm 12)
(define-param hm 24)

(set! geometry-lattice (make lattice (size (+ rm rm 4) (+ rm rm 4) (+ hm 4))))

(set! geometry (list
(make cylinder(center 0 0 0)(axis (vector3 0 0 1))(height hm)(radius rm)(material metal)) (make cylinder(center 0 0 0)(axis (vector3 0 0 1))(height ha)(radius ra)(material air))
))

(set-param! resolution 3)

(define-param fcen 0.0648)
(define-param df 0.01)
(set! sources(list
                (make source(src (make gaussian-src (frequency fcen) (fwidth 
df)))
                                         (center 4.89 0 7)(size 0 0 
0)(component Ez))
))

(init-fields)

(define (f_e r ex ey ez)
                (sqrt (+ (* ex ex) (* ey ey) (* ez ez)))
)

(output-field-function "electric-function" (list Ex Ey Ez) f_e)

(define (electric-output) (output-field-function "electric-function" (list Ex Ey Ez) f_e))


(define (f_m r hx hy hz)
                (sqrt (+ (* hx hx) (* hy hy) (* hz hz)))
)

(output-field-function "magnetic-function" (list Hx Hy Hz) f_m)

(define (magnetic-output) (output-field-function "magnetic-function" (list Hx Hy Hz) f_m))

(run-sources+ 200 (at-beginning output-epsilon)(after-sources (harminv Ez (vector3 5 5 5) fcen df)(at-end electric-output)(at-end magnetic-output)))

(define freq (car (map harminv-freq-re harminv-results)))
(print "frequency:" (* 299.79245 freq) "GHz\n")








_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to