Changes between Version 24 and Version 25 of u/erica/PoissonSolver
- Timestamp:
- 08/19/13 14:11:57 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
u/erica/PoissonSolver
v24 v25 38 38 [[latex($\frac{1}{h}(u_{i+1} + u_{i-1} - 2 u_i) = f$)]] 39 39 40 Here, 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. 40 41 41 42 which can be re-arranged for … … 47 48 = Matrix form, relaxation form = 48 49 49 50 51 - Discretizatiion leads to a syustenm of eqns. There are 2 ways to solve the equations. Matrix direct methods and relaxtiuon iteration mrethods. 50 Generally speaking, discretization leads to systems of equations. For the Poisson equation, there are 2 broad ways of solution. The first is called direct methods, and these relate to solving a large matrix (see next section). The second type of technique are known as relaxation or iteration methods. This was the type I pursued. 52 51 53 52 == Matrix form (not followed) == 54 53 54 55 55 I did not write a code that uses a direct matrix method for solving the system of equations, but include this section here for completeness. 56 56 57 Given the discretized Poisson equation for a region actually constitutes a system of m unknowns (one equation for each of the m grid points, and boundary conditions are specified for flanking points), we can write the system in matrix form, 58 59 60 [[latex($\hat{A} \vec{x} = \vec{b}$)]] 61 62 To get this form, first specify the ordering of unknowns in the vector x. This will fix the ordering of the source terms in the vector b. Then, following the discretized equation you can fill in the matrix A. 63 64 Depending on your ordering, your matrix will have a different look. The properties of the system can be studied by studying this matrix. See Numerical Recipes for details. 65 66 57 67 == Relaxation form (followed) == 68 69 This is the type of method I used to solve Poisson's equation numerically. 58 70 59 71 Error, accuracy, convergence, solution is guaranteed to converge