# Get magnetic field if you know electric current

1. Aug 31, 2014

### skrat

1. The problem statement, all variables and given/known data
In other words, I have an equation: $\nabla \times \vec B =\mu _0 \vec j$, where $\vec j = (f(x,y),g(x,y),0)$.

I need to find $\vec B$.

2. Relevant equations

3. The attempt at a solution

I tried to write each component separated, but I don't see how to continue, since all components of $\vec B$ are in general functions of x,y and z.

For example first component:

$\frac{\partial }{\partial y}B_3-\frac{\partial }{\partial z}B_2=\mu_0f(x,y)$ There is nothing I can do... Or maybe not?

Or the third component might be the easiest, since $j_3=0$, than

$\frac{\partial }{\partial x}B_2=\frac{\partial }{\partial y}B_1$

:O Anything I can do?

2. Aug 31, 2014

### jackarms

Well, it looks like you'll have three unknowns -- $B_{x}, B_{y}, B_{z}$ -- so you'll need three equations to solve for all of them. If you find the equation for the second component you should be able to solve for $\vec{B}$ in full.

3. Aug 31, 2014

### skrat

Amm... Here are all three:

$\frac{\partial }{\partial x}B_2=\frac{\partial }{\partial y}B_1$

$\frac{\partial }{\partial y}B_3-\frac{\partial }{\partial z}B_2=\mu_0f(x,y)$

$\frac{\partial }{\partial z}B_1-\frac{\partial }{\partial x}B_3=\mu_0g(x,y)$

4. Aug 31, 2014

### jackarms

I almost didn't see the partial derivatives. Those certainly make this more complicated. I've actually asked this on math.stackexchange to see what the people over there think. One answer I've found is that you can use the Biot-Savart law to solve for $\vec{B}$:

$$\bf{B}(r) = \int \frac{\bf{j(r')} \times {(\bf{r}-\bf{r'})}}{|r-r'|^3} d^3\bf{r'}$$

You can see if you can work through that integral, although it looks rather daunting...

5. Sep 1, 2014

### skrat

Hm... let's work a bit with that integral, just to see if I understood you correctly.

Lets say $\vec j=(j_1,j_2,j_3)$ and $\vec r=(x_0,y_0,z_0)$ and ${\vec r}'=(x,y,z)$.

