lululxvi / deepxde

A library for scientific machine learning and physics-informed learning
https://deepxde.readthedocs.io
GNU Lesser General Public License v2.1
2.62k stars 737 forks source link

Inverse problem for a space and time dependent variable. #1601

Open hannanmustajab opened 9 months ago

hannanmustajab commented 9 months ago

Hey @lululxvi, I was going through examples of inverse problems, but I couldn't find anything about solving time-dependent Pde with space and time-dependent parameters. I understand that I will have to deploy another neural network for the same, but I am a bit confused here as the equation is : Utt = c(x,y)*2 ( Uxx + Uyy )

I would have two networks:

Can you please point me to some other threads, or give me some directions on how to solve this? https://deepxde.readthedocs.io/en/latest/demos/pinn_inverse/elliptic.inverse.field.html I was going through this example, but here both have the same input and output dimensions.

Thanks in advance for your help. Hannan

lululxvi commented 8 months ago

space and time-dependent parameters? So c(x,y,t)? If so, then follow the demo you mentioned.

If it is c(x,y), there are some discussions. You can check FAQ.

hannanmustajab commented 8 months ago

@lululxvi It is C(x,y) and not C(x,y,t). I followed some posts, but there it was with tensor flow backend. I am using PyTorch backend, and it didn't work. Can you please provide some pseudo code or code snippet just for that part? It would be really helpful, as I've spent quite some time trying to figure that out.

I saw this code snippet from one of the previous posts. But how would I do this in Pytorch ?

def apply_output_transform(inputs, outputs):
    p = outputs[:, 0:1]
    x = inputs[:, 0:1]
    C = FNN(x)
    return tf.concat([p, C], axis=1)

Regards Hannan

lululxvi commented 7 months ago

If you understand the code, it is straightforward to implement in pytorch.