Hi, I am trying the following code on the following 3x3 matrix. But
the result is not very clear. Here A=a1+a2+a3.
sage: var('a1,a2,a3,A')
(a1, a2, a3, A)
sage: matrix(SR, 3, [1/a1, 0, -a1/a3^2, 0, 1/a2, -a2/a3^2,-1/A^2,
-1/A^2,-1/A^2 ])
[ 1/a1 0 -a1/a3^2]
[ 0 1/a2 -a2/a3^2]
[ -1/A^2 -1/A^2 -1/A^2]
sage: m=matrix(SR, 3, [1/a1, 0, -a1/a3^2, 0, 1/a2, -a2/a3^2,-1/A^2,
-1/A^2,-1/A^2 ])
sage: ~m
[a1 - a1^3/(A^2*a3^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))
-a1^2*a2/(A^2*a3^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))
-a1^2/(a3^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))]
[ -a1*a2^2/(A^2*a3^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2))) a2 -
a2^3/(A^2*a3^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))
-a2^2/(a3^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))]
[ -a1/(A^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))
-a2/(A^2*(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2)))
-1/(1/A^2 + a1^2/(A^2*a3^2) + a2^2/(A^2*a3^2))]
I want to find the inverse of the matrix following the pattern of
matrix(SR, 3, [1/a1, 0, -a1/a3^2, 0, 1/a2, -a2/a3^2,-1/A^2,
-1/A^2,-1/A^2 ]) of any size (not just 3x3).
Could anybody let me know what is the best way of doing it in sage?
--
Regards,
Peng
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.