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

  • #51
yoyo.jpg


Well I tried to create a 3d animation and I failed pretty bad.

1) The so called "yo-yo" is oriented wrong. I meant for the dipole to be oriented in the z-direction. The lobes should be on the sides instead of the top and bottom. This means I broke up Jackson's expressions wrong component wise.

2) It's not an animation but rather a still picture.

I will continue to work on it. I have to

1) Re-calculate Jackson's expression's component wise so I can re-orient it

2) Find out why my script is not animating. I'll have to look closely at my for loop.

3) Once I find out how to re-orient and animate, I need to learn how to make slices.

Edit: Fixed the orientation but still not animating. The problem was that I was computing the Poynting vector wrong. My image is not as "sharp" was I want it to be...I wonder if that is a limitation on matlab/my computer.

yoyo2.jpg


EDIT: nvm I jumped the gun it's not oriented right.
 
Last edited:
Physics news on Phys.org
  • #52
  • #53
  • #54
TSny said:
What exactly are you plotting in these 3D figures? Are you trying to get the surface that is shown in the link
http://www.antenna-theory.com/antennas/norm3D1lam.jpg ?

Kind of but not exactly, I should have clarified.

I want to plot level surfaces of the magnitude of the Poynting vector. Basically a 3D version of the gif in post 33. Naturally the outermost level surface will block the view of the rest of the level surfaces.

To me the jpg in the link is a projection of level curves in the xz-plane projected onto a toroid (of sorts).

I believe toroids (of sorts) are the level surfaces of the Poynting vector magnitude but I believe each toroid should be the same color. (I could be wrong)
 
  • #55
PhDeezNutz said:
I want to plot level surfaces of the magnitude of the Poynting vector. Basically a 3D version of the gif in post 33. Naturally the outermost level surface will block the view of the rest of the level surfaces.

To me the jpg in the link is a projection of level curves in the xz-plane projected onto a toroid (of sorts).

Yes. The 3D version should just be the 2D version rotated about the z-axis. Below are the 2D and 3D contour graphs I got for one particular value of the magnitude of the Poynting vector. The 3D graph is tilted so that we are looking somewhat down from above.

1582160149406.png
 
  • Like
Likes PhDeezNutz
  • #56
TSny said:
Yes. The 3D version should just be the 2D version rotated about the z-axis. Below are the 2D and 3D contour graphs I got for one particular value of the magnitude of the Poynting vector. The 3D graph is tilted so that we are looking somewhat down from above.

View attachment 257366
You are simply amazing. It’s going to be awhile until I have the wherewithal to produce the same graphs as you but I will get there. I’ll work through the night.

Thank you again.
 
  • #57
PhDeezNutz said:
You are simply amazing.
No. Mathematica is amazing!
 
  • #58
@TSny I assure you that you are amazing.

Here's an update
better.jpg


My problematic surface arose from me computing Jackson's expressions wrong. Looking at Jackson 9.18.2 I computed ##(\vec{n} \times \vec{p}) \times \vec{p}## instead of the proper ##(\vec{n} \times \vec{p}) \times \vec{n}##. I computed the rest of the expression(s) correctly as far as I can tell.

Some comments about my program

1) Still not animating, when it does I need to make coordinate plane slices in a subplot

2) Color scheme washes together; in the far field the variances amongst field strength seem to be so minute that they all become one color. Maybe this is a good thing, maybe it's a bad thing but it is worth mentioning. I'd like to make each shell a different color and somewhat transparent.
 
  • #59
Can anyone think of a clever way to pass a vector of values to a function that only accepts scalars? Using some combination of for loops, while loops, if blocks etc. I want to do it without writing a separate statement for each of the 99 values.

X,Y,Z,

isosurface(X,Y,Z,V,isovalue)

isovalue must be a scalar but like I said I'd like to plot level surfaces for more than just one value without writing a separate statement for each value.
 
  • #60
notexactly.gif


Not Exactly what I was going for but it is progress.

I have no idea why the shells get intermittently taller (and shorter).

Edit: You would think the shells would change size within an envelope and the envelope itself would not change size.
 
Last edited:
  • #61
muchbetter.gif


