Magnetic field from a coil (on Mathematica)

Click For Summary
SUMMARY

The discussion focuses on calculating the magnetic field produced by two circular coils configured similarly to Helmholtz coils using the Biot-Savart law. The user encountered an issue with their Mathematica script, which consistently returned a constant value regardless of the input coordinates. The problem was identified as an error in the denominator of the formula, specifically the need to use the term |x(obs) - x(coil)|^3 instead of R^3. This correction is crucial for obtaining accurate magnetic field calculations.

PREREQUISITES
  • Understanding of the Biot-Savart law for magnetic field calculations
  • Familiarity with cylindrical coordinate systems
  • Proficiency in Mathematica for scripting and integration
  • Knowledge of vector calculus, particularly cross products and integrals
NEXT STEPS
  • Learn how to implement the Biot-Savart law in Mathematica for different coil configurations
  • Explore advanced integration techniques in Mathematica, particularly for vector fields
  • Study the Helmholtz coil configuration and its applications in magnetic field homogenization
  • Investigate the effects of coil radius and current on the magnetic field distribution
USEFUL FOR

Physicists, electrical engineers, and students working on electromagnetism, particularly those interested in magnetic field calculations and coil design.

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!
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
92
Views
5K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K