Numerical Integration and Differentiation y

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Numerical Integration and Differentiation

x
0 1

How to calculate:

+1

or
0

We divide the interval defined by 0 , into N segments, each


with a length of
In other words: 1 0 =

+1 =

1 =

Numerical Differentiation

x
0 1

+1

Let us consider the point at: = +


2

The slope, which is also the derivative, should be given by:

= +

+1

Numerical Differentiation

1 2
| 0 +
+
| 0
0
2 2 0

Let us define 0 = +

= 0

+1 = 0

0 =
2

+1 0 =
2

1 2
| 0 +
+
| 0
0 +1
2 2 0 +1

= 0

|
+

0
2

+1 = 0

+1

|
+
0 2

|0 +
=

+1
= 0 =
+

1 2

+
|

2 2 0
2

1 2

+
|
2 2 0 2

Finite Difference Time Domain (FDTD)


Simulations

+
=

Specific assumptions (for this 1D problem):


The EM structure only contains z dependence.
The EM field only depends on z.
The electric field is along the x direction.
The magnetic field is along the y direction.

+ =

+ =

1
=

1
=

1D FDTD Algorithm
=

1 = 1

,1

+0.5
,1

h is cell (or step) size


is time step size

+1 = + 1
+0.5
,

We discretize EM field on
a finite set of lattices.

,
= = ; =

+0.5
,
= = +

,+1

1
1
; = +

2
2

+2 = + 2

1
=

1
=

@ =

nth FDTD cell

1D FDTD Algorithm
=

1 = 1

,1

+0.5
,1

1
=

+1 = + 1
+0.5
,

,+1

+2 = + 2

1
; =
= +
2

+0.5
0.5

,
,
,+1
,
1

=
,

=
2

,
,+1
+0.5
0.5

,
,
= ,
+

1
= +

1D FDTD Algorithm
=

1 = 1

,1

+0.5
,1

1
=

+1 = + 1
+0.5
,

,+1

+2 = + 2

+0.5
,
= = ; = +

+0.5
+0.5
+1

,
,1
,
,
1
+0.5
=
,

= + 1

+1
,

+0.5
+0.5

,
,1

+0.5
,
= ,
+

1D FDTD Algorithm
1

= 1

= 0.5

Algorithm:

+1

0.5

Set E and H field at t=0


Update E
Update H

= + 1
= + 0.5
+0.5

= + 1.5
+1.5

,
,+1
+0.5
0.5

,
,
= ,
+

+0.5
+0.5

,
,1
+1

+0.5
,
,
= ,
+

Repeat this process to obtain E and H as a function of time

Boundary Condition
PEC

1st cell

0 = 0

,1

+0.5
,1

,1
=0
+0.5
,1

1 =

,2

,2
0.5

,1
= ,1
+

1 = ( 1)

Nth cell

+0.5
,

=0
,

+0.5
,
=0

PEC

FDTD HW 1
PEC

PEC

L=30

Step 1: Set up initial values for and , i.e., ; = 0 , and ; = 0.5 .


Step 2: Evolve the EM fields according to the algorithm given in the previous slide.
Step 3: Perform a Fourier transform of the EM fields and obtain the EM field as a
function of frequency, i.e., = ; and = + 0.5 ; .
Step 4: The absolute value of Ex and Hy will have peaks in the frequency domain. Each of
these peaks. Verify this for two lowest frequency modes.

1D FDTD Project
PEC

1st cell

0 = 0

,1

+0.5
,1

1 =

,2

1 = ( 1)

Nth cell

+0.5
,

Use 30 cells to simulate the cavity. In other words, N=31.


We renormalize the unit such that 0 = 1, 0 = 1.
The units for space and time are also changed, since in this case, c=1.
We can choose = 0.5, total time steps 10,000.
Record EM field at a specific cell as a function of time.
Perform Fourier analysis to obtain the frequency of cavity modes in
such a 1D structure.

PEC

Numerical Integration: 1D

How to calculate

x
0

0 = +
2

+1

+1

+1

+1

= 0
0
2

0 =

1 2
| 0 +
+
| 0
0
2 2 0

+1
+1

1 2
| 0 +
+
| 0
0
2 2 0

= 0

+1

3
=
12

Numerical Integration: 2D

How to calculate

x
0

+1

= 0

+1

2
3

+
= +
+ 2 |0

2
24
1

+
= +
2
0
=0

Numerical Integration: 2D

How to calculate
= +1

+1

,
0

= +1

= 0 +

0
0

+1

1 1

= 0 +

, = +
=0

=0

, +
2
2

You might also like