Much better, the problem was that I wasn't fixing the axis limits and it was changing with each iteration in the for loop (despite the previous gif not showing it, it was apparent when I saw it rendering). I set the axis limits in stone and then proceeded to render.

As for "a way to pass a vector of values to a function that only accepts scalars (as the fourth argument)". I did the following. for i2 = 1:length(Srange)
isosurface(X,Y,Z,Smag2,Srange(i2))
hold on
xlim([-2400,2400])
ylim([-2400,2400])
zlim([-2400,2400])
xlabel('X-axis')
ylabel('Y-axis')
zlabel('Z-axis') title('Poynting Level Surfaces of Radiating Dipole') end

This was nested inside another for loop where Smag2 was defined.

Hopefully that took care of it.

The only thing left to do is take slices. Hopefully when I do this I will see more colors.

How does it look?
 
  • #62
Looks good. You're definitely making progress.
 
  • Like
Likes PhDeezNutz
  • #63
firstsliceattempt.gif


I took a slice of my animation so I'm happy with that.. I'm obviously getting a dipole radiation pattern and more colors as expected but it's not quite satisfactory. I need more colors and variation, the far field is washing together as one color and I need to fix this.

and my goodness does it take long to render a 5 second movie.

Edit: tried making the axis limits less in the view and it just became more pixelated. Not good.

Edit2: Hopefully we can solve all of this by post 70, this problem is getting tiresome. And I'm sure you're getting tired of this problem as well. But again, you've been of tremendous help and I can't thank you enough.
 
Last edited:
  • #64
@TSny

more progress!

We can do it, we're almost there!
YZslice.gif
 
  • Like
Likes vanhees71
  • #65
PhDeezNutz said:
@TSny
more progress!
We can do it, we're almost there!
Very nice!
 
  • Like
Likes PhDeezNutz
  • #66
@TSny

I think I've got it completely

ThreeDdipole.gif


YZplanedipole.gif


XZplanedipole.gif
XYplane.gif
 
  • Like
Likes vanhees71 and TSny
  • #67
Excellent!
 
  • Like
Likes PhDeezNutz
  • #68
TSny said:
Excellent!

Thank you again for all your help! Onto the quadrupole! I'll start a new thread when I'm in a position to do so. (Gotta catch up in my classes).
 
  • Like
Likes JD_PM and TSny
  • #69
Would it be alright If I continued the quest to create a quadrupole animation in this thread for the time being?

I don't think I have enough substance to start a new thread yet.

Here's my progress

wavefrontsquadrupole.jpg


There are some things wrong with this picture. (please zoom in if need be). I am happy that we appear to have a 4 lobe pattern though.

1) Wave fronts/level surfaces of the Poynting vector seem to be pointing inwards instead of outwards. I could try negating my fields (but that would be really contrived)

2) There's not enough contrast and there could be a million reasons for this.

3) For whatever reason an animation is not rendering in MATLAB and I'm getting an error about how all frames aren't the same size...which is ridiculous considering I more or less copy and pasted my format from the dipole script which did not have this problem.

As a note: I didn't use the fields that Jackson used but rather my own expressions, but they do corroborate Jackson to first order. Jackson uses the approximation that ##\nabla \times \approx \hat{n} \times## in the far field which I think is ridiculous.
 
  • #70
QuadrupoleTypes.jpg


I'm trying to do the oscillating electric quadrupole. I suspect that I forgot magnetic dipole terms. Does the oscillating electric quadrupole necessarily produce a magnetic dipole moment?
 
  • #71
quadg.gif


Please zoom in (I apologize for the scale, I'm working on it) to see that the wave is propagating outwards but the level surfaces (or rather cross sections of level surfaces) appear to be pointing inwards instead of outwards.

I'm off by a phase factor of ##i## somewhere in my purely spatial dependencies because when I multiply by ##e^{i \omega t}## instead of ##e^{- i omega t}## I get the wave propagating outwards. Which runs completely opposite of what is supposed to happen.

This gif/program needs a lot of work.

Summary

1) Off by a phase factor somewhere in my 30 pages of derivations

2) Level surfaces are pointing in instead of out

maybe the 2 problems are related to each other.
 
  • #72
