Computer Lab 6: Lecture 20

In our computer lab lectures we will work together through concepts and challanges we have discussed over the week in class.  As with your after-class Exercises, you will be expected to turn in your computer lab notebooks before the nect lecture. Please do so by e-mailing your completed *nb file to Lan Yu (ece329.uiuc@gmail.com), make sure you name the file using the following notation: “Exn_Last_First.nb”, where n is the Lecture number (in this case, 20), and First and Last would be your first and last name.  So my submission to Lan for this computer lab would be titled “Ex20_Wasserman_Dan.nb”.  You will receive full credit for your computer lab if it turned in before the next lecture (Lecture n+1).  No late submissions will be accepted.

Objective/Overview:

In class this week we discussed the wave equation, and solutions to the wave equation, including monochromatic waves and d’Alembert solutions.  In our exercises, we spent a lot of time modeling these propagating waves, and understanding how they are generated, and how they propagate through space (both E and H).  Today we are going to look more closely at energy and energy transport in these systems.

Energy in Maxwell’s Equations

We are going to manipulate Maxwell’s Equations a bit, because when we are done, we are going to have an expression that describes energy in our system.  Let’s start with:
∇×(OverVector[E])=-((∂(OverVector[B]))/(∂t))			∇×(OverVector[H])=(OverVector[J])+((∂(OverVector[D]))/(∂t))
We’ll take the dot product of the first expression with (OverVector[H]), and of the second with (OverVector[E])
(OverVector[H])·(∇×(OverVector[E]))=(OverVector[H])·(-∂(OverVector[B])/∂t)	(OverVector[E])·(∇×(OverVector[H]))=(OverVector[E])·((OverVector[J])+((∂(OverVector[D]))/(∂t)))
We combine the two equations to get:
(OverVector[H])·(∇×(OverVector[E]))-(OverVector[E])·(∇×(OverVector[H]))=(OverVector[H])·(-∂(OverVector[B])/∂t)-(OverVector[E])·((OverVector[J])+((∂(OverVector[D]))/(∂t)))
Using the vector identity: ∇·((OverVector[A])×(OverVector[B]))=(OverVector[B])·((OverVector[∇])×(OverVector[A]))-(OverVector[A])·((OverVector[∇])×(OverVector[B])), we get:
∇·((OverVector[E])×(OverVector[H]))=μ(OverVector[H])·((d(OverVector[H]))/(dt))-(OverVector[E])·(OverVector[J])-ϵ(OverVector[E])·((d(OverVector[E]))/(dt)), combining terms, we get:
∇·((OverVector[E])×(OverVector[H]))-(∂/(∂t))((μ/2)(OverVector[H])·(OverVector[H])+(ϵ/2)(OverVector[E])·(OverVector[E]))-(OverVector[E])·(OverVector[J])=0  POYNTING THEOREM
Each of these terms is related to energy in some way.
1. ∇·((OverVector[E])×(OverVector[H])) is the divergence of the Poynting Vector.  It essentially tells us whether a point in space is a “sink” or “source” of energy, in the same way that the divergence of the electric field tells us whether that point in space is a source or sink of electric field (positive or negative charge)
2. (∂/(∂t))((μ/2)(OverVector[H])·(OverVector[H])+(ϵ/2)(OverVector[E])·(OverVector[E])) gives the time rate of change of the energy stored in the Electric and Magnetic Fields.  Remember, we determined that energy stored in a capacitor is (ϵ/2)(OverVector[E])·(OverVector[E]), and in an inductor is (μ/2)(OverVector[H])·(OverVector[H]).  This applies generally to the power stored in any field.
3. (OverVector[E])·(OverVector[J]) is the Joule Heating term, which represents the power absorbed per unit volume, and can only be non-zero in the presence of a current density.  It is important to note that the Poynting Theorem assumes a current density (OverVector[J])(x,y,z) in units [A/(m^2)].  For a surface current at z=0, we would express this as (OverVector[J])=δ(z=0)(Subscript[J, s]) [A/(m^2)]...this makes the units work out...but in today’s lecture we will generally ignore the delta function
Together, these three terms make up the Poynting Theorem, and describe a conservation of energy for a system with propagating waves and a source.

Setting Up Our System

Let’s look at energy in our source/wave system.  We can start with a current density, on the xy plane, given by (OverVector[J])=Cosωt (OverHat[x])A/m.

