New answers tagged poisson
3
The correct way is to average the source term which you can do easily in this case as you have a polynomial. In general you can do the average with a quadrature. For second order accuracy if the source term is smooth as in your case, you can also just evaluate it at the cell center, which is like mid-point quadrature. It should not matter much in your ...
0
The finite difference scheme also gives exact solution at the nodes to the problem $-u''=1$ because
$$
\frac{u_{j-1} - 2 u_j + u_{j+1}}{h^2}
$$
is exact for a quadratic function.
For the more general case
$$
-u''(x) = f(x)
$$
if you compute the integral $(f,\phi_i)$ exactly in $P_1$ FEM, it gives exact solution at the nodes. The FD scheme will not be exact ...
Top 50 recent answers are included
Related Tags
poisson × 110finite-difference × 27
finite-element × 25
boundary-conditions × 20
elliptic-pde × 14
pde × 13
python × 9
linear-solver × 9
discretization × 9
matlab × 8
numerics × 8
iterative-method × 8
finite-volume × 8
convergence × 7
fourier-analysis × 6
electromagnetism × 6
linear-algebra × 5
fluid-dynamics × 5
multigrid × 5
nonlinear-equations × 4
sparse-matrix × 4
conjugate-gradient × 4
spectral-method × 4
error-estimation × 3
fenics × 3