Why aren't the essential boundary conditions fulfilled?

I made a Poisson-solver based on Legendre-spectral method and I would like to test it. I used the pdetool, created the square region [-1,1]x[-1,1] and specified the PDE to be an elliptic one with parameters c=-1, a=0, f=x.*y. The boundary conditions: left:y, right: -y, top:-x, bottom:x. I run the task with different mesh density and obtained the interesting result that at (-1,-1) the obtained value is not -1 as it should be in my opinion. For an elliptic PDE, these Dirichlet boundary conditions are essential boundary conditions therefore they are taken into account when applying the weak form. Why aren't these boundary condition satisfied?
Thanks, Zoli

 Akzeptierte Antwort

Bill Greene
Bill Greene am 6 Jun. 2014

0 Stimmen

I ran this example in R2014a of MATLAB and I do get -1 at the lower left corner (and upper right)
I created the example in pdetool with the following steps: 1. Create the square. 2. After selecting Boundary Conditions, click on each edge and define r to be the values you list above (y,-y,-x,x). 3. Click the = icon.
What version of MATLAB are you running?
If you want to post your code, I'm happy to take a look.
Bill

5 Kommentare

I did the same steps as you. My MATLAB version is R2011a.
I tried this in R2011a on Windows and also get good answers in that version. I have attached my script if you want to try it.
If you haven't already done this, I would suggest exporting the mesh and solution into the MATLAB workspace. The four corner nodes should have numbers 1:4. You can confirm this and find which index corresponds to which corner by examining the p-matrix. Then you can display u(1:4) to see exactly what the solution values are.
Bill
Zoltán Csáti
Zoltán Csáti am 8 Jun. 2014
Bearbeitet: Zoltán Csáti am 8 Jun. 2014
I examined the p and u matrices and u(1:4) gives the correct values. Then why isn't it so on the attached screenshot? It is a good lesson for me to take the returned numerical values into account and not the graphics. But why doesn't the figure show the correct values?
This plotting problem was fixed in R2013a.
Bill
Thank you.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by