Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

precision while adding matrices

Status
Not open for further replies.

rk_19

Structural
Joined
Aug 7, 2012
Messages
71
Location
AE
Hi, I have a fortran program which generates 2d matrices A1(12x12) and A2(12x12), then combine it in such a way that A2(1,1) is added to A1(7,7), A2(1,2) is added to A1(7,8) and so on (as shown in the attachment). I got the output as matrix A (18 x18) from fortran. all the matrices are declared as double precision in fortran.
eg; doubleprecision,dimension(12,12)::A1,A2
doubleprecision,dimension(18,18)::A
The combined A matrix was checked manually. please refer the attachment, it appears to be slightly different from what I got when I did assemblage in excel - how do I get rid of this error - something to do with precision control ?
 
 http://files.engineering.com/getfile.aspx?folder=41ec1786-b08c-44f5-9f1d-5e86e7af946a&file=A_matrix-FT.xlsx
Double precision gives 15 digit accuracy. If the numbers you are playing with are of magnitude 1E12. If when subtracted/added, it ends up with something that is 1E-4, you are just getting spurious rubbish since 12+4 = 16 which is > 15. I would consider anything < 1E-3 to be 0.
 
i tried calculating the Eigen values in Mathcad and it gave me results what I expected. it didn't show any issues. the results were same as that i got from an independent software check. so I am not worried whether the matrices are wrong. please see the attachment 'comparison.jpg'. it compares Mathcad results with dsygv output(results.txt). the Eigen value(1) in Mathcad matches almost with eigenval(3) of dsygv, eig(2) of Mathcad matched eig(4) of dsygv and so on. it looks like 2 negative figures were coming on the top...i wish to know if there is some way i can condition the matrices for dsygv to work properly - or is there a better routine which will work on them considering them as unsymmetric matrices. thanks
 
 http://files.engineering.com/getfile.aspx?folder=a64119df-2aed-4cfb-8c69-ddbd14d11bf1&file=comparison.JPG
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top