Hi Liu,
The proper way to use "material-function" is to give its property
"epsilon-func" the value of a scheme function. The function value
given to "epsilon-func" must take one argument, position (and position
only), and should return the dielectric constant at that point. For
example, the following works:
(material-function
(epsilon-func
(lambda
(position)
(+ 2
(cos
(* 2 pi
(/ (vector3-x position) 10)
)
)
)
)
)
)
It looks awful, but it's really quite simple. This makes epsilon vary
sinusoidally in the x direction with a period of 10. See the libctl
user reference for more info on programming scheme functions like
this. From your example it looks like you're trying to make an
isotropic frequency-dependent material instead! To do this, use your
material like this (taken from Meep Tutorial/Material Dispersion):
(set! default-material
(make dielectric (epsilon 2.25)
(E-polarizations
(make polarizability
(omega 1.1) (gamma 1e-5) (sigma 0.5))
(make polarizability
(omega 0.5) (gamma 0.1) (sigma 2e-5))
)))
But you need to change the "sigma, gamma, omega" values above to make
a specific series of Lorentz-poles that fit data for silver. If
you're doing research, I've got some models for the nobel metals that
I use in MEEP which I could share. Some have very many Lorentz-poles
though, so their usefulness is limited by the amount of memory on your
computer.
Best,
Alex
____________________________________________________________________
Alexander S. McLeod
B.A. Physics and Astrophysics - University of California at Berkeley
Simulation Engineer - Theory Group, Molecular Foundry (LBNL)
Site Lead - Network for Computational Nanotechnology at Berkeley / MIT
[email protected] 707-853-0716
____________________________________________________________________
On Oct 30, 2009, at 8:02 AM, [email protected]
wrote:
From: Liu Yan <[email protected]>
Date: October 29, 2009 9:53:30 PM PDT
To: [email protected]
Subject: [Meep-discuss] code error in epsilon-func?
Hi everyone,
When I compile the silver dispersion material with my own epsilon-
function using meep, the result shows that there is an error:
"ERROR: In procedure *:
ERROR: Wrong type: #<procedure frequency (x)>"
I specified the epsilon-function as below
"(material-function
(make epsilon-func (- 5 (/ 7.66 (- (* 2 pi frequency 2 pi
frequency) (* i 0.0796 2 pi frequency)))))
)"
What is wrong with this problem? Anyone can help me?
Thank yo
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss