MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Product command with matrices


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}]


Phi[3] gives

(Id + f[0] ** A).(Id + f[1] ** A).(Id + f[2] ** A)


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.

  • Prev by Date: Re: Scaling Plot inside Row
  • Next by Date: Re: Indefinite numbers of arguments in a function
  • Previous by thread: Re: Product command with matrices
  • Next by thread: Re: Product command with matrices