English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Can anybody give me a source, or help me through this topic? I want to know about evaluating potential of points in a field, by dividing it into square meshes, and using this fact that the electrical potential of a point at the corner of one of squares is equal to one fourth of the sum of potentials of points up, down, right, and left of it.

2006-12-03 02:07:11 · 1 answers · asked by IQmand . 2 in Science & Mathematics Physics

1 answers

Yes, this sounds like a good idea for solving potential problems numerically using a very simple algorithm to program. Laplace's equation in two dimensions:

(d^2/dx^2 + d^2/dy^2) f(x,y) = 0

is equivalent to:

f(x+1,y) + f(x-1,y) + (f(x,y+1) + f(x,y-1)) - 4f(x,y) = 0

as long as f(x,y) varies slowly between (x,y) and (x+1,y+1), i.e. compared with the mesh size.

So, for example, given a Dirichlet boundary condition (f(x,y) specified on a closed curve and you want to calculate the values of f(x,y) at every point in the interior):

(1) Create a two dimensional array f(x,y) representing the points in two dimensional space.
(2) Initialize the boundary points with the specified boundary values.
(3) Initialize the interior points with zeros.
(4) Cycle through each interior point and replace its value f(x,y) with the average of the four neighboring points:

f(x,y) --> (1/4)[f(x+1,y) + f(x-1,y) + (f(x,y+1) + f(x,y-1))]

(5) Perform step (4) over and over until the largest change is below some desired error.

Intuitively it seems as though it should always converge to the solution and should work in any number of dimensions, although I don't have a proof.

2006-12-05 12:42:11 · answer #1 · answered by shimrod 4 · 0 0

fedest.com, questions and answers