Looking for an example of a Successive over-relaxation

Click For Summary
SUMMARY

The discussion centers on implementing the Successive Over-Relaxation (SOR) algorithm for solving linear systems, specifically using a 3x3 matrix A and a vector B. The user seeks clarification on the iterative process, including the initialization of variables and convergence criteria. Key points include the necessity of defining matrices D, L, and U, and the iterative nature of the algorithm, where an initial guess for x is refined until the change between iterations is less than a specified threshold, such as 0.001. The conversation concludes with confirmation that the user can check for convergence using the difference between successive approximations of φ.

PREREQUISITES
  • Understanding of linear algebra concepts, particularly matrix operations.
  • Familiarity with iterative methods for solving linear equations.
  • Knowledge of convergence criteria in numerical methods.
  • Basic programming skills to implement the SOR algorithm.
NEXT STEPS
  • Implement the Successive Over-Relaxation algorithm in a programming language of choice.
  • Explore matrix decomposition techniques, specifically LU decomposition.
  • Learn about convergence criteria and error analysis in iterative methods.
  • Study variations of the SOR method, including optimal relaxation factors.
USEFUL FOR

Students and professionals in computational mathematics, software developers implementing numerical algorithms, and anyone interested in solving linear systems efficiently using iterative methods.

hahaha158
Messages
79
Reaction score
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
The Wikipedia page is quite clear. What part didn't you understand? Can you write down the matrices D, L, and U?
 
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?
 
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?
 
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?)
 
Yes. In the algorithm section φ is the same as x up above, and σ is just a shorthand for the product Ax (or Aφ).
 
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?
 
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 φ.
 
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
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
12K
  • · Replies 0 ·
Replies
0
Views
7K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
24
Views
8K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K