[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Implementing a Jacobi iterative method for Ax=b
From: |
Ozzy Lash |
Subject: |
Re: Implementing a Jacobi iterative method for Ax=b |
Date: |
Tue, 30 Oct 2012 11:12:22 -0500 |
On Tue, Oct 30, 2012 at 6:10 AM, Juan Pablo Carbajal
<address@hidden> wrote:
> On Mon, Oct 29, 2012 at 2:16 PM, Joza <address@hidden> wrote:
>> Here are A and b if you want to test it out!
>>
>> A = [ 3 12 0 -1 0 0; 4 0 31 1 0 0; 2 1 0 0 17 -3; 27 2 0 0 0 1; 0 0 0 -1 1
>> 11; 0 0 0 24 -1 0 ]
>>
>> (6x6)
>>
>> b = [ 39 117 12 98 14 55]^T
>>
>> (6x1)
>>
>>
>>
>> --
>> View this message in context:
>> http://octave.1599824.n4.nabble.com/Implementing-a-Jacobi-iterative-method-for-Ax-b-tp4645833p4645868.html
>> Sent from the Octave - General mailing list archive at Nabble.com.
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://mailman.cae.wisc.edu/listinfo/help-octave
>
> Hi,
>
> Use Agora to post your code, it is easier to track the changes
> http://agora.octave.org/
>
> I posted an improved version of your file.
> http://agora.octave.org/snippet/JZaP/
>
> You must always check if the algorithm will converge, in order to know
> if you should expect an answer or not. Try
> demo jacobi_iter
>
> Cheers
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
Juan,
Great pointer to agora.octave.org. I hadn't heard of it before.
I just posted an update to your script that attempts to create a
better permutation matrix. It seems to me that to make a matrix
diagonal dominant, it is a necessary condition that the largest
magnitude value in any row be on the diagonal. I added an initial
permutation "guess" p that is simply the indices of max(abs(A)). I
then test to see if all of the rows are unique, and, if not fall back
to using dmperm.
This will definitely help with the test case that the initial poster was using.
Bill
- Re: Implementing a Jacobi iterative method for Ax=b, (continued)
- Re: Implementing a Jacobi iterative method for Ax=b, c., 2012/10/28
- Re: Implementing a Jacobi iterative method for Ax=b, Ozzy Lash, 2012/10/28
- Re: Implementing a Jacobi iterative method for Ax=b, Joza, 2012/10/28
- Re: Implementing a Jacobi iterative method for Ax=b, Ozzy Lash, 2012/10/28
- Re: Implementing a Jacobi iterative method for Ax=b, Joza, 2012/10/29
- Re: Implementing a Jacobi iterative method for Ax=b, Joza, 2012/10/29
- Re: Implementing a Jacobi iterative method for Ax=b, Juan Pablo Carbajal, 2012/10/30
- Re: Implementing a Jacobi iterative method for Ax=b,
Ozzy Lash <=