Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7980 > unrolled thread

solving poisson equation with Mathematica

Started byFarhad Bazyari <farhad.bazyari@gmail.com>
First post2012-01-18 11:07 +0000
Last post2012-01-19 11:39 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  solving poisson equation with Mathematica Farhad Bazyari <farhad.bazyari@gmail.com> - 2012-01-18 11:07 +0000
    Re: solving poisson equation with Mathematica JUN <noeckel@gmail.com> - 2012-01-19 10:16 +0000
    Re: solving poisson equation with Mathematica Physics Scholar <physics.scholars@gmail.com> - 2012-01-19 11:39 +0000

#7980 — solving poisson equation with Mathematica

FromFarhad Bazyari <farhad.bazyari@gmail.com>
Date2012-01-18 11:07 +0000
Subjectsolving poisson equation with Mathematica
Message-ID<jf6961$gdh$1@smc.vnet.net>
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?

[toc] | [next] | [standalone]


#8003

FromJUN <noeckel@gmail.com>
Date2012-01-19 10:16 +0000
Message-ID<jf8qh3$3nr$1@smc.vnet.net>
In reply to#7980
On Jan 18, 3:07 am, Farhad Bazyari <farhad.bazy...@gmail.com> 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:
uoregon.edu/~noeckel/computernotes/Mathematica/poissonEquation.html

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.

Jens

[toc] | [prev] | [next] | [standalone]


#8015

FromPhysics Scholar <physics.scholars@gmail.com>
Date2012-01-19 11:39 +0000
Message-ID<jf8vcq$5oe$1@smc.vnet.net>
In reply to#7980
you can use help menu
+
you must use Needs["VectorFieldPlots`"]
Needs["VectorFieldPlots`"]
VectorFieldPlot3D[{Sin[x], Cos[y], Sin[z]}, {x, 0, 1}, {y, 0, 1}, {z,
  0, 1}, VectorHeads -> True]
and
GradientFieldPlot3D[
 Sin[x] + Cos[y] + Sin[z], {x, 0, 1}, {y, 0, 1}, {z, 0, 1},
 VectorHeads -> True]

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web