Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#26 2013-12-01 06:54:29

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

There are other reasons for divergence. Poor initial conditions is one reason. The condition number for that matrix if I remember was around 500. That is not too bad.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#27 2013-12-01 07:13:56

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

bobbym wrote:

There are other reasons for divergence. Poor initial conditions is one reason. The condition number for that matrix if I remember was around 500. That is not too bad.

The condition number for n=500 is for example 1.2550e+005 ..
So,is it right that the methods do not  converge for  this matrix ??
Because,for example,both of the methods do converge for an other tridiagonal matrix,that has the number 4 at the main diagonal,1 at the first diagonal below this and also 1 at the first diagonal above this.
Which is the difference??

Offline

#28 2013-12-01 07:15:15

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

I believe that there is a simple answer to that.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#29 2013-12-01 07:17:24

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

bobbym wrote:

I believe that there is a simple answer to that.

Could you tell me,which it is??rolleyes:

Offline

#30 2013-12-01 07:22:33

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

You have a 4 on the diagonal and 1 on the other 2 diagonals? That matrix according to some books is diagonally dominant. This makes convergence easy in the Gauss Seidel method.

But we are straying from the point of this thread. Did you try post #18's matrices? Did they converge for you? What did you notice about the new A?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#31 2013-12-01 08:13:31

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

bobbym wrote:

You have a 4 on the diagonal and 1 on the other 2 diagonals? That matrix according to some books is diagonally dominant. This makes convergence easy in the Gauss Seidel method.

I understand...

But we are straying from the point of this thread. Did you try post #18's matrices? Did they converge for you? What did you notice about the new A?

No,the matrix of post #18 does not converge,neither using the jacobi,nor the gauss-seidel method..

Offline

#32 2013-12-01 08:34:40

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

Something is wrong with your program. That converges for me. Are you setting initial conditions to [0,0,0,0]?

Check this page to see how to increase Matlabs precision:

http://www.mathworks.com/help/symbolic/ … igits.html

See you a bit later, I need some rest.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#33 2013-12-01 10:24:06

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

bobbym wrote:

Something is wrong with your program. That converges for me. Are you setting initial conditions to [0,0,0,0]?

Check this page to see how to increase Matlabs precision:

http://www.mathworks.com/help/symbolic/ … igits.html

See you a bit later, I need some rest.

I used the command digits bit I didn't get any result!!! yikes why??

Offline

#34 2013-12-01 14:44:32

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

The correct comand is DIGITS:= something.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#35 2013-12-02 08:05:29

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

I get this error message:Error: The expression to the left of the equals sign is not a valid target for an
assignment.

I would like to ask you also something else..Is this right that the spectral radius of the iteration matrix of the 250x250 Hilbert Matrix,when we apply the Gauss-Seidel method is  1,and when we apply the Jacobi method 217.3320?

Last edited by evinda (2013-12-02 08:26:01)

Offline

#36 2013-12-02 08:28:08

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

http://www.mathworks.com/help/symbolic/ … igits.html

The examples on that page do not work?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#37 2013-12-02 08:43:45

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

bobbym wrote:

http://www.mathworks.com/help/symbolic/ … igits.html

The examples on that page do not work?

They work...But I can't apply them at a matrix hmm

Offline

#38 2013-12-02 08:44:59

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

Why not? What are you entering for the matrix?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#39 2013-12-02 10:48:46

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

bobbym wrote:

Why not? What are you entering for the matrix?

I wrote this:DIGITS:=hilb(15) and I get Error: The expression to the left of the equals sign is not a valid target for an
assignment.

Offline

#40 2013-12-02 15:35:47

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

DIGITS is a global variable. It sets the precision for everything. Try DIGITS:= 25


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#41 2013-12-04 09:43:24

evinda
Member
Registered: 2013-04-13
Posts: 104

Re: Not sure if output is right

I get this message:??? DIGITS:=25
           |
Error: The expression to the left of the equals sign is not a valid target for an
assignment.


But...anyway...I will let it like that...I have a last question..Could you tell me which is the iteration matrix ,for example of the hilbert matrix with a specific dimension,or for another matrix using the gauss-seidel method,and which it is using the jacobi method ,so I can check if my result is right??? smile

Offline

#42 2013-12-04 22:02:22

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,418

Re: Not sure if output is right

Hi;

Did you get convergence for the matrix in post #18?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Board footer

Powered by FluxBB