js[w_,t_]:=Cos[w*t]

jplot=Animate[Graphics[{Red,Arrowheads[0.1],Arrow[{{0,0},{js[1,t],0}}]},PlotRange->{{-1,1},{-1,1}}],{t,-5,5}]

We know that from this, we can find our wave form

h1[w_,t_,z_]:=Piecewise[{{-js[w,t-z/300]/2, z>0},{js[w,t+z/300]/2, z<0}}]

h1plot=Animate[Plot[h1[1,t,z],{z,-2400,2400}],{t,-5,5}]

e1[w_,t_,z_]:=Piecewise[{{-120*Pi*js[w,t-z/300]/2, z>0},{-120*Pi*js[w,t+z/300]/2, z<0}}]

e1plot=Animate[Plot[e1[1,t,z],{z,-2400,2400}],{t,-5,5}]

Can we put this all together in one plot that shows what is going on?  Well, we will need to do this in 3D, since our fields are pointing in different directions.
Let’s try the Parametric Plot in 3D, and let’s scale our E field down by η=120π so it has the same amplitude as our H field

paraplot=ParametricPlot3D[{{0,h1[1,0,z*300],z},{e1[1,0,z*300]/(120*Pi),0,z}},{z,-5,5}]

I had to play some tricks here, essentially scaling our z-axis by a factor of 300, so that the plot wasn’t super long and skinny.
Can we animate this?

paraplott[w_,t_]:=ParametricPlot3D[{{0,h1[w,t,z*300],z},{e1[w,t,z*300]/(120*Pi),0,z}},{z,-5,5}, PlotRange->{All,All,All}]

jplott[w_,t_]:=Graphics3D[{Red,Arrowheads[0.05],Arrow[{{0,0,0},{js[w,t],0,0}}]}]
line=Graphics3D[Line[{{-1,-1,0},{1,1,0}}]];

Animate[Show[jplott[1,t],paraplott[1,t],line],{t,-5,5}]

I use the Line graphic here just to fix the xy scale of the plot so it isn’t constantly changing...
But this gives us an excellent picture of a current source (shown by the red arrow) generating an H field at the source surface, which in turn generates an E field, both of which are propagating away from the surface.  Note, again, that the E field is continuous at the xy plane, and the H field flips in sign.

Visualizing the Poynting Theorem

The Poynting Theorem tells us what is happening to energy in our system.  We can solve for each term in the expression if we know J(t), because J(t) gives us E(t,z) and H(t,z).  So let’s approach this term by term.
First, we start with ∇·((OverVector[E])×(OverVector[H])), which is the divergence of the Poynting Vector.  It essentially tells us whether a point in space is a “sink” or “source” of energy, in the same way that the divergence of the electric field tells us whether that point in space is a source or sink of electric field (positive or negative charge)

poynting1=Simplify[Cross[{e1[w,t,z],0,0},{0,h1[w,t,z],0}]]

Plot[poynting1[[3]]/.{w->1,t->0},{z,-2400,2400}]

dpoyn1=Simplify[Div[poynting1,{x,y,z}]]

Plot[dpoyn1/.{w->1,t->0},{z,-2400,2400}]

Animate[Plot[dpoyn1/.{w->1,t->to},{z,-2400,2400}],{to,-5,5}]

The second term of the Poynting Theorem Expression is (∂/(∂t))((μ/2)(OverVector[H])·(OverVector[H])+(ϵ/2)(OverVector[E])·(OverVector[E])), which gives the time rate of change of the energy stored in the Electric and Magnetic Fields.  We can find this too!  Let’s assume propagation in vacuum, so μ=(Subscript[μ, o]) and ϵ=(Subscript[ϵ, o])

muo=1.2566;epso=8.85*10^-6; (*Note that because we are writing our c in μs, so c=300m/μs, we have to scale both μ and ϵ by (10^6)*)

storedenergy=Simplify[(muo/2)*h1[w,t,z]*h1[w,t,z]+(epso/2)*e1[w,t,z]*e1[w,t,z]]

dstoredenergy=D[storedenergy,t]

Plot[dstoredenergy/.{w->1,t->0},{z,-2400,2400}]

This is the change in the energy stored in the E and H fields.  Let’s compare this to our energy transported:

Plot[{dstoredenergy/.{w->1,t->0},dpoyn1/.{w->1,t->0}},{z,-2400,2400}]

