- #1

- 3

- 0

## Main Question or Discussion Point

Dear everyone,

I am researching genetic algorithms and at the moment I am trying to solve a problem how would magnetic particles (dipoles) orient themselves in a thin hollow sphere.

Suppose that I have N magnetic dipoles placed in the sphere. There is no external magnetic field. The dipoles create their own magnetic field, thus the system has some magnetic energy. I am writing a genetic algorithm to minimize this energy.

I did the problem in 2 dimensions (on a plane) already, and it worked perfectly!

The problem is that I am not sure how to calculate the magnetic field energy created by dipoles in 3 dimensions.

The formula for calculating magnetic field created by one dipole with magnetic moment [tex]\vec{m}[/tex] at point [tex]\vec{r}[/tex] in SI system is:

[tex]\vec{B}(\vec{r}) = \frac{\mu_{0}}{4\pi}(\frac{3(\vec{m}\hat{r}) - \vec{m}}{r^{3}})[/tex]

To find the energy, I just sum over all dipole moments [tex]\vec{m}[/tex] and multiply by [tex]\vec{B}[/tex] created by others (with minus sign).

In 2D I set the problem so that all the dipoles had [tex]\vec{m}[/tex] and [tex]\vec{r}[/tex] perpendicular, that is [tex]\vec{m}\vec{r} = 0[/tex] (magnetic dipole moment [tex]\vec{m}[/tex] was perpendicular to the 2d plane the dipoles were on).

In 3D I have the [tex]\vec{m}\vec{r}[/tex] term, which I am not sure how to calculate.

Any advice how to calculate this term to find energy in 3 dimensions?

Sincerely,

Stan

I am researching genetic algorithms and at the moment I am trying to solve a problem how would magnetic particles (dipoles) orient themselves in a thin hollow sphere.

Suppose that I have N magnetic dipoles placed in the sphere. There is no external magnetic field. The dipoles create their own magnetic field, thus the system has some magnetic energy. I am writing a genetic algorithm to minimize this energy.

I did the problem in 2 dimensions (on a plane) already, and it worked perfectly!

The problem is that I am not sure how to calculate the magnetic field energy created by dipoles in 3 dimensions.

The formula for calculating magnetic field created by one dipole with magnetic moment [tex]\vec{m}[/tex] at point [tex]\vec{r}[/tex] in SI system is:

[tex]\vec{B}(\vec{r}) = \frac{\mu_{0}}{4\pi}(\frac{3(\vec{m}\hat{r}) - \vec{m}}{r^{3}})[/tex]

To find the energy, I just sum over all dipole moments [tex]\vec{m}[/tex] and multiply by [tex]\vec{B}[/tex] created by others (with minus sign).

In 2D I set the problem so that all the dipoles had [tex]\vec{m}[/tex] and [tex]\vec{r}[/tex] perpendicular, that is [tex]\vec{m}\vec{r} = 0[/tex] (magnetic dipole moment [tex]\vec{m}[/tex] was perpendicular to the 2d plane the dipoles were on).

In 3D I have the [tex]\vec{m}\vec{r}[/tex] term, which I am not sure how to calculate.

Any advice how to calculate this term to find energy in 3 dimensions?

Sincerely,

Stan