# Magnetic force calculation for parallel wires using Maxwell stress tensor. Issue with shear forces

I am trying to calculate the forces in between permanent magnets and ferromagnetic surfaces with the Maxwell stress tensor using image theory and the Biot-Savart law. However I discovered a weird behavior regarding shear forces where I somehow must use the Maxwell stress tensor wrong.

I can break down the problem to the force calculation in between two parallel wires with similar direction of current. The calculation of the flux density is quite easy based on amperes law. For two parallel wires aligned in the y axis the flux density component in the centerline of the permanent magnets ($$y =50$$ in the graphic) must be zero.

In theory I can now find the magnetic forces in 2D by utilizing the Maxwell stress tensor:

$$F_x = \int_{-\infty}^\infty \frac{1}{\mu_0}( B_x(x,0)^2 - \frac{1}{2}(B_x(x,0)^2+B_y(x,0)^2) + B_x(x,0)\cdot B_y(x,0) dx$$ $$F_y = \int_{-\infty}^\infty \frac{1}{\mu_0}(B_x(x,0)\cdot B_y(x,0) + B_y(x,0)^2 - \frac{1}{2}(B_x(x,0)^2+B_y(x,0)^2) dx$$ Note: in the graphic the $$0$$ is at the $$y$$ value $$50$$ I just kept the zero in the equation to explain it here.

This works fine for $$F_y$$. The result matches the Lorentz force equation well. For $$F_x$$ however the results and the equation itself makes no sense at all. I would be expecting zero force in the direction of $$x$$. However if we insert $$B_x(x,0) = 0$$ (based in symmetry) into the equation for $$B_x$$ we get

$$F_x = \int_{-\infty}^\infty \frac{1}{\mu_0}( 0 - \frac{1}{2}(0^2+B_y(x,0)^2) + 0 dx = \int_{-\infty}^\infty \frac{1}{\mu_0}(\frac{1}{2}(B_y(x,0)^2) dx \neq 0$$

Because $$B_y$$ is squared the part to integrate will always be positive which is resulting in a net force in the x direction which makes no sense at all.

Can anybody explain to me where my mistake in using the Maxwell stress tensor is ?

You've applied the stress tensor incorrectly. If we want to find the force in the $$i$$-direction on a collection of charges & currents using the stress tensor, then it is $$F_i = \oint T_{ij} n_j da,$$ where $$\hat{n}$$ is the normal to the surface (and I'm using Einstein summation). In your case, for the lower half-space you have $$\hat{n} = \hat{y} \quad \Rightarrow \quad n_x = n_z = 0, \quad n_y = 1$$ and so $$F_x = \oint T_{xy} \, da \qquad F_y = \oint T_{yy} \, da.$$ Note that the $$i$$ index has to match on both sides of the equation, and that the $$j$$ index is set equal to $$y$$ by virtue of the fact that $$\hat{n}$$ only points in the $$y$$-direction.
You were calculating instead $$F_x = \oint (T_{xx} + T_{xy}) \, da \qquad F_y = \oint (T_{xy} + T_{yy}) \, da;$$ both expressions were technically incorrect, but you got the right result for $$F_y$$ because $$T_{xy} = 0$$ in this case.