Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more than two snapshots #32

Open
cruzchue opened this issue Apr 22, 2021 · 4 comments
Open

more than two snapshots #32

cruzchue opened this issue Apr 22, 2021 · 4 comments

Comments

@cruzchue
Copy link

The code for the Korteweg–de Vries problem (KdV.py) provides an example using only two time snapshots. I am wondering which parts need to be edited/added in order to use three or more time snapshots.

@nish-ant
Copy link

As proposed in the paper, the neural network, by design, is trained by minimizing the loss function which is a sum of squared errors calculated at two distinct time steps (equation (17) in paper).

For including information from more than two time steps, the calculation of loss can be done such that it iterates over all the snapshots.

@cruzchue
Copy link
Author

cruzchue commented Apr 22, 2021

Thanks for the quick response. The part of the loss function is certainly clear and well described along the four examples. I still have some related questions. First, I describe my understanding and the problem, then I post the questions.

Problem:

For calculating the loss, the script first computes the nonlinear operators in the functions net_U0 and net_U1. That is, net_U0 is for time snapshot 0, and net_U1 is for time snapshot 1: two time snapshots.

Now, for a third time snapshot, we would require a net_U2, which should not be a problem. But in both net_U0 and net_U1, there is a time step variable called "dt", which is the time difference between only two snapshot.

Questions:

  • For a three-snapshot problem, should I define two time steps (dt1, dt2) instead of one (dt)?

  • In that case, both dt1 and dt2 should be the time steps with respect to the first snapshot (t1-t0, t2-t0)?, or should they be difference among sequential times (t1-t0, t2-t1)?

@nish-ant
Copy link

nish-ant commented Apr 23, 2021

Alright, now I understand the question better.
I don't think the way you're trying to make it work will be possible in the given framework.

The time integration method is based on Runge-Kutta method, which takes intermediate steps between two time steps.
The implicit RK equations show this clearly.
However, you can tune the order, which ranges between q and 2q (q = number of stages).

Alternatively, a multistep method might be better suited for your task.

@cruzchue
Copy link
Author

Many thanks for the information. For sure, we will take a look at that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants