\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)
(%i1) |
WeakDrazinInverse
(
A
)
:
=
block
(
[
n
,
m
,
d
,
s
,
P
,
X
]
,
if not ( matrixp ( A ) ) then error ( "Matrix expected" ) , [ n , m ] : matrix_size ( A ) , if n # m then error ( "Square matrix expected" ) , X : ident ( n ) − s · A , P : expand ( determinant ( X ) ) , d : hipow ( P , s ) , coeff ( expand ( adjoint ( X ) ) , s , d − 1 ) / coeff ( P , s , d ) ) $ |
(%i5) |
print
(
"Matrix:"
)
$
M : matrix ( [ m11 , m12 , m13 ] , [ m21 , 0 , 0 ] , [ m31 , 0 , 0 ] ) ; print ( "Weak Drazin inverse:" ) $ WeakDrazinInverse ( M ) ; |
\[\]\[\mbox{Matrix}:\]
\[\operatorname{(M) }\begin{pmatrix}\ensuremath{\mathrm{m11}} & \ensuremath{\mathrm{m12}} & \ensuremath{\mathrm{m13}}\\ \ensuremath{\mathrm{m21}} & 0 & 0\\ \ensuremath{\mathrm{m31}} & 0 & 0\end{pmatrix}\]\[\mbox{Weak Drazin inverse:}\]
\[\operatorname{ }\begin{pmatrix}0 & \frac{\ensuremath{\mathrm{m12}}}{-\ensuremath{\mathrm{m13}}\, \ensuremath{\mathrm{m31}}-\ensuremath{\mathrm{m12}}\, \ensuremath{\mathrm{m21}}} & \frac{\ensuremath{\mathrm{m13}}}{-\ensuremath{\mathrm{m13}}\, \ensuremath{\mathrm{m31}}-\ensuremath{\mathrm{m12}}\, \ensuremath{\mathrm{m21}}}\\ \frac{\ensuremath{\mathrm{m21}}}{-\ensuremath{\mathrm{m13}}\, \ensuremath{\mathrm{m31}}-\ensuremath{\mathrm{m12}}\, \ensuremath{\mathrm{m21}}} & -\frac{\ensuremath{\mathrm{m11}}}{-\ensuremath{\mathrm{m13}}\, \ensuremath{\mathrm{m31}}-\ensuremath{\mathrm{m12}}\, \ensuremath{\mathrm{m21}}} & 0\\ \frac{\ensuremath{\mathrm{m31}}}{-\ensuremath{\mathrm{m13}}\, \ensuremath{\mathrm{m31}}-\ensuremath{\mathrm{m12}}\, \ensuremath{\mathrm{m21}}} & 0 & -\frac{\ensuremath{\mathrm{m11}}}{-\ensuremath{\mathrm{m13}}\, \ensuremath{\mathrm{m31}}-\ensuremath{\mathrm{m12}}\, \ensuremath{\mathrm{m21}}}\end{pmatrix}\]
Created with wxMaxima.