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

sigma_x and sigma_t in heat1D/heat1D.py #2

Open
smao-astro opened this issue May 22, 2021 · 3 comments
Open

sigma_x and sigma_t in heat1D/heat1D.py #2

smao-astro opened this issue May 22, 2021 · 3 comments

Comments

@smao-astro
Copy link

Hi,

In the line below

def operator(u, t, x, k, sigma_t=1.0, sigma_x=1.0):
u_t = tf.gradients(u, t)[0] / sigma_t
u_x = tf.gradients(u, x)[0] / sigma_x
u_xx = tf.gradients(u_x, x)[0] / sigma_x
residual = u_t - k * u_xx
return residual

I have two question:

  1. Seems that when the function is called
    def net_r(self, t, x):
    u = self.net_u(t, x)
    residual = self.operator(u, t, x, self.k,
    self.sigma_t, self.sigma_x)
    return residual

    you give slightly different sigma_x and sigma_t, does not that break the balance of the equation?
  2. Why sigma_x occurred twice in the second term (spatial 2nd derivative)? Does this mean that you are actually changing the PDE you are solving?

In addition, I got an output below that seems different comparing with the figure 12 in the paper (using heat1D_ST_FF), do you have any idea?
heat1d_output

@sifanexisted
Copy link
Collaborator

sifanexisted commented May 22, 2021

Hi,

We are happy to answer your questions.

A1: This is because we normalize the inputs and consequently changes the PDE we are solving. But if you do not normalize the input coordinates and take sigma_t = sigma_x = 1, then we believe you will get the similar results .

A2: This is because of the low resolution of the mesh grid used to visualize the results. If ou use a finer mesh, (e.g nn=1000), we believe the results you get should be similar to the results shown in our paper.

Let me know if you have any other questions.

@smao-astro
Copy link
Author

So for the first question, that's because you are taking partial derivative w.r.t. the normalized input, and thus introduce an additional normalizing factor, to account for this, divide the partial derivative by sigma, I see.

For the second question, I changed nn to 1000, and used heat1D_ST_FF, by still can not reproduce the figure 12 in paper (see my output below), any idea?
heat1d_output-2

Thanks.

@sifanexisted
Copy link
Collaborator

sifanexisted commented May 23, 2021 via email

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