How to set up "mixed" boundary conditions for NDSolve for PDE? [closed]

I have the following PDE that I am able to solve using DirichletCondition with NDSolve as the following:

uu = NDSolveValue[{Laplacian[U[x, y], {x, y}] == 10*Sin[8*x*(y - 1)],
DirichletCondition[U[x, y] == 0, True]},
U, {x, -1, 1}, {y, -1, 1}];
Plot3D[Evaluate[uu[x, y], {x, -1, 1}, {y, -1, 1},
PlotRange -> {Automatic, Automatic, {-.5, .5}},
PerformanceGoal -> "Quality"]]


This works for me and it matches my numerical solution from MATLAB. However, I was trying to solve a similar PDE with different BCs. A Dirichlet BC on y with interval {-1,1} and a periodic BC on x with interval {0,2*pi}. I have a numerical solution in MATLAB that I would like to reproduce with Mathematica. Is this possible? Thanks.

• I have a numerical solution in MATLAB that I would like to reproduce with Mathematica. Is this possible? could you show that Matlab code? Dec 30, 2023 at 0:56
• What means "Dirichlet BC on y with interval {-1,1} "? Dec 30, 2023 at 11:58

If I correctly understand the boundary conditions try

    reg = Rectangle[ {0, -1}, {2 Pi, 1}  ];
V = NDSolveValue[{Laplacian[v[x, y], {x, y}] == 10*Sin[8*x*(y - 1)],
DirichletCondition[v[x, y] == 0, y == 1 || y == -1],
PeriodicBoundaryCondition[v[x, y], x == 2 Pi && -1 < y < 1,
TranslationTransform[{-2 Pi, 0}]],
PeriodicBoundaryCondition[v[x, y], x == 0 && -1 < y < 1,
TranslationTransform[{ 2 Pi, 0}]]}, v, Element[{x, y}, reg ],
Method -> {"FiniteElement",
"MeshOptions" -> {"MeshElementType" -> "TriangleElement",
"MaxCellMeasure" -> 2 Pi/1000 }}]
Plot3D[V[x, y], Element[{x, y}, reg], PlotRange -> All,
MeshFunctions -> (#3 &)]


In this example Mathematica v12.2 only handles PeriodicBoundaryConditions correctly if we use "MeshElementType" -> "TriangleElement"