Skip to main content
added 2 characters in body
Source Link
EMP
  • 2.1k
  • 11
  • 19

Based off what you said, you have a linear poisson equation, and you want a measure of how well your answer that you compute from the linear system corresponds to the solution of the finite difference equation, which is itself a linear system. Since you have a linear system that you are solving through a Gauss-Seidel iteration, you can look at the problem you're solving as $$Ax = b$$ and you can define a residual $$r = b - Ax$$ or with your notation: $$r = g - Af$$$$d = g - Af$$ When you've satisfied the system this d will be equal to 0, just like you want. This is easy to compute and gives you the actual error as opposed to your current suggestions, which while they are nice will have problems dealing with stiff systems that don't converge well.

Based off what you said, you have a linear poisson equation, and you want a measure of how well your answer that you compute from the linear system corresponds to the solution of the finite difference equation, which is itself a linear system. Since you have a linear system that you are solving through a Gauss-Seidel iteration, you can look at the problem you're solving as $$Ax = b$$ and you can define a residual $$r = b - Ax$$ or with your notation: $$r = g - Af$$ When you've satisfied the system this will be equal to 0, just like you want. This is easy to compute and gives you the actual error as opposed to your current suggestions, which while they are nice will have problems dealing with stiff systems that don't converge well.

Based off what you said, you have a linear poisson equation, and you want a measure of how well your answer that you compute from the linear system corresponds to the solution of the finite difference equation, which is itself a linear system. Since you have a linear system that you are solving through a Gauss-Seidel iteration, you can look at the problem you're solving as $$Ax = b$$ and you can define a residual $$r = b - Ax$$ or with your notation: $$d = g - Af$$ When you've satisfied the system this d will be equal to 0, just like you want. This is easy to compute and gives you the actual error as opposed to your current suggestions, which while they are nice will have problems dealing with stiff systems that don't converge well.

Source Link
EMP
  • 2.1k
  • 11
  • 19

Based off what you said, you have a linear poisson equation, and you want a measure of how well your answer that you compute from the linear system corresponds to the solution of the finite difference equation, which is itself a linear system. Since you have a linear system that you are solving through a Gauss-Seidel iteration, you can look at the problem you're solving as $$Ax = b$$ and you can define a residual $$r = b - Ax$$ or with your notation: $$r = g - Af$$ When you've satisfied the system this will be equal to 0, just like you want. This is easy to compute and gives you the actual error as opposed to your current suggestions, which while they are nice will have problems dealing with stiff systems that don't converge well.