Looking for an example of a Successive over-relaxation

In summary, the algorithm section of the wikipedia page states that x is updated as x^(k+1) - x^k. The test for convergence is to see whether φ^k+1 - φ^k < 0.001.
  • #1
hahaha158
80
0
Hi

I am working on a programming assignment that requires me to implement the successive over-relaxation algorithm. We are given the wikipedia page for this: http://en.wikipedia.org/wiki/Successive_over-relaxation.

I have read through the wikipedia page for this numerous times but am still quite unsure of the process.

If given a 3x3 matrix for A, let's say [[1,2,3][5,1,-3][3,1,2]] and a vector for B = [1,-1,2], how can I use this method to solve for x? Sorry if the A and B I gave are not even solvable.

I think that we need to find a w between 1 and 2, so I just arbitrarily chose 1.5, then we need to choose an initial value of x? Can anyone either please give a simple example demonstrating this method, or help explain the wikipedia write up in simpler terms?

Thanks
 
Physics news on Phys.org
  • #2
The Wikipedia page is quite clear. What part didn't you understand? Can you write down the matrices D, L, and U?
 
  • #3
I have D = [[1,0,0][0,1,0][0,0,2]], L = [[0,0,0],[5,0,0][3,1,0]] U = [[0,2,3][0,0,-3][0,0,0]]. From here do I plug into the x^(k+1) equation? How do I find x^(k). What is the xi^(k+1) equation?
 
  • #4
You're iterating. You start with a guess for x. Say your guess is (1,2,3). k is the index of the iterations. So your guess is x(0). So x0(0) = 1, x1(0) = 2, x2(0) = 3. So given x(0), you use the equation to calculate x(1), which is a better approximation to the answer. You keep iterating until the answer stops changing to some degree of accuracy. Do you see?
 
  • #5
Under the algorithm section, i guess they use
7f20aa0b3691b496aec21cf356f63e04.png
for the x and σ for the change from x^k to x^(k+1)? Are these assumptions correct? If so, is finding σ just x^(k+1) - x^k, and I want to keep iterating until σ < (arbitrary minimum i choose?)
 
  • #6
Yes. In the algorithm section φ is the same as x up above, and σ is just a shorthand for the product Ax (or Aφ).
 
  • #7
ok, so since σ is not used for testing convergence like I assumed, can I choose an arbitrary value of let's say 0.001, and then in the section under algorithm that says test for convergence, can I just check to see whether φ^k+1 - φ^k < 0.001, and exit the loop if so?
 
  • #8
I'm still not sure you've got it. Yes, you can just check to see whether φ^k+1 - φ^k < 0.001, and exit the loop if so. But you can't assume value for σ. You have to calculate σ, it is the product of A and φ.
 
  • #9
Sorry, my last reply was worded poorly. I meant to choose an arbitrary value for φ^k+1 - φ^k, i didn't mean to imply that the value is equal to σ. In any case, it doesn't seem like you actually need to calculate σ, since in the algorithm it is initialized as 0, and they have a line that computes it inside the j loop, correct?
 
  • #10
Yes, correct. They are just showing you how to calculate it.
 
  • #11
thank you!

your explanations helped a lot
 

1. What is Successive over-relaxation (SOR)?

Successive over-relaxation (SOR) is a method used to solve systems of linear equations, typically used in numerical analysis. It is an iterative method that takes advantage of the Gauss-Seidel method by over-relaxing the solution at each step.

2. How does SOR differ from other iterative methods?

SOR differs from other iterative methods, such as Jacobi or Gauss-Seidel, by using a relaxation parameter that helps accelerate the convergence of the solution. This means that SOR can often reach a solution faster than other methods, although it may require more computational effort per iteration.

3. What are the benefits of using SOR?

One of the main benefits of using SOR is its ability to converge to a solution faster than other methods, especially for large and sparse systems of equations. It is also relatively easy to implement and can be applied to a wide range of problems.

4. What are the limitations of SOR?

SOR may not converge for certain types of matrices, such as those with a high condition number or those with eigenvalues close to the relaxation parameter. It also requires a good initial guess for the solution in order to converge.

5. Can you provide an example of SOR being used in practice?

SOR has been used in various fields, such as fluid dynamics, heat transfer, and structural analysis. For example, it can be used to solve the Navier-Stokes equations for fluid flow simulations or to analyze stress and deformation in mechanical structures. It has also been applied to image processing and computer vision problems, such as image deblurring and denoising.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • Differential Equations
Replies
1
Views
7K
  • STEM Academic Advising
Replies
2
Views
4K
Replies
3
Views
11K
Replies
0
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
  • General Math
Replies
22
Views
3K
  • Beyond the Standard Models
Replies
24
Views
7K
  • Beyond the Standard Models
Replies
2
Views
2K
Back
Top