pydens icon indicating copy to clipboard operation
pydens copied to clipboard

How to solve Elliptic PDE with four different boundary conditions?

Open dapratama opened this issue 3 years ago • 0 comments

Hi, @roman-kh @akoryagin @SergeyTsimfer @dpodvyaznikov

Firstly I want to thanks to you guys for making great library for solving PDE with NN. Now I'm going on project for solving PDE with NN too and interested to used your library and on practicing using it. But, I have an issue when try to solve Poisson eq with 4 different bc. For the example I practiced to solve this eq:

                              Uxx+Uyy = 4, 

with BC:

u(x, 0) = x^2,        u(x, 2) = (x-2)^2,          0<= x <=1
u(0, y) = y^2,        u(1, y) = (y-1)^2,          0<= y <=2

I can't find the correct solution to solving this PDE. I realized that there was a mistake when writing the code. But I can't find any correction in your documentation. Could you please help me how to write the correct code for this kind of PDE? Thank you very much.

pde = {
    'n_dims': 2, 
    'form': lambda u, x, y: D(D(u, x), x) + D(D(u, y), y) - 4,
    'boundary_condition': .........    <------- (how to write those BC mentioned above to here?)
}

dapratama avatar Dec 02 '20 08:12 dapratama