Re: Product command with matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg87861] Re: Product command with matrices
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 18 Apr 2008 07:13:23 -0400 (EDT)
- Organization: Uni Leipzig
- References: <fu9ft7$ce2$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi,
Times[] is not Dot[] and Product[] and no equivalent to use
Dot[] instedad of Times[] and there is no (easy) way to
tell Mathematica that f[1] is a matrix and what may be A
a scalar ? a vector or a matrix too ? Even I can't find it out
and Mathematica can't know it.
You mean
DotProduct[mtx_, {i_, i1_, in_}] := Dot @@ Table[mtx, {i, i1, in}]
Phi[0] := Id;
Phi[n_] := DotProduct[Id + f[i] ** A, {i, 0, n - 1}]
and
Phi[3] gives
(Id + f[0] ** A).(Id + f[1] ** A).(Id + f[2] ** A)
Regards
Jens
J Davis wrote:
> I want to define a matrix valued function such as the following (in
> LaTeX lingo):
>
> $$
> X(0)=Id,
> X(n)=\prod_{i=0}^{n-1} (Id + f[i] A)
> $$
>
> where A and f have already been defined and Id is the identity matrix
> of appropriate size.
>
> I tried the following:
>
> Id=IdentityMatrix[2];
> Phi[0]:=Id;
> Phi[n_]:= Product[Id + f[i] A,{i,0,n-1}]
>
> However, Phi[3] and (Id+f[2]A).(Id+f[1]A).(Id+f[0]A) do not agree.
>
> Any help around this would be appreciated.
>