mathLab / PINA

Physics-Informed Neural networks for Advanced modeling
https://mathlab.github.io/PINA/
MIT License
320 stars 59 forks source link

KS mat generation #303

Open dgm2 opened 1 month ago

dgm2 commented 1 month ago

Hello, could you share a snippet for how you generate the Data_KS.mat in tutorial 10 ? Thanks!

dario-coscia commented 1 month ago

Hi @dgm2 👋🏻 Since the dataset was relatively small we used scipy.integrate.solve_ivp to evolve the dynamic and a simple pseudospectral method for computing the derivatives (scipy has this functionality). You can take a look here, where they solve the KdV equation, we use a very similar structure. Hope it helps!😄

PS. If you want to generate a lot of data in the PyTorch format (with GPU) you can also have a look at this excellent work. You can play with the source code to obtain the test case we used in tutorial 10 :)