-
Less an issue, more noobish kind of question: I can not understand how to define boundary conditions for, lets say, a simple analytically solvable ODE. If the equation in its general form looks like: with BCs: how can I define this using DDE? Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 2 replies
-
Check the example here https://github.com/lululxvi/deepxde/blob/master/examples/Poisson_Robin_1d.py |
Beta Was this translation helpful? Give feedback.
-
Thank you. In my case the Dirichlet b.c. is not a function of some variable x. It is constant value. I tried something like:
but I get the error saying that:
When I created the array with all values set to zero and only the last element to T_c, I got completely wrong prediction plot. I guess this is a wrong approach? |
Beta Was this translation helpful? Give feedback.
-
Could you try: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Could me provide the full code, including the values of w_b, Q_m, etc? |
Beta Was this translation helpful? Give feedback.
-
Yes, of course. I copied and pasted relevant parts alongside with the function that calculates the analytical solution. I hope I did it correctly.
|
Beta Was this translation helpful? Give feedback.
-
Hello, I have the same question regarding boundary conditions, and I get the same constant function as a result. Did you find any solutions or workarounds ? |
Beta Was this translation helpful? Give feedback.
-
@tareqath I did not yet. Best, |
Beta Was this translation helpful? Give feedback.
-
@tareqath @lululxvi Quick update. With the following code I am able to reproduce the overall change in the ODE but still I think that boundary conditions are not well defined:
But true results are set to 0 and T values are completely wrong. Note that the problem is: |
Beta Was this translation helpful? Give feedback.
-
Hi @lululxvi, sorry for bothering you again. I tried this code for a few other PDE time-invariant equations (including those in your examples directory) and it worked flawlessly. I was going through the code base and I couldn't find what I am doing wrong. I presume it has to be something with initial conditions but even when I set both boundaries to Dirichlet it still produces same invalid results. Thank you! |
Beta Was this translation helpful? Give feedback.
-
@antelk I checked your code. Here are some modifications:
Note:
Summary: By using the codes above, we can have the solution with the correct right boundary condition, but the solution is still of large error. The difficulty comes from the optimization. You can carefully monitor the loss values during the optimization. Your domain and PDE have different scales. Can you rescale your problem, such that
|
Beta Was this translation helpful? Give feedback.
-
Thank you! I am getting perfect results even with less iterations than 10k now. I completely ignored the fact that term |
Beta Was this translation helpful? Give feedback.
-
Yes, the uncertainty is based on dropout, see https://www.sciencedirect.com/science/article/pii/S0021999119305340 for details. Treating inputs as distribution is doable, and there are some work on this, but I am not an expert on this. |
Beta Was this translation helpful? Give feedback.
-
Alright. Thank you again. |
Beta Was this translation helpful? Give feedback.
-
Hello,I tried to reproduce your case using DEEPXDE, I performed the calculation of the domain and the scaling of the PDE, I was able to calculate it accurately using the Dirichlet boundary condition, unfortunately, when I used the Robin boundary condition you provided I was unable to calculate it, I would like to ask you, how did you implement the Robin boundary condition calculation |
Beta Was this translation helpful? Give feedback.
@antelk I checked your code. Here are some modifications:
Note:
bc_r = dde.DirichletBC(geom, lambda x: np.full_like(x, T_c), boundary_r)
loss_weights
…