weili101 / Deep_Plates

Physics-guided neural network framework for elastic plates
MIT License
30 stars 10 forks source link

about displacement boundary conditions #3

Closed bibiooi closed 5 months ago

bibiooi commented 9 months ago

Dear Dr.Li I am very happy to find your article,because it has inspired me a lot.But there are some questions I don't understand.In your section Ex1 Flat_tension_PDE_based_NN,if I want to change the boundary conditions,such as U=0andV=0(x=0) , what should I do.Forgive me for my stupidity,I cannot find the answer in code.

Looking forward to your reply.Please forgive me for any inconvenience.

weili101 commented 8 months ago

"Thank you for your interest in our work. Please feel free to ask any questions you may have.

Regarding the displacement boundary conditions, I would like to confirm that they are already included in the code. [You can find the exact boundary conditions you described in the README of this repository

We implemented the boundary conditions using a “hard constraint” approach. Specifically, we multiplied the output of the neural network u by x to obtain the final output, u’=u * x. If x=0, then u’ will always be 0."

I hope this helps! Let me know if you have any further questions.

Also check the following related lines in the code:

def derivative(x, Net, func, order): w = Net(x)*func(x).view(-1,1) # Multiply output of neural network with a function f(x), x has two columns representing x and y

func_u = lambda x: x[:,0] # First column is x func_v = lambda x: x[:,1] # Second column is y