Im trying to solve an electromagnetics problem, where I have a a conductor with the shape of a square as the base and infinite length. Through the sides od these conducto, flows current, or better said, superficial current density (K). So I have to introduce four NeumannValue in the solution, but i don't know if this is possible. Here i put the code and the error that appears:

Aif = NDSolveValue[{Laplacian[A[x, y], {x, y}] == NeumannValue[mu0*
(Ic/side), x == side/2 && -side/2 <= y <= side/2], NeumannValue[mu0*
(Ic/side), x == -side/2 && -side/2 <= y <= side/2], NeumannValue[mu0*
(Ic/side), y == side/2 && -side/2 <= x <= side/2], NeumannValue[mu0*
(Ic/side), y == -side/2 && -side/2 <= x <= side/2],
DirichletCondition[Aif[x, y] == 0, x^2 + y^2 == r0^2]}, A, {x, y} 
\[Element] s, Method -> {"FiniteElement", "MeshOptions" -> 
{MaxCellMeasure -> 0.01}}];

The error that appears is the following:

NDSolveValue::deqn: Equation or list of equations expected instead of 
NeumannValue[1.25664*10^-6,x==-(1/2)&&-(1/2)<=y<=1/2] in the first 
argument {(A^(0,2))[x,y]+(A^(2,0))[x,y]==NeumannValue[1.25664*10^-

What's the problem? Maybe I should define all that in just one NeumannValue? Or there's another point on that? Thank you!

  • 1
    $\begingroup$ Can you provide the equations and conditions? Because the code are totally wrong and not-understandable. $\endgroup$
    – m0nhawk
    Apr 18, 2018 at 20:00

1 Answer 1


Unfortunately, the code you provide is incomplete. At a minimum you will have to change to this:

Aif = NDSolveValue[{Laplacian[A[x, y], {x, y}] == 
       x == side/2 && -side/2 <= y <= side/2] + 
       x == -side/2 && -side/2 <= y <= side/2] + 
       y == side/2 && -side/2 <= x <= side/2] + 
       y == -side/2 && -side/2 <= x <= side/2], 
    DirichletCondition[A[x, y] == 0, x^2 + y^2 == r0^2]}, 
   A, {x, y} \[Element] s, 
   Method -> {"FiniteElement", 
     "MeshOptions" -> {MaxCellMeasure -> 0.01}}];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.