awfulquadrupole.jpg


Has 6 loves instead of 4 it seems. awful.
 
  • #73
PhDeezNutz said:
Would it be alright If I continued the quest to create a quadrupole animation in this thread for the time being?
That's ok with me. But, one of the advisors or mentors might shut this thread if he/she feels that it's becoming too lengthy.

As a note: I didn't use the fields that Jackson used but rather my own expressions, but they do corroborate Jackson to first order. Jackson uses the approximation that ##\nabla \times \approx \hat{n} \times## in the far field which I think is ridiculous.

##\nabla \times \approx ik\hat{n} \times## is a good approximation in the radiation zone when applied to the complex valued expression for vector potential ##\vec A##.

Are you trying to get expressions that are valid in the "intermediate zone" as well as in the radiation zone. If so, I imagine the expressions will be pretty lengthy.

What are you taking to be the charge distribution that defines the quadrupole? That is, what are you taking for the components of the quadrupole moment tensor, ##Q_{ij}##?
 
  • #74
TSny said:
That's ok with me. But, one of the advisors or mentors might shut this thread if he/she feels that it's becoming too lengthy.
##\nabla \times \approx ik\hat{n} \times## is a good approximation in the radiation zone when applied to the complex valued expression for vector potential ##\vec A##.

Are you trying to get expressions that are valid in the "intermediate zone" as well as in the radiation zone. If so, I imagine the expressions will be pretty lengthy.

What are you taking to be the charge distribution that defines the quadrupole? That is, what are you taking for the components of the quadrupole moment tensor, ##Q_{ij}##?

Alright I'll start a new one as soon as I get enough material to do so. I'm trying to get one in the intermediate and near zone as well. And I realized my attempt to do so fails badly, I went back and looked over my work and conflated spherical basis with cartesian.

Allow me to explain:

I Believe these are correct.

Image 2-23-20 at 5.35 PM.jpg


I also believe the following is true

##\vec{E} = \frac{i}{k\sqrt{\mu \epsilon}} \nabla \times \vec{B}## is true assuming harmonic fields.
Now computing the latter expression for the former is where I'm having lots of difficulty. I incorrectly assumed in my derivation that ##Q\vec{r}## was a spherical construction as opposed to a cartesian construction. So I must convert...a lot of work ahead of me.

I assumed there charges

##+q## @ ##(d,0,0)##
##-q## @ ##(0,0,d)##
##+q## @ ##(-d,0,0)##
##-q## @ ##(0,0,-d)##

I think that gives us the only nonzero quadrupole moments

##Q_{11} = 6qd^2##

##Q_{22} = -6qd^2##

using the traceless quadrupole definition.

But truth be told I messed up long before I put the Quadrupole moments into my program.
 
  • #75
PhDeezNutz said:
I Believe these are correct.

View attachment 257575
I'm not familiar with these expressions. But I have no reason to doubt them.

I also believe the following is true

##\vec{E} = \frac{i}{k\sqrt{\mu \epsilon}} \nabla \times \vec{B}## is true assuming harmonic fields.
I think this is correct.

I assumed there charges

##+q## @ ##(d,0,0)##
##-q## @ ##(0,0,d)##
##+q## @ ##(-d,0,0)##
##-q## @ ##(0,0,-d)##
OK. So, you have four charges on the corners of a square with alternating signs of the charges as you go around the perimeter of the square. You placed the charges in the x-z plane.

I think that gives us the only nonzero quadrupole moments

##Q_{11} = 6qd^2##

##Q_{22} = -6qd^2##

using the traceless quadrupole definition.
With the charges in the x-z plane, wouldn't ##Q_{22} = 0## and ##Q_{33} = -6qd^2##?
 
  • #76
TSny said:
I'm not familiar with these expressions. But I have no reason to doubt them.I think this is correct.

OK. So, you have four charges on the corners of a square with alternating signs of the charges as you go around the perimeter of the square. You placed the charges in the x-z plane.

With the charges in the x-z plane, wouldn't ##Q_{22} = 0## and ##Q_{33} = -6qd^2##?

I meant to put the negative charges on the y-axis. My bad for the typo.

