MathGroup Archive 2008

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

Search the Archive

Re: Product command with matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg87874] Re: [mg87834] Product command with matrices
  • From: "W_Craig Carter" <ccarter at mit.edu>
  • Date: Sat, 19 Apr 2008 03:33:46 -0400 (EDT)
  • References: <200804180640.CAA12618@smc.vnet.net>

Hello J,
You should  use Dot.

Perhaps this will help:
f[i_ ] := f[i] = RandomReal[{0, 1}, {2, 2}] (* random 2x2 matrices,
that remember their value*)

f[1].f[2].f[3]
Dot[f[1], f[2], f[3]]
Apply[Dot, {f[1], f[2], f[3]}]

So, what you want is something like
Apply[Dot,Table[matrices[k],{k,1,n}]


On Fri, Apr 18, 2008 at 2:40 AM, J Davis <texasAUtiger at gmail.com> 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.
>
>



-- 
W. Craig Carter


  • Prev by Date: Re: NDSolve and vector functions
  • 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