Let’s think about what this means.  We clearly see that the sum of the change in our stored energy is equal and opposite to the divergence of our transported energy.  At a give point in space, as the energy stored in the E and H field decreases, that energy has to go somewhere...it is transported in the z-direction...Stored energy leaves the E,H fields at this position and moves in space.  As the stored energy increases, we have a positive change in our stored energy wrt time, that energy has to come from somewhere, and it comes from energy transported through space.  We can animate this:

Animate[Plot[{dstoredenergy/.{w->1,t->to},dpoyn1/.{w->1,t->to}},{z,-2400,2400}],{to,-5,5}]

But what are we missing?

The Source!

We have determined already what it going on with energy in the regions away from the source. In particular, we saw that the sum of the divergence of the Poynting Vector and the time derivative of the energy stored in the E and H fields is equal to zero.  Because we have no J in this region, the third term in the Poynting Therom is 0, and our equality holds.  But what is happening at the source?  Here we clearly have a (OverVector[J]).  So let’s determine that third term, which corresponds to Joule Heating.

e0=-120*Pi*js[w,t]/2

jheat=js[w,t]*e0

We see that (OverVector[J])·(OverVector[E]) is always <0, which means that our current is acting as a source, generating electromagnetic energy.  What about the rest of the Poynting Theorem at z=0?
∇·((OverVector[E])×(OverVector[H]))-(∂/(∂t))((μ/2)(OverVector[H])·(OverVector[H])+(ϵ/2)(OverVector[E])·(OverVector[E]))-(OverVector[E])·(OverVector[J])=0

The first term is the sum of the energy leaving the source, which we have to consider on each side of the current sheet, (SuperPlus[0]) and (SuperMinus[0]).

poyn0plus=Simplify[Cross[{-120*Pi*js[w,t-z/300]/2,0,0},{0,-js[w,t-z/300]/2,0}]/.{z->0}]

poyn0min=Simplify[Cross[{-120*Pi*js[w,t+z/300]/2,0,0},{0,js[w,t+z/300]/2,0}]/.{z->0}]

Note that we have calculated the Poynting Flux on either side of the source.  The divergence of the Poynting Vector is simply the flux of the Poynting Vector leaving the z=0 plane...so instead of taking the divergence of the forward and backward propgating waves (which will be discontinuous at z=0) we just recognize that the Divergence (flux) of the Poynting Vector is going to be |poyn0plus|+|poyn0min|

divpoyn0=Abs[poyn0plus[[3]]]+Abs[poyn0min[[3]]]

We see that this is equal and opposite to the power generated by our source!!  So again, our Poynting Theorem hold!  Note: in an infinitesimal volume at z=0, stored field goes to 0, so the second term doesn’t come into play.

Time Averaged Energy (Power)

We have clearly shown the different components of the Poynting Theroem, and how the Theorem holds everywhere in space. If we are interested in power flow, we can best describe this using time averaging.
For the rest of class we are going to look at average power flow/generation.  To calculate this, we are going to need to integrate our time-dependent terms and determine the time-averages of each.  Note that for harmonic waves, all you have to do is integrate over 1 cycle of the wave (T=2π/ω) and then divide by T to find the time-average, since the waves are periodic in time with a period T.
Use your expression for the Poynting Vector to find the time averaged power flow vs. z, on either side of the source:

tavepoyn=

Now use your expression to find the time average of the power emitted by the source

tavesource=

What do you notice about these values?
Answer:
What about the time averaged energy stored in the fields?
This is an excellent question.  If you think about what we have just solved for, we first calculated the power flow away from the source via the time-average Poynting Vector...this is the AVERAGE energy/time transported away from the source.  We then calculated the AVERAGE total power generated by the source by averaging (OverVector[J])·(OverVector[E]), note that this is the generated power integrated over all space (but integrating the delta function in space just returns 1).  To see how the energy stored in the field plays in to this, we need to figure out what the average rate of change of the energy stored in the fields is.
We know the energy stored in the fields is:

storedenergy

Find the rate of change of this energy:

rocstored=D[storedenergy,t]

We see that the rate of change of the stored energy in the fields is proportional to Sin,Cos.  For any given time t, if we integrate this over all of space, we get 0, since the integral of a Sin*Cos function over all space has to be 0.  Thus, there is no change in the total energy stored in the fields...all of the energy generated by the source is transported away, in the +/- direction, by the EM waves....