Energy Calculation

From FLUX

Jump to: navigation, search

Contents

Finding the energy of your world

For a given world ($a) that has been relaxed, to print out the total energy:

$a->update_force();
p $a->energy;

To print out the energy of a given vertex (say vertex #2202):

p $a->vertex(2202)->{energy};

NOTE: The energy printed out is not the physical energy, but it can easily be converted into ergs. We use the following formula to calculate the energy for each vertex

E_v \approx \frac{ds}{8\pi}\sum \frac{\Phi_v^2}{A_v}

However, at the moment, all magnetic fluxes are equal to one. To convert to physical energy, you need to find what the magnetic flux is supposed to be. If you used Hilbert or Floyd-Steinberg dithering to place your fluxons, then the procedure is rather simple. First, find the total magnetic flux into the area where you placed your fluxons, and add it to the total magnetic flux out of the area. Take this total unsigned flux value and divide it by the number of fluxons you have in your world (don't include the negatively labeled fluxons). This will be roughly equivalent to the magnetic flux in each fluxon. Convert the energy you got from the code by multiplying it by the square of the magnetic flux in each fluxon.

Calculating the energy in FLUX

The energy calculation is done in two different ways, depending on if the e_simple2 or the e_open force law is used. We don't recommend using the e_simple law. The give the same answer if the system doesn't have any (or has very few) open vertices.

e_simple2 only accounts for the energy in vertices with closed Voronoi cells. e_open does a finite integral to also account for some of the energy in open vertices.

e_simple2

This method of energy calculation works by flux equipartition. That is to say, that we assume that the total magnetic flux Φ, in the cell is divided into each of the triangles and the amount of flux φi, is proportional to the angle, ai, of the triangle.

closed Voronoi cell
Enlarge
closed Voronoi cell

The energy contained in a given magnetic field (uniform) is

E=\frac{VB^2}{8\pi}=\frac{l\Phi^2}{8\pi A}

So the total energy of the vertex is given by

E_v = \frac{ds}{8\pi}\sum \frac{\Phi^2 \left( \frac{a_i}{2\pi} \right)^2 }{A_i}






e_open

e_open is a more rigorous treatment of the energy, and accounts for some of the energy in vertices with open Voronoi cells. The angle equipartition becomes

B=\frac{d\Phi}{dA}

d\Phi=\frac{\Phi}{2\pi}d\theta

B=\frac{\Phi}{2\pi}\frac{d\theta}{dA}

When we break the Voronoi cell into triangles, we can see that a differential area of the triangle is dA=\frac{r^2}{2}d\theta

if we treat the base of the triangle as the arclength.
Voronoi trangle and differential of a Voronoi triangle.
Enlarge
Voronoi trangle and differential of a Voronoi triangle.
So we are left with

B=\frac{\Phi}{\pi r^2}

Now to calculate the energy:

\frac{8\pi}{l}E=\int B^2dA=\int_{\theta_0}^{\theta_1} \int_0^r B^2r' dr' d\theta=\int_{\theta_0}^{\theta_1} B^2\frac{r^2}{2}d\theta

\frac{8\pi}{l}E=\frac{\Phi^2}{2\pi^2}\int_{\theta_0}^{\theta_1} \frac{1}{r^2}d\theta=\frac{\Phi^2}{2\pi^2}\int_{\theta_0}^{\theta_1} \frac{\cos^2\theta}{r_o^2}d\theta=\left[ \frac{\Phi^2}{2\pi^2r_o^2}\frac{1}{2}\left( \theta + \frac{1}{2}\sin 2\theta \right) \right]_{\theta_0}^{\theta_1}

E=\left[ \frac{ds\Phi^2}{32\pi^3r_o^2}\left( \theta + \frac{1}{2}\sin 2\theta \right)\right]_{\theta_0}^{\theta_1}

open Voronoi cell
Enlarge
open Voronoi cell

This method now accounts for much of the energy in the open part of the Voronoi cell. Note though, that it does not account for the part that is shaded.

Personal tools