pnnl / neuromancer

Pytorch-based framework for solving parametric constrained optimization problems, physics-informed system identification, and parametric model predictive control.
https://pnnl.github.io/neuromancer/
Other
870 stars 114 forks source link

Initial and boundary conditions with derivatives +PINNs #155

Closed AnmarAl-Adly closed 3 months ago

AnmarAl-Adly commented 3 months ago

Hi @drgona,

I've updated the PINN code for for a project involving dynamic load simulation in structural engineering models and tried to incorporate the initial and boundary conditions required for a simply supported beam. The conditions are defined as follows:

Boundary conditions: 1- Deflection of beam y= 0 at x=0 and x =L (Which I did it in the code) 2-The second derivative of deflection with respect to position, 𝑑2𝑦_𝑑2 = 0 (x =0 and x =L) (I'm stuck here!)

Initial condition: 1- Deflection (y) = 0 (t =0 ) (I did it ) 2- dy_dt = 0 at (t =0) (I'm stuck here!) Please see the attached example code link. https://colab.research.google.com/drive/1Q4aCWcDxh1IRVT1QltjSbwG5fNDTK9yL?usp=sharing

Could you please provide some guidance on this?

With regards, Anmar

drgona commented 3 months ago

Hi @AnmarAl-Adly you can impose additional IC and BC on derivatives the same way you do on the output of the neural net. just instead of y_hat variable use dy_dt and d2y_d2t, something like dy_dt[IC_BC_indices] == 0 where IC_BC_indices are indexing the points on boundaries as you don't want to impose these constraints over the whole domain.

drgona commented 3 months ago

For future requests about problem formulations please use our Discussions portal: https://github.com/pnnl/neuromancer/discussions