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

1d poisson #84

Open
princedudu opened this issue Oct 21, 2021 · 1 comment
Open

1d poisson #84

princedudu opened this issue Oct 21, 2021 · 1 comment

Comments

@princedudu
Copy link

Hi,

I want to ask one question regarding 1d poisson example. It seems that $uj$ is not the true solution. At least the boundary conditions are different. From the numerical results, backward() is not transferring from spectral space to real space. Would you mind explaining this?

Thanks!

@mikaem
Copy link
Member

mikaem commented Oct 22, 2021

Hi,
I'm assuming that you're referring to the dirichlet_poisson1d.py demo? uj is the solution in real space at the quadrature points. u_hat is the spectral Galerkin solution, that can be evaluated at any point in the domain. If you evaluate at the boundary, you should get the boundary condition (almost exactly)

In [1]: u_hat(-1.0)
Out[1]: array([-2.77555756e-17])

The quadrature points are

In [2]: SD.mesh()
Out[2]: 
array([ 0.99785892,  0.98078528,  0.94693013,  0.89687274,  0.83146961,
    0.75183981,  0.65934582,  0.55557023,  0.44228869,  0.32143947,
    0.19509032,  0.06540313, -0.06540313, -0.19509032, -0.32143947,
   -0.44228869, -0.55557023, -0.65934582, -0.75183981, -0.83146961,
   -0.89687274, -0.94693013, -0.98078528, -0.99785892])

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