Changes between Version 25 and Version 26 of u/erica/PoissonSolver


Ignore:
Timestamp:
08/19/13 14:23:05 (11 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/PoissonSolver

    v25 v26  
    4040Here, h is the internode size, which for a 1D line of mesh points is h=L/m+1, where L is domain length, and m is the number of grid points.
    4141
    42 which can be re-arranged for
    43 
    44 [[latex($u_i = \frac{1}{2}(u_{i-1}+ u_{i+1} - h f_i)   $)]]
    45 
    4642Here, h is the internode size, which for a 1D line of mesh points is h=L/m+1, where L is domain length, and m is the number of grid points.
    4743
     
    6965This is the type of method I used to solve Poisson's equation numerically.
    7066
    71 Error, accuracy, convergence, solution is guaranteed to converge
     67Note that the above discretized Poisson equation can be rearranged for u at a given grid point,
     68
     69[[latex($u_i = \frac{1}{2}(u_{i-1}+ u_{i+1} - h f_i)   $)]]
     70
     71This then can be rewritten as an iteration equation, where the left hand side (LHS) is the iterated, or updated solution, at grid point i, and the RHS is the value of the grid point's neighbors prior to the iteration step.
     72
     73Thus, starting with initial guesses at the solution for each point on the grid, one can loop through each point on the grid and 'update' it so that it solves this relationship for its neighbors (and source f).
     74
     75We say that the iteration converges when the LHS-RHS < tol, where tol is some small number for the tolerance.
     76
     77By evaluating the matrix spoke of earlier, one can prove that this process will both always converge (in some finite number of iterations) and will provides an approximation to how long convergence will take (see Numerical Recipes for nice overview on this process, again chapt 19).
     78
     79Jacobi iteration (the specific scheme I used), applies this equation to each grid point on the grid, stores each value of ui, and then uses all of the updated ui's in the next iteration step, if convergence was not yet reached. This is different than Gauss-Siedel, which updates half the grid in the first 1/2 of the iteration step, and the next half in the second (see Leveque). The amount of time to converge is inversely proportional to the grid point spacing. The finer your grid, the longer it takes to converge. A helpful formula is given, [http://www.rsmas.miami.edu/personal/miskandarani/Courses/MSC321/Projects/prjpoisson.pdf here]
     80
    7281
    7382= Laplace Equation (source term = 0) Physical Meaning =