Magnetic field from a coil (on Mathematica)

Click For Summary
The discussion focuses on calculating the magnetic field from two circular coils configured like Helmholtz coils using the Biot-Savart law in cylindrical coordinates. The user encounters an issue where their Mathematica script consistently returns a constant value instead of varying results based on input coordinates. A key error identified is in the denominator of the magnetic field equation, where the term should reflect the distance from the observation point to the coil rather than a constant. The correction involves using the proper expression for the denominator, specifically |x(obs) - x(coil)|^3. The conversation highlights the importance of accurate mathematical representation in simulations for magnetic field calculations.
TheDestroyer
Messages
401
Reaction score
1
Hello guys,

I'm trying to find the configuration of two circular coils in a configuration similar to Helmholtz coils that would homogenize the magnetic field best at a volume between them.

So the first thing step I took in that is use the Biot-Savart law to calculate the magnetic field produced at each point through that coil. The coordinate system is Cylinderical coordinates, and the coil is placed on the xy-plane, its center matches the origin (0,0,0).

The function is

<br /> \begin{array}{l}<br /> dl = \sqrt {d{x^2} + d{y^2}} = Rd\theta \\<br /> B\left( {\overrightarrow r } \right) = \frac{{{\mu _0}I}}{{4\pi {R^3}}}\int\limits_0^{2\pi } {\left( {\overrightarrow {dl} \times \left( {\overrightarrow r - \overrightarrow R } \right)} \right)d\theta } \\<br /> B\left( {x,y,z} \right) = \frac{{{\mu _0}I}}{{4\pi {R^3}}}\int\limits_0^{2\pi } {\left( {\left( { - R\sin \theta ,R\cos \theta ,0} \right) \times \left( {x - R\cos \theta ,y - R\sin \theta ,z} \right)} \right)d\theta } <br /> \end{array}

where r(x,y,z) is the position vector from origin to the point, at which the magnetic field is to be calculated; R is the radius of the coil.

I wrote a Mathematica script to do this integral, but it always gives a single number (representing a 2 pi R^2 constant result from the cross product and the integral), no matter how I change x,y and z. This is the function I'm using.

FieldAtPoint[x_, y_, z_] :=
(u0 i)/(4 Pi r^2)
Integrate[
Cross[r{-Sin[t], Cos[t], 0}, ({x - r Cos[t], y - r Sin[t], z})], {t,
0, 2 Pi}]
Do you find anything wrong within my calculations? Please advise. How do I do this correctly?

Thank you for any efforts.
 
Last edited:
Physics news on Phys.org
You need this term in the denominator: |x(obs) - x(coil)|3

The R3 term is an error -- it's |x(coil)|3
 
@lpetrich Thanks a lot! what a stupid mistake!
 
Thread 'Colors in a plasma globe'
I have a common plasma globe with blue streamers and orange pads at both ends. The orange light is emitted by neon and the blue light is presumably emitted by argon and xenon. Why are the streamers blue while the pads at both ends are orange? A plasma globe's electric field is strong near the central electrode, decreasing with distance, so I would not expect the orange color at both ends.

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
14
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
3
Views
3K
Replies
2
Views
1K