MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: solving poisson equation with Mathematica

  • To: mathgroup at
  • Subject: [mg124426] Re: solving poisson equation with Mathematica
  • From: JUN <noeckel at>
  • Date: Thu, 19 Jan 2012 05:12:02 -0500 (EST)
  • Delivered-to:
  • References: <jf6961$gdh$>

On Jan 18, 3:07 am, Farhad Bazyari <farhad.bazy... at> wrote:
> Hi guys,
> I just downloaded Mathematica's trial version.
> I have a vector field, vf, in 3D. I need to find a scalar function
> f(x,y,z) such that Laplacian of f(x,y,z) equals divergence of vf (the
> vector field)
> I need to find f(x,y,z) in the unit cube, and vf is defined in that
> area.
> can anyone help me with that please?

This looks suspiciously like a homework problem, so I won't address
the specific case you're describing, except to say that you probably
won't need a Poisson solver at all because you are given more
information than you perhaps realized in the form of vf.

However, if you _do_ want to implement one in 3D, I can point you to
the following page that contains a teaching resource for my
electromagnetism class:

This shows one way to solve the Poisson equation in 2D.

To implement second derivatives (as required for the Laplacian), I use
RotateRight and RotateLeft on the grid containing the potential. One
can instead also use ListConvolve to achieve the same thing.

Another important aspect is how to impose the boundary conditions. In
electrostatics, these are typically Dirichlet conditions on conductors
of arbitrary shape. To allow arbitrary shapes, I include the
conductors in the computational grid but combine each relaxation step
with a step in which a mask is applied to the grid that sets the
conductors to their given fixed potential.


  • Prev by Date: Re: NIntegrate and Plot solution of differ. equa. over initial conditions
  • Next by Date: Re: Is there any efficient easy way to compare two lists with the same length with Mathematica?
  • Previous by thread: solving poisson equation with Mathematica
  • Next by thread: Re: solving poisson equation with Mathematica