Anyway I used my expression for##\vec{B}##, used the curl function in matlab, multiplied by the appropriate constant, took the cross product, plotted the vector field and got this

quadrupolevectorfield.jpg
I'll keep working on it. This is not exactly what I want but it has enough of what I want to make me think that I made a small mistake somewhere.
 
  • #77
I'm going to test Jackson's formulas in MATLAB before I try implementing my own just to compare. Progress I think.
ProgressIthink.jpg


Had to project the vector field radially to get rid of the vectors "in between the lobes" and then make isosurfaces.

Edit: nvm I used the wrong power of ##r## in the denominator.
 
Last edited:
  • #78
invertedoctupolequestionmark.jpg


Using my own formulas I'm getting something peculiar. My intent was to plot level surfaces of the Poynting vector for the radiating electric quadrupole at time ##t=0##. It seems like I got an inverted level surface of an octupole pattern.
 
  • #79
RealProgress.jpg


I feel like this is progress.

I instead plotting Poynting vector magnitude level surfaces I plotted level surfaces of the power radiated per unit solid angle.

##\frac{dP}{d \Omega} = \frac{1}{2} Re\left( r^2 \hat{n} \cdot \vec{E} \times {H^*}\right)##

Edit: I used my own formula for the vector potential on this one and let MATLAB compute ##\vec{H}## and ##\vec{E}##
 
Last edited:
  • #80
That looks like it could be it!
 
  • Like
Likes PhDeezNutz
  • #81
TSny said:
That looks like it could be it!


Thank you very much for your words of encouragement! They mean a great deal to me!
 
  • #82
I tried cranking out expressions for the E and B fields. Pretty messy! I doubt if I got it all correct. If you want to compare, here are some contour plots of |S| for the xy plane, the xz plane, and a vertical plane that makes a 45o angle with the x and y axes.

1582658039211.png


Here's a 3D contour plot for one value of |S|. The figure on the right is a closer look at the center region.

1582658057030.png
 
  • Like
Likes PhDeezNutz
  • #83
Weird, I only get what you get when I project the vector field radially. Making the vectors in between the lobes essentially disappear.

But I'm probably wrong.

Edit: I'm having considerable trouble animating.
 
Last edited:
  • #84
closetobeingright.gif


Ever been so wrong that you were close to being right? That's how I feel right now.

My goodness gracious the quadrupole is more complicated than the dipole.
 
  • #85
Looks like your last plot is for a region that is quite a bit less than a wavelength from the origin. The fields vary rapidly with position in this region. The "horns" along the coordinate axes correspond to the holes poking through your surface in post #79. I also get the horns as shown below. This shows a contour sheet of one particular value of ##|\vec {S}|##. The region plotted is within ##\lambda/5## of the origin. ##\vec S## is zero for points on the coordinate axes.

1582735689573.png
 
  • Like
Likes PhDeezNutz
  • #86
TSny said:
Looks like your last plot is for a region that is quite a bit less than a wavelength from the origin. The fields vary rapidly with position in this region. The "horns" along the coordinate axes correspond to the holes poking through your surface in post #79. I also get the horns as shown below. This shows a contour sheet of one particular value of ##|\vec {S}|##. The region plotted is within ##\lambda/5## of the origin. ##\vec S## is zero for points on the coordinate axes.

View attachment 257724

wavelengthquestionmark.jpg


I basically lost a bunch of what I did because I edited it without keeping record of what I did. This is what I've gotten back to. I'm going to try increasing ##k = \frac{2 \pi}{ \lambda}## in my program to get a shorter wavelength. ( I think that statement makes sense...my brain is fried)

Edit: and I get this

Igetthis.jpg
 
  • #87
ifonlyclosed.jpg


If only I could get the purple surfaces to close. It conceal the rest of the level surfaces but it would get us the characteristic shape we want.
 
  • #88
outwardswhat.jpg


Top view, I feel like those level surfaces should be pointing outwards.
 
  • #89
Part of me thinks that it's MATLAB connecting level surfaces that shouldn't really be connected.
 
  • #90