Than $\vec j \times (\vec r-{\vec r}')=(j_2(z_0-z)-j_3(y_0-y),j_3(x_0-x)-j_1(z_0-z),j_1(y_0-y)-j_2(x_0-x))$ and $|\vec r-{\vec r}'|^3=((x_0-x)^2+(y_0-y)^2+(z_0-z)^2)^{\frac 3 2 }$

So you are saying that I should do three integrals, similar to this one:

$B_x=\int\int\int \frac{j_2(z_0-z)-j_3(y_0-y)}{((x_0-x)^2+(y_0-y)^2+(z_0-z)^2)^{\frac 3 2 }}dxdydz$

or...?

6. Sep 2, 2014

### rude man

Have you had the magnetic vector potential?

7. Sep 3, 2014

### skrat

Well, I have a big problem that my current density is horrible.

$\vec j=C(\frac{a^2-x^2+y^2}{a^4+2a^2(-x^2+y^2)+(x^2+y^2)^2},-2\frac{xy}{a^4+2a^2(-x^2+y^2)+(x^2+y^2)^2})$

So if I write the integral in post #5 in Mathematica, I can't get an analytic solution, because it is absolutely horrible.

But than I found another equation saying that $\nabla ^2\vec B=-\mu _0 \vec j$, which tells me that $(\nabla ^2 B_x,\nabla ^2 B_y,\nabla ^2 B_z)=-\mu_0 (j_x,j_y,0)$.

I don't want to solve these Poisson's equations, because I can imagine how horrible this will be, BUT the third component should be rather easy.

For the third component I have a Laplace equation $\nabla ^2 B_z=0$ and Green's function for 3D space should do the job perfectly. Let's say that we have solved this equation, and let's assume for a moment that now we know $B_z(x,y,z)$.

Using the equation I get from $\nabla \times \vec B=\mu_0 \vec j$ I can also get this: $\frac{\partial }{\partial z}B_x-\frac{\partial }{\partial x}B_z=\mu_0g(x,y)$.

In this last equation, only $B_x$ is unknown. Therefore

$B_x=\int \frac{\partial }{\partial x}B_3(x,y,z)dz+\int\mu_0g(x,y)dz +C(x,y)$

NOW THE PROBLEM OF THIS IDEA:

I would expect for magnetic field to go towards zero if $x,y,z->\infty$. And it works perfectly for $x,y$. BUT the last integral is $\int\mu_0g(x,y)dz=g(x,y)z$

Obviously if I send $z$ to infinity, $B_x$ will never go towards zero. And I know that integral also comes with a constant, but this constant is a function of $C(x,y)$ and not $C(x,y,z)$.

So now I am completely lost.

I guess I will just have to convince Mathematica to somehow integrate the Biot-Savart numerically. I don't really know how to do it, but it is the last idea I have left.

8. Sep 3, 2014

### BvU

Take a good look at the current density expression. I suspect there is some hidden beauty there ...

Could it be that the current density is limited to the area x2 + y2 < a2 ?

Last edited: Sep 3, 2014
9. Sep 3, 2014

### skrat

$a$ is just an arbitrary constant that defines the positions of electrodes on my plate. The electrodes are at $(\pm a,0)$.

Plotted vector $\vec j$ looks like this:

Plotted $|\vec j |$ looks like this:

So, current density is defined on whole 2D infinte plate, but is the biggest on the area x2 + y2 < a2 as you mentioned, yes.

10. Sep 3, 2014

### BvU

Looks pretty to me... Also looks familiar ! (also you have me wondering what program is so smart it draws these magnificent curved vectors, but dumb enough to give them all the same size...)

Point of criticism: you found $\nabla ^2\vec B=-\mu _0 \vec j$ which should be $\nabla ^2\vec A=-\mu _0 \vec j$ so there's your magnetic vector potential !

Then: You start post #1 with "In other words ..." but I am beginning to be real curious to read the whole story, including the original words...

11. Sep 3, 2014

### skrat

Yes, but the Poissons equations to get $\vec B$ are horrible. Or maybe I don't understand what you're trying to tell me...

Check the topic title too:

"Get magnetic field if you know electric current. In other words, I have an equation ..."
Huh, the whole story is really long. But if you think it would help, I can write it.

12. Sep 3, 2014

### BvU

Whole story, whole story... at least the relevant parts. Apparently you have $\vec \jmath$ in a plate only, so do we work in 2D, or do we have j = 0 for z $\ne$ 0 ?

And do you want $\vec B(x,y,z)$ all over the place, or also only on the plate ?

13. Sep 3, 2014

### skrat

Long story short (If not enough, just tell me and I will write a complete report):

On an infinite plate i have two electrodes $2a$ apart. The electric potential difference between the electrodes is $U$. The problem wants me to calculate $\vec B$ anywhere in space, so yes, I need $\vec B(x,y,z)$.

Well, I quickly found out the Laplace equation for electric potential on the plate $\nabla ^2 \phi =0$. I solved it, using 2D Green's function and the solution is:
$\phi =Aln(\frac{(x-a)^2+y^2}{(x+a)^2+y^2})$

From the electric potential it is rather easy (using Mathematica) to calculate the electric field on the plate $\vec E$. Now for given conductivity (let's say it is constant in all directions) of the plate, we can easily get current density on the plate with $\vec j=\sigma \vec E$.

$\vec j=C(\frac{a^2-x^2+y^2}{a^4+2a^2(-x^2+y^2)+(x^2+y^2)^2},-2\frac{xy}{a^4+2a^2(-x^2+y^2)+(x^2+y^2)^2})$.

Yeah, this is it. I think I answered all of your questions.
One more thing, well originally the problem also states that the plate also has thickness. But since it is infinite I made an approximation that it is in fact 2D or even better: let's say that I am solving this problem for $d<<a$ if $d$ is the thickness of the plate.

EDIT: BTW, nobody claims that this has an analytic solution.

14. Sep 3, 2014

### rude man

If you correctly determined j then finding B is a matter of computing A, then computing B = x A.

A is the integral (1/4π)∫ j dV/r

where V is a differential unit of volume containing j and r is the distance (not a vector) between dV and the point of observation.

Straightforward, assuming you figured out j(x,y,z). I guess that is part of the problem.

15. Sep 3, 2014

### skrat

Ok. I guess didn't write it obvious enough.

The integral you want me to do:

$\vec A(\vec r)=\frac{\mu _0}{4\pi }\int \frac{\vec j({\vec r}')}{|\vec r-{\vec r}'|}d{\vec r}'$

Where $\vec r=(x_0,y_0,z_0)$ is vector the point anywhere in space (for example, point where in want to know $B$) and ${\vec r}'$ is vector on the plate. The first component $A_x$ is

$A_x=\frac{C\mu _0}{4\pi }\int\int\frac{a^2-x^2+y^2}{(a^4+2a^2(-x^2+y^2)+(x^2+y^2)^2)\sqrt{((x-x_0)^2+(y-y_0)^2+z_0^2}}dxdy$

Now I hope this makes it obvious for all of us, that nobody wants to actually do this integral. Or am I mistaken?
I tried to put it in mathematica, yet after 5 minutes of waiting for the result I had to abort the process.

16. Sep 3, 2014

### rude man

Right, I meant H = del x A, not B = del x A. My A = your A/mu0.

I think the problem is poorly worded to begin with.