Neural network - mathematical function - laplacian - autograd -- 2

Job ID: 35612177

Budget: $30 – $250 USD

I am currently working on the following project : I need to estimate a function u (neural) using the loss function (-u''-f) where u'' corresponds to the second derivative of the neural function u, and f is known.
The code has been built taking into consideration a real function u (sin(pi.x).sin(2pi.y)) and its laplacian f.

In the following code, it is not working properly since the second dimension (y) is not taken into account (see graph of u neural versus the u we should normally have).

We have also to observe the initial conditions: in 2 dimensions, the function u(x,y) is defined as follows : u(0,y)=0 and u(x,0) =0 whatever resp. x and y in [0,1].

Can anyone check the code and tell me why is does not work properly?
Related categories: Mathematics Neural Networks Pytorch