comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: IDL inverse matrix problem
items: Re: IDL inverse matrix problem

IDL inverse matrix problem
type: item
description: Dear All, I have a 16x16 sparse matrix which its values are big. Unfortunately IDL return wrong value for matrix inverse. Therefore when I run command (print,invert(A)##A) the returned is not an identity matrix. I check the singularity of matrix and this inversion retuned correctly by other softwares like MATLAB or MATHEMATICA or even FORTRAN. What is happening? EXAMPLE: A = [ [7.3339770e12, 0.0, 0.0, 0.0, 0.0, 7.3339770e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] , $ [0.0, 5.4254596e12, 0.0, 0.0, 0.0, 5.4254596e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 4.9832916e13, 0.0, 0.0, 0.0, 4.9832916e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 9.7295220e13, 0.0, 0.0, 9.7295220e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 2.2853478e12, 2.2853478e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [7.3339770e12, 5.4254596e12, 0.0, 0.0, 2.2853478e12, 1.5044784e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 4.9832916e13, 9.7295220e13, 0.0, 0.0, 1.5037721e14, 3.2490665e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.2490665e12, 3.2490665e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7204194e13, 8.7204194e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7204194e13, 1.9651177e14, 0.0, 0.0, 1.3385090e13, 9.5922483e13, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.6135226e12, 1.1430911e12, 0.0, 0.0, 1.9939955e12, 1.4764362e12], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.1430911e12, 1.1430911e12, 0.0, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.3385090e13, 0.0, 0.0, 1.3385090e13, 0.0, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.5922483e13, 0.0, 0.0, 0.0, 9.5922483e13, 0.0, 0.0], $ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.9939955e12, 0.0, 0.0, 0.0, 1.9939955e12, 0.0], $ [0.0, 0.0, 0.0, 0…
creator: amin farhang
date: 2015-01-12T17:56:33-00:00

Re: IDL inverse matrix problem
type: item
description: On Monday, January 12, 2015 at 6:56:36 PM UTC+1, Amin Farhang wrote: > Dear All, > > I have a 16x16 sparse matrix which its values are big. Unfortunately IDL return wrong value for matrix inverse. Therefore when I run command (print,invert(A)##A) the returned is not an identity matrix. I check the singularity of matrix and this inversion retuned correctly by other softwares like MATLAB or MATHEMATICA or even FORTRAN. > What is happening? > > > EXAMPLE: > > A = [ [7.3339770e12, 0.0, 0.0, 0.0, 0.0, 7.3339770e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] , $ > [0.0, 5.4254596e12, 0.0, 0.0, 0.0, 5.4254596e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 4.9832916e13, 0.0, 0.0, 0.0, 4.9832916e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 9.7295220e13, 0.0, 0.0, 9.7295220e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 2.2853478e12, 2.2853478e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [7.3339770e12, 5.4254596e12, 0.0, 0.0, 2.2853478e12, 1.5044784e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 4.9832916e13, 9.7295220e13, 0.0, 0.0, 1.5037721e14, 3.2490665e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.2490665e12, 3.2490665e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7204194e13, 8.7204194e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7204194e13, 1.9651177e14, 0.0, 0.0, 1.3385090e13, 9.5922483e13, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.6135226e12, 1.1430911e12, 0.0, 0.0, 1.9939955e12, 1.4764362e12], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.1430911e12, 1.1430911e12, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.3385090e13, 0.0, 0.0, 1.3385090e13, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.5922483e13, 0.0, 0.0, 0.0, 9.5922483e13, 0.0, 0.0], $ > [0.0…
creator: Lajos Foldy
date: 2015-01-12T19:35:09-00:00

Re: IDL inverse matrix problem
type: item
description: You want to specify your matrix as double precision and then you will get the expected answer. It is *not* enough to use the /DOUBLE keyword to INVERT(). See, for example, http://www.idlcoyote.com/math_tips/sky_is_falling.html --Wayne On Monday, January 12, 2015 at 12:56:36 PM UTC-5, Amin Farhang wrote: > Dear All, > > I have a 16x16 sparse matrix which its values are big. Unfortunately IDL return wrong value for matrix inverse. Therefore when I run command (print,invert(A)##A) the returned is not an identity matrix. I check the singularity of matrix and this inversion retuned correctly by other softwares like MATLAB or MATHEMATICA or even FORTRAN. > What is happening? > > > EXAMPLE: > > A = [ [7.3339770e12, 0.0, 0.0, 0.0, 0.0, 7.3339770e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] , $ > [0.0, 5.4254596e12, 0.0, 0.0, 0.0, 5.4254596e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 4.9832916e13, 0.0, 0.0, 0.0, 4.9832916e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 9.7295220e13, 0.0, 0.0, 9.7295220e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 2.2853478e12, 2.2853478e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [7.3339770e12, 5.4254596e12, 0.0, 0.0, 2.2853478e12, 1.5044784e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 4.9832916e13, 9.7295220e13, 0.0, 0.0, 1.5037721e14, 3.2490665e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.2490665e12, 3.2490665e12, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7204194e13, 8.7204194e13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8.7204194e13, 1.9651177e14, 0.0, 0.0, 1.3385090e13, 9.5922483e13, 0.0, 0.0], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.6135226e12, 1.1430911e12, 0.0, 0.0, 1.9939955e12, 1.4764362e12], $ > [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.1430911e12, 1.1430911e12, 0…
creator: wlandsman
date: 2015-01-12T19:37:14-00:00