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

Suggestion: Adevection case 3 input #6

Open
jonny97 opened this issue Mar 21, 2023 · 3 comments
Open

Suggestion: Adevection case 3 input #6

jonny97 opened this issue Mar 21, 2023 · 3 comments

Comments

@jonny97
Copy link

jonny97 commented Mar 21, 2023

Hi Professor Lu, thanks for the well-written codes. I am reading the advection data generation code, case 3, where the input function is defined to be a square wave plus a continuous bump, the following are your parameter setting:

    c1 = 0.1 * rng.random() + 0.2  # [0.2, 0.3]
    w = 0.1 * rng.random() + 0.1  # [0.1, 0.2]
    h1 = 1.5 * rng.random() + 0.5  # [0.5, 2]
    c2 = 0.1 * rng.random() + 0.7  # [0.7, 0.8]
    a = 5 * rng.random() + 5  # 1 / [0.1, 0.2] = [5, 10]
    h2 = 1.5 * rng.random() + 0.5  # [0.5, 2]
    pde = Advection_v2(0, 1, c1, w, h1, c2, a, h2)

Thus, the c2 + a / h2 could be bigger than 1. In pde.solve code, seems like this case is never handled, and because of the periodic boundary condition assumption, the current implementation may have the following inputs:
Initial condition:
image
solution at t = 29/40
image

which means currently, the initial boundary will always be 0, which is not ideal (shall not be a big concern though). I am not sure if this is intended. Please let me know if there are some reasons behind this, thanks!

@lululxvi
Copy link
Member

What do you mean the initial boundary will always be 0?

@jonny97
Copy link
Author

jonny97 commented Apr 6, 2023

Sorry for the confusion. The initial condition in advection, case 3, according to the paper is:

$$u_0(x) = h_1 1_{(c_1 - \frac{w}{2}, c_1 + \frac{w}{2})} + \sqrt{\max(h_2^2 - a^2(x-c_2)^2, 0)}$$

with periodic boundary condition. In the code, $$a\in[5,10], h_2 \in [0.5,2], c_2 \in [0.7, 0.8]$$.
For example, if $c_2 = 0.8, a = 5, h_2 = 2$, for the second term to be nonzero, we have $x \in [0.4,1.2]$. The problem occurs at the boundary, $x=1$, $u_0(1)$ will be nonzero in this case but $u_0(0)$ is always zero with the current choice of $c_1, w$.

In the current implementation, $u_0(1)$ is not computed as we are using the periodic boundary, but this will lead to a jump of discontinuity in the function definition. The plot I attached in this initial post gives such an example. I am not sure if this is intended.

@lululxvi
Copy link
Member

Good catch. We don't intend to have the jump, but it is not a problem in practice, because the network can learn the jump.

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