# NDSolveValue. x cannot be used as a variable

Im trying to solve an electrocinetic problem that is supposed to be very easy. I only need a region and some DirichletCondition, adn then solve the Lagrange equation. Here you've got the program.

Needs["NDSolveFEM"]
Clear[Rint, Rext, vint, vext, x, y, u, uif, e0, o1, o2, o]
Rint = 2;
Rext = 4;
vint = 1;
vext = 0;

o1 = Disk[{0, 0}, Rext];
o2 = RegionDifference[o1, Disk[{0, 0}, Rint]];
o = RegionDifference[o2, Rectangle[{-Rext, -Rext}, {Rext, 0}]];

CC = {
DirichletCondition[u[x, y] == vext, Sqrt[x^2 + y^2] == Rext],
DirichletCondition[u[x, y] == vint, Sqrt[x^2 + y^2] == Rint]
};

uif = NDSolveValue[{Lagrangian[u[x, y], {x, y}] == 0, CC},
u, {x, y} \[Epsilon] o,
Method -> {"FiniteElement",
"MeshOptions" -> {MaxCellMeasure -> 0.001}}];


Then, this message appears:

NDSolveValue::dsvar: x \[Epsilon] BooleanRegion[#1&&!#2&&!#3&,{Disk[{0,0},4],Disk[{0,0},2],Rectangle[{-4,-4},{4,0}]}] cannot be used as a variable.


I can't undestand why this happens, as I have a model program very similar to this one as an example.

• The syntax for region membership is {x, y} \[Element] o, not \[Epsilon]. (It's not complaining about x but about the whole expression.) Apr 6 '18 at 12:11
• What is: Lagrangian ? Apr 6 '18 at 12:12
• @MariuszIwaniuk Oh, I forgot I changed that to Laplacian. If it's Lagrangian, then Sergio forgot (to include) the definition. But the syntax error seems the major problem. Apr 6 '18 at 12:13
• @MichaelE2 that was the problem ^^ thank you very much! how do a say that your answer worked? i mean how to accept it? Apr 6 '18 at 12:24

The syntax for region membership is {x, y} \[Element] o, not \[Epsilon], which look very similar:
{x, y} \[Element] o Unless \[Epsilon] has a definition, it will show up blue instead of black. (The error message is not complaining about x but about the whole expression.)