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
- References:
- Product command with matrices
- From: J Davis <texasAUtiger@gmail.com>
- Product command with matrices