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

118 replies · 22K views · last reply
MATLAB 3D isosurface plot of a single dark blue lobed, ellipsoidal level surface on a white background, with axis tick labels including -1000, 0, 1000 and 2000.


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?
 
Looks good. You're definitely making progress.
 
  • Like
Likes   Reactions: PhDeezNutz
3D MATLAB surface plot in a dark blue and black colormap with a small bright cluster near the centre, on axes labelled x from -1 to 1, y from -2000 to 2000 and z from -3000 to 3000.


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:
@TSny

more progress!

We can do it, we're almost there!
3D MATLAB surface plot of a dark blue rectangular plane with yellow and teal concentric ring patterns near the center, on axes running from -3000 to 3000 vertically and -1 to 1 horizontally.
 
  • Like
Likes   Reactions: vanhees71
PhDeezNutz said:
@TSny
more progress!
We can do it, we're almost there!
Very nice!
 
  • Like
Likes   Reactions: PhDeezNutz
@TSny

I think I've got it completely

3D MATLAB plot titled 'Poynting Level Surfaces of Radiating Dipole': a single dark blue, bumpy level surface shaped like a flattened torus, centred in a box with x, y and z axes spanning about -2500 to 2000.


MATLAB 3D surface plot on axes from -3000 to 3000 (vertical), -2000 to 2000, and -1 to 1, showing a dense dark blue vertical sheet with a small yellow-green cluster of ring-like patterns at its centre.


MATLAB 3D surface plot on a white background with axes from -3000 to 3000 and -1 to 1, showing a dark blue rectangular sheet with a small yellow-and-cyan glowing pattern near its centre.
3D surface plot from MATLAB showing a dark navy flat plane with a small concentric ring pattern of yellow and green near the centre; axes range from -3000 to 3000 horizontally and -1 to 1 vertically.
 
  • Like
Likes   Reactions: vanhees71 and TSny
Excellent!
 
  • Like
Likes   Reactions: PhDeezNutz
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   Reactions: JD_PM and TSny
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

MATLAB 3D surface plot: a flat dark blue plane with a small bright yellow and green starburst pattern at its centre, axes ranging from -1500 to 1500 on the horizontal plane and -1 to 1 vertically.


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.
 
Table of multipole types: columns are electric, magnetic, toroidal and radiation multipoles; rows are dipoles, quadrupoles and octupoles, each drawn with charges, currents or moments and a radiation lobe pattern.


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?
 
MATLAB 3D surface plot of a nearly flat dark navy plane with a small cluster of faint bright features at the centre, axes ranging from -1 to 1 (vertical), -1500 to 1500 and -1000 to 1500 (horizontal).


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.
 
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}##?
 
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.

Equation 2.19 giving the magnetic field B(r,t) = e^(ikr)(1 - ikr) B_dip plus mu k^2 e^(ikr)/(4 pi r) [(r-hat x m) x r-hat] plus terms with k^2/(24 pi), i k/(8 pi), k^2/(12 pi) and i k^3/(24 pi) multiplying sqrt(mu/epsilon), e^(ikr)/r^2, e^(ikr)/r^3 and e^(ikr)/r, all times Q r-hat.


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.
 
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##?
 
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

3D quiver plot of a vector field over a square grid, with arrows fanning out radially from the centre in four lobes along the diagonals; axes labelled from -1500 to 1500.
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.
 
I'm going to test Jackson's formulas in MATLAB before I try implementing my own just to compare. Progress I think.
Three-dimensional MATLAB isosurface plot of a four-lobed teal surface with pointed tips, resembling a four-leaf shape, with axes labelled from -1500 to 1500 along each direction.


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:
3D level surface plot in teal on white, with x and y axes running from -1500 to 1500, showing a symmetric lobed shape with a butterfly-like central cross structure and a pinched waist.


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.
 
3D MATLAB surface plot of a blue lobed, four-leaf-like surface with axes labelled from -1500 to 1500 and -1000 to 1000, showing lobes extending outward from the origin.


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:
That looks like it could be it!
 
  • Like
Likes   Reactions: PhDeezNutz
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!
 
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.

Three contour plots of the magnitude of the Poynting vector for a radiating dipole: xy-plane, xz-plane, and a vertical plane at 45 degrees to the x and y axes, each with a central blue disc and lobed orange-white contours.


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

Two 3D isosurface plots in green showing a radiation-pattern-like surface with lobes extending outward in several directions, with axis tick labels from -10 to 10 on the left and -5 to 5 on the right.
 
  • Like
Likes   Reactions: PhDeezNutz
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:
MATLAB 3D plot titled Instantaneous Radial Poynting Flux, axes X, Y and Z ranging from -2000 to 2000, with a small dark blue blob at the centre of an otherwise nearly blank box.


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.
 
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.

3D surface plot in a cube from -0.2 to 0.2 on each axis, showing a contour sheet with hyperboloid-like flared surfaces meeting at the origin and horn-shaped lobes extending along the coordinate axes.
 
  • Like
Likes   Reactions: PhDeezNutz
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

3D MATLAB surface plot showing eight teal funnel-shaped surfaces arranged symmetrically around the origin in a cube, axes scaled by 10^10 from -1 to 1.


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

3D MATLAB isosurface plot of a noisy, speckled teal cloud centered near the origin, with axes spanning roughly -1 to 1 (x10^10) in two horizontal directions and -5 to 5 (x10^9) vertically.
 
3D MATLAB isosurface plot with axes scaled by ×10^11, showing several open purple and blue level surfaces and yellow lobes arranged around the origin.


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.
 
Surface plot viewed from above, coloured in blues, cyan and yellow, with axes from -1 to 1 times 10^11, showing four corner lobes and a central diamond-shaped region.


Top view, I feel like those level surfaces should be pointing outwards.
 
Part of me thinks that it's MATLAB connecting level surfaces that shouldn't really be connected.
 
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   Reactions: PhDeezNutz