# Plotting the Poynting vector of a radiating electric dipole [matlab]

TSny
Homework Helper
Gold Member
I'm fairly sure Jackson's equations are correct. I used them to get the equations for E and B in post #15 and these equations agree with what I find in a couple of other textbooks.

• PhDeezNutz
I'm fairly sure Jackson's equations are correct. I used them to get the equations for E and B in post #15 and these equations agree with what I find in a couple of other textbooks.
Then I must have interpreted them wrong/ converted them wrong. I'm glad you made this post so I don't have to start from scratch. updated gif with waves propagating outwards as they should. Still don't know why certain frames have more contours than others.

Edit: I think it has something to do with the default way that matlab sets the contour levels when I specify 100 levels. It's not that the outside is truly disappearing it's that some default threshold is set that makes the outside just "blend together" and subsequently disappear.

I have to figure out how to

1) how to set custom contour levels

2) make an intelligent choice about what those contour levels would be

I could be totally off base.

Part of me thinks that setting 100 contour levels should suffice. And super weird things happen when I go to 1000 contour levels......starts to look like a quadrupole.

Last edited:
Maybe there's something inherently wrong with my for loop

for i2 = 1:length(t)

clf

tt2 = t(i2)*ones(size(x));

Hyt2 = Hy.*exp(-1i*omega*(tt2));

Ext2 = Ex.*exp(-1i*omega*(tt2));

Ezt2 = Ez.*exp(-1i*omega*(tt2));

RealHyt2 = real(Hyt2);

RealExt2 = real(Ext2);

RealEzt2 = real(Ezt2);

Sx2 = -RealEzt2.*RealHyt2;

Sz2 = RealExt2.*RealHyt2;

Smag2 = (Sx2.^2 + Sz2.^2).^(0.5);

contour(X,Z,Smag2,100)

%Labels and such

xlabel('x');

ylabel('z');

title('Poynting Vector Intensity of Oscillating Electric Dipole')

%force matlab

movieVector(i2) = getframe;

end

myWriter = VideoWriter('PoyntingVectorIntensityofOSCdipole2D','MPEG-4');

myWriter.FrameRate = 20;

% Open the Video Writer object write the movie and close the file

open(myWriter);

writeVideo(myWriter,movieVector);

close(myWriter);

Last edited:
TSny
Homework Helper
Gold Member
Edit: I think it has something to do with the default way that matlab sets the contour levels when I specify 100 levels. It's not that the outside is truly disappearing it's that some default threshold is set that makes the outside just "blend together" and subsequently disappear.
Yes, I think you'll get better plots if you specify particular values for the contour levels. I found that specifying 6 to 10 levels was sufficient.

For example, the following worked pretty well:

(1) In the equations for the components of S given in post #15, I let $\frac{cp^2}{4 \pi} = 1$ and $k = \omega = 2\pi$.

(2) Instead of plotting contours of $(S_r^2 + S_\theta^2)^{1/2}$, I plotted contours of $(S_r^2 + S_\theta^2)^{1/5}$ in order to keep the far field from dying out too rapidly.

(3) I chose contour values equal to 2, 4, 6, 8, 10, 15, and 20. This seemed to work well with the choices given in (1) and (2).

(4) I plotted out to a distance of $r = 2$.

These were just arbitrary choices. You should experiment around to see what works well.

• PhDeezNutz
I found out why my lines were disappearing; In each iteration of the for loop the contours are re-calibrated so to speak. To counteract that I set the scale at t = 0 and used that "set in stone scale" inside the for loop to "keep everything uniform" and make the wave look like it's traveling continuously.

Here's the result which has a few problems:

1) There's contours on the dipole axis

2) For some reason everything is real slow, I've tried changing frame rates in the range from 20 to 1000. no dice.

On the plus side

3) The radiation pattern seems to be contained within a constant "envelope" and parts of that envelope are not disappearing thankfully. Hopefully this is not a coincidence of doing something wrong.

