Replies: 1 comment 2 replies
-
|
Your code is hard to read. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
I am training a Laplace equation with PINN. The solution area and boundary conditions of my research are shown in the figure below.
Below is part of my code.
outer_geom = dde.geometry.Rectangle([0, 0], [1, 1]) inner_geom = dde.geometry.Rectangle([0.4, 0.4], [0.6, 0.6]) def boundary_outer(x, on_boundary): return on_boundary and outer_geom.on_boundary(x) def boundary_inner(x, on_boundary): return on_boundary and inner_geom.on_boundary(x) geom = outer_geom - inner_geom bc_inner = dde.icbc.DirichletBC(geom, lambda x: 1, boundary_inner) bc_outer = dde.icbc.DirichletBC(geom, lambda x: 0, boundary_outer) bc = [bc_inner, bc_outer] data = dde.data.PDE(geom, pde_laplace, bc, num_domain=1500, num_boundary=1520, num_test=2500) net = dde.nn.FNN([2] + [30] * 10 + [1], "tanh", "Glorot uniform") model = dde.Model(data, net) loss_weights = [1, 100, 10] model.compile("adam", lr=0.001, loss_weights=loss_weights) model.train(epochs=50000) model.compile("L-BFGS") losshistory, train_state = model.train()But the training results are weird. As shown below, the interior boundary does not satisfy the Dirichlet boundary condition U=1.
What is causing this problem and how can I improve the code?
Beta Was this translation helpful? Give feedback.
All reactions