Hi,
I am sorry if my last post regarding this was improperly explained.
I am trying to use a chirp waveform( linear FM ) as a custom source. Hence I
am defining it as a function called 'chirp' which takes an input variable
't' (which i thought meep would automatically assume as the run-time for the
source) and returns a complex value. When I run it, I am gettin an error
saying: Unbound variable t.
Please help me troubleshoot it.
Also, I would like to confirm if MEEP automatically assumes an input
variable (to the custom-src function) to be the run-time specified for it.

Thank you,
Shravan

My code is as follows:

(define-param df .033)
(define-param fo .1)
(define-param T 50)

(define (chirp t)
(make-polar 400 (* (+ fo (- (* (/ df (* 2 T)) t) (/ df 2))) 2 pi t))
                )


(set! geometry-lattice (make lattice (size 390 384 no-size)))
(set! geometry  (list

        (make block (center -100 -10) (size 10 10 infinity)
                (material (make dielectric  (epsilon 2.5))))
        (make block (center -180 0) (size 20 384 infinity)
                (material (make dielectric  (epsilon 4.5))))
        (make block (center 0 55) (size 8 8 infinity)
                (material (make perfect-metal)))
        (make  block (center -30 20) (size 10 10 infinity )
                (material (make dielectric  (epsilon 2.5))))
        (make cylinder (center 0 70) (radius 4) (height 16) (axis 0 1 0)
        (material (make medium (epsilon 48) (D-conductivity (/ (* 2 pi 0.1
30) 48)))))))


(set! sources (list
               (make source
                 (src (make custom-src
                (src-func((chirp t))

                    (start-time 0)
                        (end-time T)
                                ))
                 (component Ez)
                 (center -194 0)
             (size 0 10)
                            ))))
(set! pml-layers (list (make pml (thickness 1)))
(set! resolution 2)
(run-until 900
           (at-beginning output-epsilon)
           (to-appended "ez" (in-volume (volume (center -194 0) (size 2
384)) (at-every 1  output-efield-z))))
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to