Re: [Meep-discuss] Resolution dependence silver nanosphere

2013-05-30 Thread neal skinner
I agree with Gursoy, your resolution appears to be too low. His rule of
thumb of a minimum of 8 (I actually prefer 10 - 20) pixels or grid points
for one wavelength is good for wave propagation in lossless dielectrics.
Lossy materials, like real metals typically need much higher resolution. My
rule of thumb is that you need a minimum of 1 or 2 grid points per skin
depth of your lossy material. You can calculate skin depth from the n and k
(real and imaginary parts of refractive index) of silver around your
wavelength of interest.

Another piece of advice that has been expressed many times in this mailing
list is to run several simulations each with increased resolution until you
get two successive results that do not change much.

Good luck,

Neal


On Thu, May 30, 2013 at 2:23 AM, gursoy akguc akgu...@yahoo.com wrote:

 I think your resolution is way low for this system. as far as I can see
 your geometry is 700nm cube
 res 32 means your pixel cell size is about 22nm. source is 363nm and in
 the dielectric material you use 8 it means wavelength is about 45nm.  rule
 of thumb is 1 wavelength needs to be represented by 8 pixels, but your 8
 pixels makes 176nm about 4 times higher than wavelength.
 my suggestion is to use 120resolution minimum to see some meaningful
 result comparable to Mie.

 Gursoy B. Akguc

*From:* niels jelsma c.j.m.jel...@student.rug.nl
 *To:* meep-discuss@ab-initio.mit.edu
 *Sent:* Wednesday, May 29, 2013 2:23 PM
 *Subject:* [Meep-discuss] Resolution dependence silver nanosphere

 Dear All,

 I'm trying to calculate the dipolemoment of a silver nanosphere in Meep.
 In the end I am interested in looking at a chain of spheres and the
 transmittance, p_last / p_first.

 However for just a single sphere I don't understand what values I have
 to choose for the resolution to get proper results.
 I've read on the mailing list that I should choose a resolution that
 gives at least 8pixels/wavelength and then double the resolution to get
 better results.
 However, increasing the resolution this way sometimes gives me worse
 results.

 A simplified version of my script can be found here:
 https://gist.github.com/maxnuf/5669273

 I've setup a sphere with radius 25nm in 3d space and a continuous source
 as plane-wave.
 After running it for a while to get into a steady-state I integrate the
 Polarization in a volume containing the sphere to find the dipolemoment.

 I expect to find a peak near the resonant frequency. So I run the
 simulation for several input source wavelengths.

 However, for different resolutions, I get completely different results.
 I don't know what to do to remedy my problem.

 As can be seen in this figure:
 http://postimg.org/image/kua54kwq9/

 At a resolution 32 I see a sort of dip where I expect the resonant
 frequency (which should be at 363nm according to Mie theory)

 I'm using Meep 1.2 and a Drude-model for my silver sphere.

 How can I determine which resolutions are suitable?

 Thanks,
 Niels


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



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

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

[Meep-discuss] Problem with the simulation of an opal

2013-05-30 Thread Marc Zöller

Hi everybody,

I'm fairly new to meep and have a problem with the simulation of an opal 
structure.
By searching in google I found a discussion from 2006 about a code for 
multilayer opals in which a code was posted that worked for a simple 
opal. Still I get transmissions larger that one. Anyone here with an 
idea why that happens?


Here is the code:



; transmittance/reflectance of a fcc structure a=1.
(set! eps-averaging? false); No epsilon averaging

;---EXTERNAL PARAMETERS---
(define-param r_sph 0.36); Oxide spheres radius
(define-param r_max (/ 1 (sqrt 6))); Thickness of the Si layer grown 
inside the opal

(define-param nl 3) ; number of periods = (3 layers each)
(define-param pmlt 2) ; thickness of the pml
(define-param pad 3); distance between source and sample
(define-param no-phc 1) ; if true (1), have air, false (0), PhC

