Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Gauss Seidell Successive Over Relaxation Method

Subject: Gauss Seidell Successive Over Relaxation Method

From: Nate Jensen

Date: 22 Oct, 2011 18:17:31

Message: 1 of 6

I am trying to solve a large linear matrix system.

The function is a simple AX=B
Where A, X, and B are all 401x201 matrices. These matrix sizes will undoubtedly increase.

Currently I am using the Jacobian Method to solve this system simply because it was the easiest to implement. It is far too slow for my tastes however, and I think the Gauss-Seidel Successive Over Relaxation Method would be faster. I have been unsuccessful in finding any SOR examples using matrices.

Does anyone know of any SOR examples using matrices?

Thanks,
Nate

Subject: Gauss Seidell Successive Over Relaxation Method

From: John D'Errico

Date: 22 Oct, 2011 18:24:13

Message: 2 of 6

"Nate Jensen" wrote in message <j7v1br$iut$1@newscl01ah.mathworks.com>...
> I am trying to solve a large linear matrix system.
>
> The function is a simple AX=B
> Where A, X, and B are all 401x201 matrices. These matrix sizes will undoubtedly increase.
>
> Currently I am using the Jacobian Method to solve this system simply because it was the easiest to implement. It is far too slow for my tastes however, and I think the Gauss-Seidel Successive Over Relaxation Method would be faster. I have been unsuccessful in finding any SOR examples using matrices.
>
> Does anyone know of any SOR examples using matrices?
>
> Thanks,
> Nate

This is not even REMOTELY large. Not even close. Why bother
to use an iterative scheme at all? Bragging rights, that you have
such a fast computer that you can burn CPU cycles (but no
memory?)

Learn to use the tools in matlab. In this case:

help slash

John

Subject: Gauss Seidell Successive Over Relaxation Method

From: Nate Jensen

Date: 22 Oct, 2011 19:17:15

Message: 3 of 6

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <j7v1od$jvj$1@newscl01ah.mathworks.com>...
> This is not even REMOTELY large. Not even close. Why bother
> to use an iterative scheme at all? Bragging rights, that you have
> such a fast computer that you can burn CPU cycles (but no
> memory?)
>
> Learn to use the tools in matlab. In this case:
>
> help slash
>
> John

I am sorry; I did not explain myself clearly enough.

I cannot simply use the Matlab's backslash because my matrices are not square.
Given,
A 401x201 and B 401x201
and executing,
X = A\B
returns
Warning: Rank deficient
X 201x201

Using the Jacobian Method returns the correct,
X 401x201

I apologize for complaining about the speed of these calculations; I did not provide the full details of my work. I am running CFD simulations with upwards of 10 million time steps, wherein each time step I need to iteratively solve AX = B. I believe that if I were to employ the SOR Method to solve this system of linear equations, I could dramatically reduce time needed to solve AX = B.

I did not mean to cause such an uproar. I am simply looking for an example of SOR with matrices. I hope my explanation clears up any controversy.

Thank you for your suggestion, and I look forward to more,
Nate

Subject: Gauss Seidell Successive Over Relaxation Method

From: Nasser M. Abbasi

Date: 22 Oct, 2011 20:03:36

Message: 4 of 6

On 10/22/2011 1:17 PM, Nate Jensen wrote:
> I am trying to solve a large linear matrix system.
>
> The function is a simple AX=B
> Where A, X, and B are all 401x201 matrices. These matrix sizes will undoubtedly increase.
>
> Currently I am using the Jacobian Method to solve this system simply because it
>was the easiest to implement. It is far too slow for my tastes however, and I think the
>Gauss-Seidel Successive Over Relaxation Method would be faster. I have been unsuccessful in
>finding any SOR examples using matrices.
>
> Does anyone know of any SOR examples using matrices?
>
> Thanks,
> Nate

Here is a matlab script I wrote for a HW that solves poisson PDE in 3D using SOR:

http://12000.org/my_courses/UC_davis/fall_2010/math_228a/HWs/HW3/matlab_source_code_HTML/Matlab_source_code.htm

I think I have a script for 2D SOR, but can't find it right now.

--Nasser

Subject: Gauss Seidell Successive Over Relaxation Method

From: Nate Jensen

Date: 22 Oct, 2011 20:54:10

Message: 5 of 6

"Nasser M. Abbasi" <nma@12000.org> wrote in message <j7v7jg$c7u$2@speranza.aioe.org>...
> Here is a matlab script I wrote for a HW that solves poisson PDE in 3D using SOR:
>
> http://12000.org/my_courses/UC_davis/fall_2010/math_228a/HWs/HW3/matlab_source_code_HTML/Matlab_source_code.htm
>
> I think I have a script for 2D SOR, but can't find it right now.
>
> --Nasser
>

Excellent, thank you. I will look it over.

Subject: Gauss Seidell Successive Over Relaxation Method

From: Nasser M. Abbasi

Date: 22 Oct, 2011 21:07:00

Message: 6 of 6

On 10/22/2011 3:54 PM, Nate Jensen wrote:
> "Nasser M. Abbasi"<nma@12000.org> wrote in message<j7v7jg$c7u$2@speranza.aioe.org>...
>> Here is a matlab script I wrote for a HW that solves poisson PDE in 3D using SOR:
>>
>> http://12000.org/my_courses/UC_davis/fall_2010/math_228a/HWs/HW3/matlab_source_code_HTML/Matlab_source_code.htm
>>
>> I think I have a script for 2D SOR, but can't find it right now.
>>
>> --Nasser
>>
>
> Excellent, thank you. I will look it over.

you'r welcome. Just wanted to add that the 2D SOR solver function is in the same
page above below the 3D SOR solver function. I did not notice that before.

--Nasser

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us