Strangely when I use a website to convert my mp4 to a gif the gif actually turns out alright; it has a non vanishing envelope and isn't super slow. My mp4 is terrible. edit: actually when opening my mp4 in a separate player it turns out fine. but the contours on the dipole axis are concerning.

Last edited:
TSny
Homework Helper
Gold Member
Looks nice. The contours along the axis of the dipole are interesting. The magnitude of S is zero at all points exactly on the axis. For points near the axis, but not on the axis, S will be small but nonzero. So, if you are plotting contours with small values, then you can get some contours near the axis.

Here is a plot of contour lines near the positive z-axis over a range of about 2 to 5 wavelengths from the dipole. They seem to have some interesting strucure. The two graphs below zoom in on this region at about 4.75 wavlengths from the dipole • PhDeezNutz I followed your advice and filtered the smallest number from the range of S magnitudes and now the contours on the dipole axis are gone.

I have a special relativity presentation due Tuesday do you think I could incorporate this somehow? Perhaps boost it to another "nearly c" frame and see how it looks. What should I expect in such a case? (depending on which direction I boost in). I'm just thinking out loud here. I just want an excuse to continue working on this script.

(I bet that's a loaded question)

Edit: I think Jackson page 558 has the answers

Last edited:
TSny
Homework Helper
Gold Member
Your movies are looking pretty good!

I have a special relativity presentation due Tuesday do you think I could incorporate this somehow? Perhaps boost it to another "nearly c" frame and see how it looks. What should I expect in such a case? (depending on which direction I boost in).
Yes, the radiation pattern of a relativistically moving, radiating dipole could be interesting. If the dipole moves in a direction that is perpendicular to the axis of oscillation, I think you should see some "bunching" of the contour lines out in front of the dipole corresponding to the Doppler effect. Also, it could be that the strength of the Poynting vector is increased in the forward direction. That is, maybe the radiation gets "beamed forward" at relativistic speeds.

Edit: I think Jackson page 558 has the answers
Yes, here you have the transformation equations for the fields when switching frames of reference.

• PhDeezNutz
Your movies are looking pretty good!
Thank you! I couldn't have done it without your help.

Yes, the radiation pattern of a relativistically moving, radiating dipole could be interesting. If the dipole moves in a direction that is perpendicular to the axis of oscillation, I think you should see some "bunching" of the contour lines out in front of the dipole corresponding to the Doppler effect. Also, it could be that the strength of the Poynting vector is increased in the forward direction. That is, maybe the radiation gets "beamed forward" at relativistic speeds.

Yes, here you have the transformation equations for the fields when switching frames of reference.

I'll look for these patterns when making the script. I'll update this thread when I get somewhere with it.

After that my plan is to generalize my dipole script to something like the following so that I can eventually handle the quadrupole (coming up with analytical expressions for this might be hard but I hardly know anything about Finite Element Analysis so I have to come up with analytical expressions).

#### Attachments

• 94.3 KB Views: 7
Last edited:
• TSny
@TSny If I transformed the field correctly. I'm traveling at 0.9c along the y - axis (with the dipole along the z-axis)

and I get the following I don't know what to make of it to be honest.

Is it correct/what you would expect?

Again, I'm traveling fast in a direction perpendicular to the dipole (the y-direction with the dipole along the z-direction) and I'm constraining the poynting vector intensity to the xz-plane.

I'm using the same color spectrum as my previous script.

It seems very strange that radiation would be perpendicular to the direction it was previously in.

Last edited:
TSny
Homework Helper
Gold Member
The animation doesn't look correct to me.

Suppose the primed frame is the frame in which the dipole is at rest. In the unprimed frame, the dipole moves along the y-axis. At the instant the dipole crosses the xz plane in the unprimed system, you can consider the value of the Poynting vector at each point of the xz plane. If you ignore $S_y$ and plot the contour lines of $\sqrt{S_x^2 + S_z^2}$ in the xz plane, I think you will get the same pattern of contours as for a dipole at rest. I find that the only difference is that the value of a particular contour in the xz plane for the moving dipole is greater by the gamma factor $\gamma$ compared to the same contour when the dipole is at rest. In other words, $\sqrt{S_x^2 + S_z^2} = \gamma \sqrt{S_x'^2 + S_z'^2}$ if the left and right sides are evaluated at the same point in the xz plane.

Regarding the animation, I just want to be clear. For each instant of time, the dipole is at a different location along the y-axis. At each instant, are you plotting the contours as they would exist on a plane perpendicular to the y-axis and located at the instantaneous position of the dipole?

The animation doesn't look correct to me.

Suppose the primed frame is the frame in which the dipole is at rest. In the unprimed frame, the dipole moves along the y-axis. At the instant the dipole crosses the xz plane in the unprimed system, you can consider the value of the Poynting vector at each point of the xz plane. If you ignore $S_y$ and plot the contour lines of $\sqrt{S_x^2 + S_z^2}$ in the xz plane, I think you will get the same pattern of contours as for a dipole at rest. I find that the only difference is that the value of a particular contour in the xz plane for the moving dipole is greater by the gamma factor $\gamma$ compared to the same contour when the dipole is at rest. In other words, $\sqrt{S_x^2 + S_z^2} = \gamma \sqrt{S_x'^2 + S_z'^2}$ if the left and right sides are evaluated at the same point in the xz plane.

Regarding the animation, I just want to be clear. For each instant of time, the dipole is at a different location along the y-axis. At each instant, are you plotting the contours as they would exist on a plane perpendicular to the y-axis and located at the instantaneous position of the dipole?
A dead give away that my code was wrong was when I set $\beta = 0$ and wasn't able to recover the familiar pattern. I'm an idiot for not considering this.

I am traveling really fast in the y-direction (0.9c) and looking back at the radiation pattern in the xz-plane (with the dipole in the z-direction). Which I'm guessing is equivalent to your description.

I did not ignore $S_y$. Perhaps I should since the entire point of a Poynting vector is to indicate power flux.

edit: for my project I might consider doing a linear accelerated point charge and show how the power profile changes shape.

From pages 7-9 in the document below

I feel like this can be tied to special relativity because I see betas and gammas everywhere lol.

Edit: It appears that a relativistic accelerating point charge can look like a dipole? I don’t understand that but maybe by the end of the day I will.

Last edited:
I think one of the mistakes I made was assuming y is still equal to 0 when the frame is traveling.

edit: but maybe that information is already contained within $\vec{\beta} = \beta \hat{y}$ when using the transformation laws on page 558 of Jackson. I’ll keep working on it.

Last edited:
TSny
Homework Helper
Gold Member
I think one of the mistakes I made was assuming y is still equal to 0 when the frame is traveling.
Doing an animation for the moving dipole seems to me to be tricky. But you can get some feeling for the radiation pattern by plotting at just one instant.

I tried plotting contours of S for the yz plane (side view) and the xy plane (overhead view), assuming the dipole moves along the y-axis while the dipole oscillates in the z-direction.

Here's the side view, looking at the yz plane. The dipole moves to the right. The first plot is for the dipole at rest, the middle is for the dipole moving to the right at v = c/3, and the plot on the right is for v = (3/4)c. You can see the Doppler effect where the wavelength is shortened in front of the dipole and stretched out on the backside. The strength of the radiation increases in the forward-moving direction as v increases. Here's the top view, looking down on the xy plane, for the same selection of speeds. The dipole oscillates in-and-out of the page. The y-axis is still toward the right. Again, you can see the "beaming forward" of the radiation intensity at high speeds. Last edited:
• JD_PM and PhDeezNutz
You are too helpful. I never even considered doing top and side views. Thank you very much for taking time out of your day (which is clearly not a trivial amount of time) to help me.

hopefully I can generate plots similar to yours.

I will continue to work on it.

Also in earlier post I said something to the effect of me not accounting for position change of the frame......then I realized that the position doesn’t matter but rather the velocity and this dependency is included in $\vec{\beta}$ in Jackson page 558.

@TSny I think I got somewhere with it. It seems to look like yours but "flipped". I must have mixed up frame transformations. The picture above is at 0.5c.

To get mine to look more like yours I need to exclude a larger region about the origin to avoid really strong fields. As it is right now I have too many contours close to the origin and the far field just sort of "washes together".

Edit: I used these transformations, it could be that I did them in reverse.

https://wikimedia.org/api/rest_v1/media/math/render/svg/ed275f4351e9a07afd64e9450081851b158c91be

My picture also doesn't seem to be "beaming" so to speak.

Last edited:
TSny
Homework Helper
Gold Member
If you want the dipole to be moving in the +x direction in the primed frame, then the primed frame needs to be moving in the -x direction relative to the unprimed frame.

• PhDeezNutz
If you want the dipole to be moving in the +x direction in the primed frame, then the primed frame needs to be moving in the -x direction relative to the unprimed frame.
I just reversed the sign of v and was able to get something resembling your picture. Minus the "beaming".

I'm about to do something similar for a point charge.

TSny
Homework Helper
Gold Member

May I ask why $\beta = 0$ would result in radiation pattern for a point charge? Bottom of page 8.
I'm not sure I understand your question. A point charge that is instantaneously at rest, but has nonzero acceleration at that instant, will be radiating at that instant.

• PhDeezNutz
I'm not sure I understand your question. A point charge that is instantaneously at rest, but has nonzero acceleration at that instant, will be radiating at that instant.
I think I understand, I mistakingly thought that $\vec{\beta} = 0 \Rightarrow \dot{\vec{\beta}} = 0$ and that's obviously not true. I can't think of an example right now but my assumption is obviously wrong.

@TSny

Do you know how the fields of a point charge transform under linear acceleration (say in the x-direction)?

I want to reconcile these results with the Lienard-Wiechert results. Do you think that is feasible?

My knowledge of acceleration in special relativity is pretty pathetic. If I recall correctly (I most likely do not) acceleration is directly proportional to velocity in some manner (i.e. damping?).

Also, my professor said that my moving dipole gif was very impressive so I can't thank you enough. He advised that I don't spend any longer time on this project and attend to my other responsibilities because what I've done is more than sufficient..........but I'm an addict. I can't miss out on the opportunity to reconcile Lienard-Wiechart results with relativity.

TSny
Homework Helper
Gold Member
@TSny

Do you know how the fields of a point charge transform under linear acceleration (say in the x-direction)?

I want to reconcile these results with the Lienard-Wiechert results. Do you think that is feasible?
I'm not sure I understand the first question above. The fields of an accelerating point charge are typically derived from the Lienard-Wiechert potentials, as in section 8.2 of the link you posted.

My knowledge of acceleration in special relativity is pretty pathetic. If I recall correctly (I most likely do not) acceleration is directly proportional to velocity in some manner (i.e. damping?).
I don't see why $a$ would be proportional to $v$, at least not in general. $a$ can be nonzero at an instant when $v$ is zero.

It seems the discussion is drifting away from the initial topic of this thread. It would probably be best to start another thread if you have general questions regarding the fields of accelerated charges. If the questions are not specific homework questions, then it might be more appropriate to post in the "Classical Physics" forum here or the "Special and General Relativity" forum here

• JD_PM and PhDeezNutz
@TSny I realize that I don't have a very good idea of what I'm talking about and I'm just pontificating at this point.

In the interest of conforming to forum rules/etiquette I shall make a new thread about it when I do have a better idea of what I'm talking about. Don't have long to figure it out lol.

• 