Re: Can't get exact solution. Why ?




eigen21@xxxxxxxxx wrote:
I'm using Compaq Visual fortran 6.1 (window XP platform)

My problem is simple

I hope to solve x of A*x = b

A = [ 4 2 0 0 0 0 ;
2 4 2 0 0 0 ;
0 2 4 2 0 0 ;
0 0 2 4 2 0 ;
0 0 0 2 4 2 ;
0 0 0 0 2 4 ] --> symmetric

b = [1;1;1;1;1;1]

In matCAD. I can get solution
x =
0.214
0.071
0.143
0.143
0.071
0.214

BUT !!, when I used sparse solver DSSKYD in compaq fortran CXML, I get
strange result agian and agian...
x =
0.2198413
0.0603175
0.1595238
0.1206349
0.1190476
0.1904762

[snip]

! CONSTRUCT [A], [BX]
DO I=1,NSIZE
A(I,I) = 4.
BX(I) = 1.
ENDDO

DO I = 1, (NSIZE-1)
A(I,I+1) = 2.
A(I+1,I) = 2.
ENDDO

[snip]

I can't find mistake here
Could you find the mistake in this code ?

Where do you set the off (near) diagonal elements of array A to zero???

Assuming that your compiler's memory allocator or some set of compiler
switches performs this task is *not* a good idea.

-- Elliot
e-mail: epc8 at juno dot com

.