Optics Simulation

Dan Piehl - 12/08/2002
Graduate-Level Project
82-507 Physical Optics

1. Introduction

This project has the goal of simulating electromagnetic waves in a limited space so that various optical phenomena can be explored. A Visual Basic program will be created to display the propagation of light through space.

2. Discrete Space and Time

The magnitude of the electric and magnetic fields can be assigned to many small portions of space arranged in a 3-dimensional matrix. The computer can then store a floating-point value corresponding to electric and magnetic components of the vector field. This requires 6 values (3 for the E-vector, 3 for the B-vector) for each "cell" of space in which the simulation will carry out its transition from one moment in time to the next. All behavior will be "local", so that a transition to a new state can be calculated deterministically from the current state of the cell, along with the states of its immediate neighbors.

3. Approximating Maxwell's Equations

Using the partial differential symbol , in partial differential form, we have several equations which resemble the following:
Ez / y - Ey / z = -Bx / t

Replacing the infinitesimals with finite differences, we can establish corresponding equations that look like the following:
DEz / Dy - DEy / Dz = -DBx / Dt

After some algebra, we can establish the change of each component:
- Dt ( DEz / Dy - DEy / Dz ) = DBx

To determine each change approximately, the neighboring cells can be examined. For instance, Ez is a function of x,y,z. Therefore, to determine DEz / Dy at a particular location, we need only examine the two neighboring cells at (x , y+1 , z) and (x , y-1 , z). In this case, Dy=2, so we have DEz / Dy = ( DEz(x,y+1,z) - DEz(x,y-1,z) ) / 2 .

After all such changes are determined, the program can then apply the changes in a straight-forward manner:
Bx' = Bx + DBx

4. Practical Considerations

For convenience, let the component sizes of each cell (Dx, Dy,Dz) be equal and referenced as Ds. Although it is desirable to make both Ds and Dt as small as possible, the computational speed of the simulation is affected by this. There are also concerns about how much memory is exhausted, so for this application the entire simulation space will be limited to about 1800 nanometers (nm) with varying degrees of granularity (20x20, 50x50, etc). The z-axis will be reduced to only one layer of cells to improve speed, although the simulation will be limited to cases where both Ez and Bz are constant along the z-axis. Nevertheless, this is adequate to demonstrate a range of effects.

In the case where the simulation is working with relatively small cells in the 50x50 matrix, each cell will be approximately 36nm wide. To limit losses due to numerical approximation, the time units then should be somewhat smaller than that distance divided by the speed of light ( Dt < Ds / c ). In the 50x50 matrix, this works out to 120 attoseconds (as) as an upper bound for Dt. To allow for relatively smooth propagation, the program will allow a selection of values values from 60as down to 10as.

5. Results

A cylindrical wave and a plane wave are simulated by the program with the wavefronts moving on the computer display in the expected manner. Additionally, a dielectric constant can be included to show wave refraction.

Cylindrical Wave:
Cylindrical

Plane Wave:
Plane

Refracted Wave (after coding a dielectric constant):
Refracted

The following is the Visual Basic project:

optics.frm - Visual Basic Form declaration and source code
optics.exe - Program can be executed here (VB runtime DLL's required)

Return to Dan's Home Page
email
Last Update: December 10, 2002