lu-group / pinn-sampling

Non-adaptive and residual-based adaptive sampling for PINNs
Apache License 2.0
46 stars 12 forks source link

coupled PDEs #2

Open katayooneshkofti opened 1 year ago

katayooneshkofti commented 1 year ago

Hello @lululxvi @ChenxiWu123 @MinZhu123 Thank you for sharing your code. Are RAD and RAR-D applicable for coupled PDEs? It seems that for computing error_eq and err_eq_normalized, we need some modifications.

MinZhu123 commented 1 year ago

@kjaisingh @lululxvi @ChenxiWu123 Thank you for your good question. You could replace the code Y = np.abs(model.predict(X, operator=pde)).astype(np.float64) with Y = np.sum(np.abs(np.array(model.predict(X, operator=ode_system)).reshape(-1, len(X), 1)),axis=0).astype(np.float64) This code could be used for both single PDE and coupled PDEs. Please let me know if you have any question or issue.

katayooneshkofti commented 1 year ago

Thank you for your response @MinZhu123 . It was a great help. Before you answered, I used the following code and it worked: Y = np.abs(model.predict(X, operator=ode))[0] I should check the final results and probable differences between them.

katayooneshkofti commented 1 year ago

I tested the code. It had an error 'list' object has no attribute 'reshape'. Therefore, I made the following modification, and now it works:

`Y1 = np.array(model.predict(X, operator=ode))
 Y = np.sum(np.abs(Y1.reshape(-1, len(X), 
 1)),axis=0).astype(np.float64)`
MinZhu123 commented 1 year ago

Hi, @katayooneshkofti. Your code is identical with my code. Could you check again? By the way, I modified my code 5 minutes after my first version. Perhaps you used my old version.

katayooneshkofti commented 1 year ago

Yes, I did not check the last version of your code. Thank you. I close the issue.