NeuralPDE.jl icon indicating copy to clipboard operation
NeuralPDE.jl copied to clipboard

Change the order of placement OF Bcs Results in CHANGE answers

Open mohsenhos opened this issue 3 years ago • 4 comments

when we define 5 boundary condition like this:

# Boundary conditions bcs = [Dx(u(-1,y)) ~ 0, Dx(u(1,y)) ~ 0, Dy(u(x,-1)) ~ 0,Dy(u(x,1))~0, Dy(u(0:1,0)) ~ 0]

the answer like this:

image

AND when we replace the 2 last condition with other like this:

# Boundary conditions bcs = [Dx(u(-1,y)) ~ 0, Dx(u(1,y)) ~ 0, Dy(u(x,-1)) ~ 0, Dy(u(0:1,0)) ~ 0,Dy(u(x,1))~0]

the answer is changed like this:

image why this happened?

mohsenhos avatar Nov 10 '21 02:11 mohsenhos

@mohsenhos Interesting, it should not depend on the order, most likely a typo in the script. Could you share the full script? what it is? u(0:1,0)

KirillZubov avatar Nov 10 '21 15:11 KirillZubov

yes this is the full script: https://github.com/mohsenhos/helmholtzpde/blob/main/pdeinit.jl the main domain in [-1,1] and we have 5 boundary condition , the internal BC in range [0,1] like this: 111

I define it by : range(0, step=0.05, stop=1),0)

mohsenhos avatar Nov 16 '21 02:11 mohsenhos

it is not supported grammar

 julia> u(range(0, step=0.05, stop=1),0)
    u(0.0:0.05:1.0, 0)

there is a bug and parsing like u(x, 0)

KirillZubov avatar Nov 16 '21 14:11 KirillZubov

oh no , it is weird I'm surprised but it really creates a set of the point corresponding to StepRangeLen u(range(0, step=0.05, stop=1),0) for GridTraining.

Although this was not planned

z_= prob.f.f.loss_function.bcs_loss_function.bc_loss_functions.contents[end-1]

julia> z_.train_set
2×31 Matrix{Float64}:
 0.0  0.01  0.02  0.03  0.04  0.05  0.06  0.07  0.08  0.09  0.1  …  0.21  0.22  0.23  0.24  0.25  0.26  0.27  0.28  0.29  0.3
 0.0  0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0     0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0

KirillZubov avatar Nov 16 '21 16:11 KirillZubov