;--CELL DIMENSIONS-
(define unitcell (sqrt 3)) ; size of the unitcell in Z
(define distz (/ 1 (sqrt 3))); distance between single layers
(define sx (/ 1 (sqrt 2))) ; size of cell in X direction
(define sy (sqrt 1.5)) ; size of cell in Y direction
(define sz (+ (* 2 pad) (* 2 pmlt) (round (+ 0.5 (* nl unitcell) ; 
size of cell in Z direction


(set! geometry-lattice (make lattice (size sx sy sz)))

;--USEFUL VALUES
(define sx_half (/ sx 2)); (1/sqrt(8))
(define sy_half (/ sy 2)); (sqrt(3)/sqrt(8))
(define sy_sixth (/ sy 6)); (1/sqrt(3x8))
(define nsx_half (/ sx -2)); -(1/sqrt(8))
(define nsy_half (/ sy -2)); -(sqrt(3)/sqrt(8))
(define nsy_sixth (/ sy -6)); -(1/sqrt(3x8))
(define cell_center (* unitcell (+ 0.5 (* -0.5 nl; z-coordinate of 
the first unit cell
(define bottom_sample (+ (* unitcell (- nl 1)) cell_center distz (/ 1 
(sqrt 8  ; Z coordinate bottom of spheres

(define substrate_centerZ (+ (/ sz 4) (/ bottom_sample 2)))
(define substrate_sizeZ (- (/ sz 2) bottom_sample))

;MATERIALS---
(define silica (make dielectric (epsilon (* 1.45 1.45
(define silicon (make dielectric (epsilon (* 3.5 3.5

;--GEOMETRY-
(set! geometry
   (if (= no-phc 1)
  (list
(make sphere (center 0 0 0) (radius r_sph) (material air))
(make block (center 0 0 substrate_centerZ) (material silicon)
  (size sx sy substrate_sizeZ)) ; substrate
 )
 (append

;OPAL OF Si SPHERES
(geometric-objects-duplicates (vector3 0 0 unitcell) 0 (- nl 1)
  (list
;Layer A - thin Si
(make sphere (center nsx_half nsy_sixth (- cell_center distz))
  (radius r_max)
 (material silicon))
(make sphere (center sx_half nsy_sixth (- cell_center distz))
   (radius r_max)
 (material silicon))
(make sphere (center 0 (+ nsy_sixth nsy_half) (- cell_center
  distz)) (radius r_max)
 (material silicon))
(make sphere (center 0 (* 2 sy_sixth) (- cell_center distz))
 (radius r_max)
 (material silicon))
;Layer B - thin Si
(make sphere (center nsx_half sy_half cell_center)
 (radius r_max)
 (material silicon))
(make sphere (center nsx_half nsy_half cell_center)
 (radius r_max)
 (material silicon))
(make sphere (center sx_half sy_half cell_center) (radius r_max)
 (material silica))
(make sphere (center sx_half nsy_half cell_center)
 (radius r_max)
 (material silicon))
(make sphere (center 0 0 cell_center) (radius r_max)
 (material silicon))
;Layer C - thin Si
(make sphere (center nsx_half sy_sixth (+ cell_center distz))
   (radius r_max)
 (material silicon))
(make sphere (center sx_half sy_sixth (+ cell_center distz))
   (radius r_max)
 (material silicon))
(make sphere (center 0 (+ sy_sixth sy_half) (+ cell_center
   distz)) (radius r_max)
 (material silicon))
(make sphere (center 0 (* 2 nsy_sixth) (+ cell_center distz))
  (radius r_max)
 (material silicon))
))

;OPAL OF OXIDE SPHERES
(geometric-objects-duplicates (vector3 0 0 unitcell) 0 (- nl 1)
  (list
;Layer A - oxide
(make sphere (center nsx_half nsy_sixth (- cell_center distz))
 (radius r_sph)
 (material silica))
(make sphere (center sx_half nsy_sixth (- cell_center distz))
 (radius r_sph)
 (material silica))
(make sphere (center 0 (+ nsy_sixth nsy_half) (- cell_center
  distz)) (radius r_sph)
 (material silica))
(make sphere (center 0 (* 2 sy_sixth) (- cell_center distz))

[Meep-discuss] Photonic Crystal Fiber

2013-05-30 Thread Ahmad Razif Muhammad
Hi everyone :) 
can somebody help me with the codes of Solid Core Photonics Crystal Fiber? ive 
need it to calculate the transmission spectra..
really need it.. 
thanks in advance___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss