Looking for an example of a Successive over-relaxation

Click For Summary

Discussion Overview

The discussion revolves around the implementation of the successive over-relaxation (SOR) algorithm in a programming assignment. Participants seek clarification on the algorithm's process, particularly how to apply it to a specific example involving a 3x3 matrix and a vector.

Discussion Character

  • Homework-related
  • Technical explanation
  • Exploratory

Main Points Raised

  • One participant expresses confusion about the SOR algorithm despite reviewing the Wikipedia page and requests a simple example.
  • Another participant asks for clarification on the matrices D, L, and U, which are part of the SOR method.
  • A participant provides their matrices D, L, and U and inquires about the next steps in the algorithm.
  • It is suggested that the participant start with an initial guess for the solution vector x and iterate to improve the approximation.
  • There is a discussion about the notation used in the algorithm, specifically regarding the variables x and σ, and how they relate to convergence testing.
  • Participants clarify that σ is the product of A and φ, and it should be calculated rather than assumed.
  • One participant seeks confirmation on whether they can set an arbitrary convergence threshold for the iteration process.
  • Clarifications are made regarding the initialization of σ and its role in the algorithm.

Areas of Agreement / Disagreement

Participants generally agree on the steps involved in the SOR algorithm, but there are points of confusion regarding the notation and the calculation of certain variables. The discussion remains unresolved in terms of fully clarifying the participant's understanding of the algorithm.

Contextual Notes

Some participants express uncertainty about the definitions and roles of variables in the SOR algorithm, particularly regarding convergence criteria and the initialization of certain values.

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 42 ·
2
Replies
42
Views
8K
  • · Replies 13 ·
Replies
13
Views
2K
Replies
3
Views
12K
  • · Replies 0 ·
Replies
0
Views
7K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K