Energy Calculation
From FLUX
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
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.
The energy contained in a given magnetic field (uniform) is
So the total energy of the vertex is given by
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
When we break the Voronoi cell into triangles, we can see that a differential area of the triangle is
Now to calculate the energy:
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.
