[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.7 General excitations for slabs

So far, we've mostly excited the structure with a single mode, often the fundamental one. However, by taking the right linear combination of modes, we can approximate any arbitrary incident field shape, like a gaussian or a plane wave.

To make this easier for the case of cartesian waveguides, CAMFR provides a number of variants to Stack.set_incident_field, which are illustrated in the following piece of code:

 
#! /usr/bin/env python

###################################################################
#
# Illustrates different excitations for cartesian stacks.
#
###################################################################

from camfr import *

set_N(50)
set_lambda(1.55)

GaAs = Material(3.5)
air  = Material(1.0)

set_lower_PML(-0.1)
set_upper_PML(-0.1)

slab = Slab(air(2)+ GaAs(1)+ air(2))
s = Stack(slab(1))

eps = 1e-3 # Precision for calculating overlap integrals.

# General excitation using a Python function.

A     = 1.0
x0    = slab.width()/2.
sigma = 0.5

def f(x):
  return A*exp(-0.5*((x-x0)/sigma)**2)

s.set_inc_field_function(f, eps)

# Faster variant using a built-in Gaussian excitation.

s.set_inc_field_gaussian(A, sigma, x0, eps)

# Plane wave with amplitude A and angle theta (radians).

A = 1.0
theta = 0.0
s.set_inc_field_plane_wave(A, theta, eps)

First, we define a Python function f, which describes a Gaussian. This field profile is then used as an excitation by calling s.set_inc_field_function(f, eps), where eps is the precision with which the overlap integrals are calculated. f describes the Ey field in the case of TE polarisation and the Hy field for TM.

By using Python's lambda expressions, this code could also have been written as

 
s.set_inc_field_function(lambda x : exp(-0.5*((x-2.5)/0.5)**2), eps)

This is slightly faster, because Python doesn't have to reference the global variables A, x0 and sigma.

For even greater speed, there exists a predefined Gaussian excitation:

 
s.set_inc_field_gaussian(A, sigma, x0, eps)

Finally, there is also a predefined excitation for a plane wave with amplitude A making an angle theta (in radians) with the propagation direction:

 
s.set_inc_field_plane_wave(A, theta, eps)

The accuracy which can be achieved to represent an arbitrary field is of course dependent on the number of modes used. Similarly, Gibbs phenomena can occur when modelling discontinuous functions, just like e.g. in Fourier analysis.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by root on August, 27 2008 using texi2html 1.76.