Re: infinity expression from matrix inverse
- To: mathgroup at smc.vnet.net
- Subject: [mg49810] Re: [mg49800] infinity expression from matrix inverse
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Sun, 1 Aug 2004 18:48:42 -0400 (EDT)
- References: <200408010810.EAA02530@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Xiao Huang wrote:
> Dear Friends,
>
> Recently I've been having this problem with Mathematica 5.0: In the follwing
> program, when I set t=2 to 11, mathematica can give me the inverse of matrix
> n0, but for t >=12, it fails to produce the inverse due to infinity
> expressions. Can anyone explain this to me? (I guess the problem occurs in
> the last line.) Thanks a lot! Those a1,a2,n0,n0s,nn,c you see in the
> following program are just some matrices.
>
> Best Regards,
>
> Xiao
>
> \!\(<< LinearAlgebra`MatrixManipulation`\[IndentingNewLine]
> \(Remove["\<Global`*\>"];\)\[IndentingNewLine]
> \(ó = 8;\)\[IndentingNewLine]
> \(t = 11;\)\[IndentingNewLine]
> \(â = 0.6;\)\[IndentingNewLine]
> \(a1 = AppendRows[\ \ \ \ IdentityMatrix[\ t - 1\ ]\ , \ \ \ Table[\ 0\ ,
> \ \
> {\ t - 1\ }, \ {\ 1\ }\ ]\ \ \ \ ];\)\[IndentingNewLine]
> \(a2 = AppendRows[\ \ \ \ Table[\ 0\ , \ {\ t - 1\ }, \ {\ 1\ }\ ]\ , \ \
> \
> IdentityMatrix[\ t - 1\ ]\ \ \ \ \ ];\)\[IndentingNewLine]
> \(nn = Transpose[a1] . a1;\)\[IndentingNewLine]
> \(n1 = Transpose[a1] . a2;\)\[IndentingNewLine]
> \(c = IdentityMatrix[t] + AppendColumns[\ Table[0, \ {1}, \ {t}],
> AppendRows[\ \ \(-â\)*IdentityMatrix[t - 1], \
> Table[\ 0, \ {t - 1}, \ {1}\ ]\ ]\ ];\)\[IndentingNewLine]
> \(vc = ó\^2*Inverse[c] . Transpose[Inverse[c]];\)\[IndentingNewLine]
> \(n0 = IdentityMatrix[t]\ + \ 2 x*vc . nn;\)\[IndentingNewLine]
> \(Print[\ MatrixForm[n0]\ ];\)\[IndentingNewLine]
> \(n2 = Inverse[n0] . vc;\)\[IndentingNewLine]
> \)
I doubt this is specific to version 5. Also, I'd do this using exact
input, as below (names changed to avoid non-ascii characters).
<<LinearAlgebra`MatrixManipulation`
oo = 8; t = 12; aa = 3/5;
a1 = AppendRows[IdentityMatrix[t-1], Table[0, {t-1}, {1}]];
a2 = AppendRows[Table[0, {t-1}, { 1 } ], IdentityMatrix[t-1]];
nn = Transpose[a1].a1;
n1 = Transpose[a1].a2;
c = IdentityMatrix[t] + AppendColumns[Table[0, {1}, {t}],
AppendRows[-aa*IdentityMatrix[t - 1], Table[0, {t-1}, {1}]]];
vc = oo^2*Inverse[c].Transpose[Inverse[c]];
n0 = IdentityMatrix[t] + 2*x*vc.nn;
Now we'll do the solving step. It is more efficient to use LinearSolve
instead of Inverse.
In[57]:=
Timing[n2=LinearSolve[n0,vc,Method\[Rule]OneStepRowReduction];]
Out[57]=
{1.71 Second,Null}
In[41]:=
LeafCount[n2]
Out[41]=
297054
In[58]:=
Timing[n2t=Together[n2];]
Out[58]=
{8.79 Second,Null}
In[59]:=
LeafCount[n2t]
Out[59]=
12970
Your matrix consists of linear polynomials in one variable. As an
alternative approach that might help for large examples, you might try
interpolation. For details see
http://groups.google.com/groups?q=Lichtblau+LinearSolve+group:sci.math.symbolic&hl=en&lr=&ie=UTF-8&group=sci.math.symbolic&safe=off&selm=51742f%24iij%40dragonfly.wolfram.com&rnum=3
Moreover, as your matrix has the structure IdentityMatrix+x*M, there
should also be an efficient power series approach, using knowledge about
the degree of rational functions in the result.
Daniel Lichtblau
Wolfram Research
- References:
- infinity expression from matrix inverse
- From: "Xiao Huang" <xiaohda@hotmail.com>
- infinity expression from matrix inverse