# Nonrectangular region for NDSolve

I have a PDE with mixed boundaries (Neumann and Dirichlet on some sides) in the region

$(t,x,y) \in \left( 0, T\right) \times\left\{ -L \leq x \leq L, 0 \leq y \leq h(x) \right\}$

where $h(x)$ is something like $\exp\left\{ -(x-x^*)^2\right\}$, doesn't matter. And I have Neumann boundary condition on the curve $\left(x, h(x)\right)$.

How can I provide such region to NDSolve?

-
Perhaps you may find a mapping that transforms that into a rectangle –  belisarius Dec 25 '13 at 18:30
This related question may help. Basically, go from (t,x,y) to (t,x,u) where u=H corresponds to the boundary y=h(x). –  Timothy Wofford Dec 26 '13 at 8:29

NDSolve requires a rectangular domain, so you have to make a change of coordinates.

$(t,x,y) \in \left( 0, T\right) \times\left\{ a \leq x \leq b, g(x) \leq y \leq h(x) \right\}$

Since you have explicit expressions for your boundaries ($x=a$, $x=b$, $y=g(x)$, and $y=h(x)$), we can use a linear interpolation

coords={u,v};
x[u_, v_] = (1 - u)*a + u*b
y[u_, v_] = With[{x=x[u,v]},(1 - v)*g[x] + v*h[x]]
$Assumptions = {Element[{g[_], h[_]}, Reals], h[a_] > g[a_]}  In terms of these coordinates your domain becomes$(t,u,v) \in \left( 0, T\right) \times\left\{ 0 \leq u \leq 1, 0 \leq v \leq 1 \right\}$In my other answer I described how to transform the PDE. The general steps are 1. write your metric 2. find its inverse and determinant 3. find the basis vectors and basis covectors 4. transform components of vectors into the new coordinate bases 5. find expressions for operations (directional derivatives, laplacians, etc.) 6. transform PDE and IV/BVs NDSolve should then be able to give you a solution in terms of$u$and$v\$.

sol=F/.First@NDSolve[eqns,F,{t,0,T},{u,0,1},{v,0,1}]


Clear[x,y];

@MarkMcClure, I was wondering why you deleted your answer. I would un-delete it, since it had good info. If it has a mistake, you can edit a comment, and maybe we can fix it. I agree that the equation representing the boundary condition must be changed along with PDE. The Neumann BC is n[x].grad[F[x,h[x]]==bc[x]. In the answer I linked to, I showed how to transform the directional derivative. –  Timothy Wofford Dec 27 '13 at 19:12