Skip to content

Can you tell me what's wrong in this code ? #674

Answered by akapet00
athtareq asked this question in Q&A
Discussion options

You must be logged in to vote

Well, few things. I am not the DeepXDE author of course, but I tried to run your code and notice few logical errors.

  1. you specify boundary left and boundary right but both Dirichlet and Neumann BCs are specified for x=0.
  2. you specify solution interval x ∈ [-15, 15] which means that neural network must extrapolate because given boundary conditions are specified for x=0, thus it fails.
  3. you didn't provide analytical solution so your "true" results are at y=0. Instead of y'' + y = 0, I tried y'' - y = 0 to avoid complex solutions. What I am getting for x ∈ [0, 1] is following:

Code used:

def ode_system(t, y):     
    dy_t = tf.gradients(y, t)[0]
    dy_tt = tf.gradients(dy_t,t)[0]
    retur…

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lululxvi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #674 on May 13, 2022 22:51.