deepxde icon indicating copy to clipboard operation
deepxde copied to clipboard

Inverse problem for a space and time dependent variable.

Open hannanmustajab opened this issue 1 year ago • 3 comments

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:

  • First with 3 inputs and 1 output, which will be for computing the Pde residual and BCs.
  • Second, which will have two inputs (x,y).

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

hannanmustajab avatar Dec 23 '23 19:12 hannanmustajab

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.

lululxvi avatar Jan 11 '24 03:01 lululxvi

@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

hannanmustajab avatar Jan 13 '24 13:01 hannanmustajab

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

lululxvi avatar Feb 01 '24 20:02 lululxvi