Michael's Log I

Monday 6th of June

Hello all. Last week I was assigned an IDl task from Silvina Guidoni as follows.
1) Generate a random array of flux
2) From this, generate a normally distributed array of flux
3) Calculate the first two moments (the mean and the standard deviation, as far as I understand)
4) Check that these moments are theoretically correct
5) Plot a histogram of this array of flux

After a somewhat extensive (although i'm sure in a few weeks time i'll laugh at that descriptor) period of fiddling around with IDL, Silvina and I came to the conclusion that generating a random array of flux and then converting this to a normal distribution was not as efficient as using the rather nifty tool on IDL that generates normally distributed gaussians, with a mean of 0 and standard deviation of 1.
So, here is a randomly generated 3000x3000 array with a normal distribution

Since the point of the whole exercise was to learn IDL, I than ran a couple of for lops to determine the mean and standard deviation of this array. Lo and behold, the mean was roughly zero and the standard deviation was roughly 1. Good job normally distributed random number generator.

So with that done, all that is left is to plot the histogram of this array of flux. Since there is a reasonably large number of elements (9 million to be exact - don't accidentally tell IDL to print an array like this) I thought a relatively small bin size would be appropriate.

Here is my beautiful gaussian curve in histogram form. A bin is just a certain predefined interval, and the plot is the result of counting how many elements of the array fall into that specific interval.

This task might seem a bit contrived but a common assumption in solar physics is that on a magnetogram, the flux is distributed like a gaussian. So this task should prove to be quite a useful one in the long run.

So that was last week. Met with my advisor, Dana Longcope, today to get an overview of what i'm supposed to be doing for the rest of the 10 weeks i'm here. Had quite a lengthy discussion about magnetic null point densities and various tricks to make calculating them possible. I might be wrong, but I think i'm going to be trying to find a null point density that takes freqency of waves propagating through the magnetic field into account. Below a certain cutoff frequency, null points reflect certain waves. My head is still spinning with the effort of trying to take this all in though... Task for now is to try and understand how gaussians behave in general and a paper Dana wrote from 2003 about calculating null point densities.

Wedneaday 8th of June

Ok, so I understand things a little better now. Sp½ent the last couple of days trying to replicate some of the results from Dana's 2003 paper "on the distribution of magnetic null points above the solar photosphere". In essence, i've been trying to find a probably distribution for null points neglecting a factor of scale height in the solar photosphere. And by find, I mean get the result that is in the paper. This involved evaluating the determinant of the Jacobian matrix of the magnetic field. Having worked this out, in order to get some conception of what this function was behaves like, I plotted it with respect to one of it's variables (keeping the other constant) Due to the intrinsically random nature of the field however, I got a very spiky graph. What I had done wrong was I had not plotted the expectation value of this function. So a few for loops here and programs there I had it. Also, asking IDL to calculate 10 million realisations of five different distributions, and then calculate 500 points of a function comprising of them takes a while! On the plus side, I learnt why this is funny... Here is the beast function in question

G(ζ,c) =(1/(√ 2 π3/2) e2/2 <(1/4)[(√ 1-c2 n5 + cζ) + ((1-c2)(n32+n42) - 0.5(n12+n22))(√ 1-c2 n5 + cζ) + (1-c2)((√ 2 n2n3n4 + (1/√ 2 )(n32+n42)n1))>

ζ is the mean of the magnetic field divided by it's standard deviation (a function of height)
c is an anticorrelation coefficient of the Bz and Jzz
n1, n2, n3, n4 and n5 are 5 independent normalised gaussian distributions, with a mean of 1 and standard deviation of 0


That was a lot of effort to write out but and I have another function like that I might not bother but I feel like I should provide a formula if i'm going to show some graphs.

So, here is a graph of G against c with ζ = 0

It should be noted that this graph runs from c = 0 to c = 1 I forgot to normalise it in IDL and since I spent so much time writing that formula i'm not going to go back and change it (right now anyway, might do it later). Just divide everything on the x axis by 500 for it's true value.

Here is a graph of G against ζ with c = √ 2/3 

Same again here, except ζ goes from 0 to 4 so divide the x axis by 100

Aside from that, met with Dana today to discuss where next and essentially what i'm currently trying to do is do the same calculations and come up with a similar function for the distribution of null points, but only for those which have a determinant greater than a certain value. So this will involve the heaviside function which I learnt about today, which is basically a slightly more sweeping dirac delta function, returning 1 if the argument is positive and 0 if the argument is negative.

Thought for the day: Apparently heaviside drastically simplified maxwell's original equations from 20 down to 4 using vector calculus trickery. Thank you heaviside is all I can really say to that.

Friday 10th of June


Today i'll be talking about null points and the property they have, reflection of magnetohydrodynamic alfven waves. Below a certain cutoff frequency, alfven waves are completely reflected by null points. Above this frequency, the waves are dissipated at the null point releasing energy. The formula for this cutoff frequency is given by:

Wc = 3 det(M) ρ eZ/2Ho

ρ is mass density
M is the jacobian of the magnetic field
Ho is the scale height

Plotting height as a function of cutoff frequency we can clearly determine there is a specific height where the cutoff frequency is at a minimum.

At this height, there is a greater transmission at this height than any other, so it is probable that this section of the sun is the hottest, as most energy is dissipated and not reflected. The x axis scale is arbitrary as i'm having a little bit of trouble converting cgs units to SI


Monday 20th of June


Forgive the unsettling period of absence from this log, but the fantastic and plentiful nature of American food seems to be matched by the unfortunate difficulty of ascertaining what it actually is that you're eating, and I have fallen foul from my intolerance to wheat. But enough of that, back to physics. What I did manage to achieve last week (albeit at the final hour) was figure out how to work with one of Dana's programmes for analysing magnetograms. A magnetogram is a picture of the sun, with shading representing the strength of the magnetic field normal to the image. Black means the field lines are heading away from the observer, white towards and grey indicates neither or a field perpendicular to the observer. Here's what the programme does (or at least what i'm doing with it).

I can call up any particular day from a significant period of time and IDL will display the corresponding magentogram of the sun, showing where there are positive and negative regions of flux. I only want days on which there is minimal activity, so that the magnetogram is that of "the quiet sun"
I can then isolate a region around the centre of the magnetogram where the flux is roughly normal to the surface of the sun, which is what i'm interested in. I can zoom in on this section of the magnetogram that doesn't look too different from our old friend the random array anaylsed way back at the start of this log for my IDL project

Well, maybe a little different (both axes are in arcseconds)

So, with that done I can call upon a function that generates a power spectrum density for a given magnetogram at a given wavenumber. Or they would be if copy and pasting from Texify worked!This can then be plotted easily:

As you can see, there is a definitely tail off from higher powers at lower wavenumbers (higher frequencies) to lower powers at higher wavenumbers, til there is an approximately horizontal line. That level is white noise, randomness in the magnetic field and not what we are looking at.


Friday 24th of June


Ok, so the past few days have consistedd of writing some fairly hefty code. Hefty as in the sense the sense that it takes a long time to run, but it's probably my fault for writing inefficient programmes. Not helping matters is that the database I obtained magnetograms for is down, which hinders things slightly. Not to fear however, as instead i'll talk a bit about about the theory behind things.

So in Longcope, Brown and Priest (2003) 3 spectral integrals are derived. Here they are, and what they are equivalent to

2\pi\int\limits_0^\infty\{kS(k)e^{-2kz}}dk = \sigma^2

2\pi\int\limits_0^\infty\{k^2S(k)e^{-2kz}}dk = qc\sigma^2

2\pi\int\limits_0^\infty\{k^3S(k)e^{-2kz}}dk = q^2\sigma^2

If we recall from last time, the density of null points is given by the following formula

\rho_n = q^3(z)G(\zeta,c)

Where G(\zeta,c) = \frac{e^{\frac{-\zeta^2}{2}}}{sqrt2\pi^{\frac{3}{2}}}{\langle\frac{1}{4}|(sqrt{1-c^2}n_5 + c\zeta)^3 + [(1-c^2)(n_3^2+n_4^2) - \frac{1}{2}(n_1^2 + n_2^2)](sqrt{1-c^2}n_5 + c\zeta) + (1-c^2)[sqrt2n_2n_3n_4 + \frac{1}{sqrt2}(n_3^2-n_4^2)n_1]|\rangle


Since we now have c(z) and q(z) we can calculate \rho_n(z)

So anyway, here is the power spectral density for a random array of flux, much like what I was working on a couple of weeks ago:



A flat power spectral density with such a low value indicates white noise, which is what we have here. Now you may notice that my binsizes are far too small, I too noticed this, after commanding idl to execute a disgustingly large number of realisations. Here is the result of 7 hours of waiting


I think miserable failure is perhaps a rather harsh term, but it certainly doesn't look fantastic. I don't know exactly what needs changing but I guess I have plenty of time to find out.

In lighter news, the graph of C as a functino of z looks pretty cool.

Not entirely sure how accurate that is, but it's certainly an interesting shape.

Plans for the future - once the mess with \rho_n(z) has been sorted out, the plan is to determine a cutoff frequency for these null points:

W_{cutoff} = \sqrt[3]{det(M_o)}\rho^{-\frac{1}{2}} e^{\frac{z}{2H_o}}

We can then eliminate all null points whose determinants yield a lesser frequency than the cutoff, or in other words, eliminate all null points that reflect alfven waves rather than allowing them to dissipate energy. To do this, add a heaviside function to out equation for nulls.

G(\zeta,c) = \frac{e^{\frac{-\zeta^2}{2}}}{sqrt2\pi^{\frac{3}{2}}}{\langle\frac{1}{4}|(sqrt{1-c^2}n_5 + c\zeta)^3 + [(1-c^2)(n_3^2+n_4^2) - \frac{1}{2}(n_1^2 + n_2^2)](sqrt{1-c^2}n_5 + c\zeta) + (1-c^2)[sqrt2n_2n_3n_4 + \frac{1}{sqrt2}(n_3^2-n_4^2)n_1]|\rangle\Theta(det{Mo} - W_{null})

Tuesday 28th of June

So for the past couple of days i've been trying to acquire magnetograms to anaylse with the programs i've written for integrating power spectrums and finding the actual null point distribution. Lucas has helped me out with this (thanks Lucas!), unfortunately VSO search doesn't seem to be behaving, and I can't seem to get JSOC data extraction to play ball either, but Lucas sent me a save file for a magnetogram he already had, which will be fine for now.

Here are the programs I wrote last week, and have been tweaking here and there to try and produce something that even vaguely resembles what should be happening (magnetic nulls tailing off with height)

Program to obtain spectral power densities
Function to evaluate Pn
Program to create an array for the distribution of nulls

I have decided to learn a bit more about the theory behind alfven waves. A lot of this comes from Mclaughlin, J.A., Hood, A.W and Moortel, I., 2010.

In a compressible medium with a magnetic field then there are three kinds of waves. The first are longitudinal sound waves, like those that we are familiar with in our atmosphere. Secondly, we have alfven waves - analalogous to waves on a string, with the magnetic tension force as a restoring force. Last, there are magnetoacoustic waves - a coupling of the other two.

I will be dealing with Alfven waves

The force on a point charge of plasma due to a magnetic field is the lorentz force - \bf{F}_{mag} = \bf{J}{\times}\bf{B} Since\bf{J} = \frac{1}{\mu_0}\bf{\nabla} \times{\bf{B}} and using a vector identity we can re-arrange this to \bf{J}\times{\bf{B}}=\frac{1}{\mu}\;(\bf{B}\; .\; \bf{\nabla})-\bf{\nabla}(\frac{B^2}{2\mu})

The -\nabla(\frac{B^2}{2\mu}) term corresponds to a magnetic pressure force - something we are not interested in.
The \frac{1}{\mu}\;(\bf{B}\; .\; {\bf\nabla) term corresponds to a magnetic tension force, providing a restoring force to straighten out field lines, like in an elastic string. This restoring force allows waves to propagate along the field lines. These are Alfven waves.

Their velocity is given by \bf{V}_A=\frac{\bf{B}}{\sqrt{\mu_0\rho}}. Evidently, as the magnetic field strength tends towards zero, the alfven speed tends towards zero. A separatrix surface is one that acts as the boundary between two topologically distinct areas of the magnetic field. There are two types of magnetic null point which can be described in terms of separatrices. At the intersection of two seperatrices, there will be an X type null point. O type null points occur in the centre of a magnetic island. It has been found that all the alfven wave energy dissipates along the separatrix surfaces.