# Solve poisson equation with Neumann b.c. (matlab or octave)

I'm trying to reconstruct an image given its Laplacian, which results in a Poisson equation and I'm using Neumann boundary conditions (derivative at boundary = 0).

What I have is the laplacian (f, left-hand side), and the image borders (boundaries).

How can I solve this in Matlab or Octave? I found the poisolv() and assempde() functions but I don't quite understand how they work.

## 1 Answer

In MATLAB I suggest using the pdetool GUI which provides an easier-to-use interface to the assempde function.

• I think I dont own that toolbox. I think this might be a fairly easy problem, is not there a simple way of doing this? – manatttta Jan 7 '15 at 12:36
• Since you mentioned poisolv and assempde, I assumed you had PDE Toolbox; those functions are part of that product. If you want to do more coding in MATLAB you can find examples of how to solve the Poisson equation in chapter 11 of Moler's book: mathworks.com/moler/pdes.pdf – Bill Greene Jan 7 '15 at 12:43
• thanks for the help, I will dive into it. but anyways, if I were to use that function alone (without the GUI and so on), where could I get alll the inputs to that function? (as I don't really understand what they are) – manatttta Jan 7 '15 at 14:37
• The PDE Toolbox doc is several hundred pages long so that is why I suggested starting with the GUI to learn the product. Alternately, there are quite a few example problems here, mathworks.com/help/pde/examples.html, and several of them use the assempde function. – Bill Greene Jan 7 '15 at 15:27