Creating a magnetic field (vector field)

AI Thread Summary
The discussion centers on creating a 3D vector field to represent a magnetic field around a wire segment carrying a constant current, utilizing Biot-Savart's law. The user has made progress by defining the position vector and expressing the necessary components for the magnetic field calculation. They are seeking advice on simplifying the evaluation of the integral involved in Biot-Savart's law, particularly due to the complexity introduced by the denominator. Initial tests in Mathematica yielded correct visualizations for an infinite wire, but the computations were time-consuming. Suggestions for alternative techniques or resources to streamline this process are requested.
piscosour00
Messages
6
Reaction score
0
Hi all,

I have a question for all of you. I've been wanting to make a 3D vector field that would represent a magnetic field (for fun) around some segment of wire with a constant current flowing through it. I'm assuming I have a parametric equation for the wire segment. The one equation that comes to mind is Biot-Savart's law:

\vec { B } =\frac { { \mu }_{ 0 }I }{ 4\pi } \int { \frac { d\vec { s } \times \hat { r } }{ { r }^{ 2 } } }

In practice, I've only ever used Biot-Savart's law to calculate in 2-D, and either the wire segment has been of infinite length, or we were just calculating the electric field at one-point, and the math has been nice. I want to generate a vector field that gives the magnetic field at all points around the wire. Does anyone know how to go about doing this ? What sorts of equations/techniques lend themselves to this ? Any nice examples people can point to (URLs) ?? Thank you.
 
Physics news on Phys.org
Ok I've made some progress:

If I say that any point in R3 can be given by the position vector:

\vec { p } =[{{ x }_{ 0 }{ ,y }_{ 0 }{ ,z }_{ 0 } } ]

Since the vectors r and r-hat are vector that points from a point on the wire to the point in R3 at which you want to know the magnetic field, we can write the vector r as:

\vec { r } =\vec { p } -\vec { s }

And therefore r-hat is:

\hat { r } =\frac { \vec { p } -\vec { s } }{ { |\vec { p } -\vec { s } | } }

Where the vector s is the parametrization of the wire, and so Biot-Savart's law can be written as:

\vec { B } =\frac { { \mu }_{ 0 }I }{ 4\pi } \int { \frac { d\vec { s } \times \hat { r } }{ { r }^{ 2 } } } =\frac { { \mu }_{ 0 }I }{ 4\pi } \int { \frac { d\vec { s } \times (\vec { p } -\vec { s } ) }{ { |\vec { p } -\vec { s } | }^{ 3 } } }

This I can now integrate after evaluating the cross product, but it's not an easy integral to evaluate because of the nasty term in the denominator. Does anyone have any ideas for an easier way of evaluating this integral ? I tested this out in Mathematica for the simple case of an infinite wire running along the x-axis, and the resulting 3D vector plot looked right, but even Mathematica took a long time to evaluate the integral. Any ideas ?
 
Last edited:
This is from Griffiths' Electrodynamics, 3rd edition, page 352. I am trying to calculate the divergence of the Maxwell stress tensor. The tensor is given as ##T_{ij} =\epsilon_0 (E_iE_j-\frac 1 2 \delta_{ij} E^2)+\frac 1 {\mu_0}(B_iB_j-\frac 1 2 \delta_{ij} B^2)##. To make things easier, I just want to focus on the part with the electrical field, i.e. I want to find the divergence of ##E_{ij}=E_iE_j-\frac 1 2 \delta_{ij}E^2##. In matrix form, this tensor should look like this...
Thread 'Applying the Gauss (1835) formula for force between 2 parallel DC currents'
Please can anyone either:- (1) point me to a derivation of the perpendicular force (Fy) between two very long parallel wires carrying steady currents utilising the formula of Gauss for the force F along the line r between 2 charges? Or alternatively (2) point out where I have gone wrong in my method? I am having problems with calculating the direction and magnitude of the force as expected from modern (Biot-Savart-Maxwell-Lorentz) formula. Here is my method and results so far:- This...
Back
Top