PhDeezNutz said:
If only I could get the purple surfaces to close. It conceal the rest of the level surfaces but it would get us the characteristic shape we want.
They purple surfaces might close if you plot out to a greater distance. To get the purple surface to close so that you see all of the "central blob", you need to plot out to a distance of approximately one wavelength.

I notice that you have a factor of ##10^{11}## for your tick marks on the axes. I find it much more convenient to choose the unit of distance to equal one wavelength. By letting ##k = 2 \pi## and ##\omega = 2\pi##, the unit of length is one wavelength and the unit of time is one period of oscillation of the source. (In some of my earlier plots, such as in post #82, I let ##k = 1## which made ##\lambda ## equal about 6.3 units of distance.)
 
  • Like
Likes PhDeezNutz
  • #91
octupolewhat.jpg


Did I inadvertently solve the octupole while trying to solve the quadrupole? I mean what is going on here.
 
  • #92
@TSny I may be terribly misguided but this is what I'm thinking. If you look on page 416 (Figure 9.2) of Jackson he talks about a system that is a little bit different than the one we're dealing with but the impression I get is that each vertical plane has a quadrupole (4 lobe pattern)...my picture has that feature so that is reassuring.

Granted Jackson's radiation pattern comes from the time averaged poynting vector radial flux...but I think the magnitude of ##\vec{S}## is closely connected to that...in a way I can't quite articulate.
 
  • #93
PhDeezNutz said:
@TSny I may be terribly misguided but this is what I'm thinking. If you look on page 416 (Figure 9.2) of Jackson he talks about a system that is a little bit different than the one we're dealing with but the impression I get is that each vertical plane has a quadrupole (4 lobe pattern)...
Jackson is assuming a charge distribution with cylindrical symmetry, such as a spheroid (ellipsoid of revolution). At the beginning of the paragraph containing equation (9.50) he assumes "an oscillating spheroidal distribution of charge". Figure 9.2 refers to this case.
 
  • #94
TSny said:
Jackson is assuming a charge distribution with cylindrical symmetry, such as a spheroid (ellipsoid of revolution). At the beginning of the paragraph containing equation (9.50) he assumes "an oscillating spheroidal distribution of charge". Figure 9.2 refers to this case.

I’m having trouble imagining what that means. Would that mean

##\rho (\vec{r}’) = \frac{3Q}{4 \pi R^3} e^{-i \omega t}##

It seems not much different than a point charge and I was under the impression that point charges don’t radiate unless accelerated.
 
  • #95
connected.jpg


I feel like I'm getting the exact opposite of what I'm trying to get. In my opinion the level surfaces should connect close to the origin for a specified level. Instead they are connecting near the outside.
 
  • #96
gotitfinally.jpg


Finally got it. Was missing a factor of ##\frac{1}{r^3}## in my vector potential for the oscillating quadrupole.
 
  • #97
Yes, your last plot looks good to me.

PhDeezNutz said:
I’m having trouble imagining what that means. Would that mean

##\rho (\vec{r}’) = \frac{3Q}{4 \pi R^3} e^{-i \omega t}##

It seems not much different than a point charge and I was under the impression that point charges don’t radiate unless accelerated.
A "spheroid" is an ellipsoid of revolution. See here. As Jackson mentions, the nonzero components of the quadrupole moment tensor are the diagonal elements. These satisfy ##Q_{11} = Q_{22}= -\frac{1}{2}Q_{33}##. We imagine that somehow these components vary harmonically in time.
 
  • Like
Likes PhDeezNutz
  • #98
ThreeDQuadrupolegif.gif


I am very happy with this, got to change the viewing angle to catch the near field behavior but all in all I'm very happy.

I think this is the first gif of its kind. I've seen many quadrupole animations online but they are all confined to a plane. That could be because creating a 3D version is a trivial extension...but I'm proud of it.
 
  • #99
Yes, that looks very nice. It would be interesting to see some of the near field behavior. Good work!
 
  • Like
Likes PhDeezNutz
  • #100
TSny said:
Yes, that looks very nice. It would be interesting to see some of the near field behavior. Good work!

I tried changing the viewing angle but it didn’t show much. It showed something but not as much as I would like. I think the best approach will be to take slices.

I’ll have it by tonight hopefully. Count on it!
 
Back
Top