       Re: derivative of matrix in mathematica

• To: mathgroup at smc.vnet.net
• Subject: [mg120154] Re: derivative of matrix in mathematica
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Sun, 10 Jul 2011 05:01:28 -0400 (EDT)

```On 7/9/11 at 7:32 AM, physics1389 at yahoo.com (yashar) wrote:

>in mathematica
>how i can produce a general n by n matrix so that each of its elements be a variable of t???

Any number of ways. It depends on what it is you want. An couple
of examples would be:

In:= m = t RandomInteger[5, {2, 2}]

Out= {{0, 5*t}, {2*t, 0}}

In:= m1 = t^RandomInteger[5, {2, 2}]

Out= {{t, 1}, {t^3, t^2}}

>how i can take derivative of this matrix with respect to variable t?

The same way as taking the derivative of any function with
respect to t. Using the examples above;

In:= D[m, t]

Out= {{0, 5}, {2, 0}}

In:= D[m1, t]

Out= {{1, 0}, {3*t^2, 2*t}}

>how i can with equating this n by n matrix with another n by n matrix which its elements are known obtain unknown elements of this general n by n matrix?

Here, I am not clear on what it is you want to do. I can find a
solution by setting corresponding elements equal as follows

In:= y = RandomInteger[5, {2, 2}];
MapThread[Solve[#1 == #2, t] &, {Flatten@y, Flatten@m}]

Out= {{}, {{t -> 1}}, {{t -> 2}}, {{}}}

But it is trivial to find examples where this won't work.

```

• Prev by Date: Re: Numerical accuracy/precision - this is a bug or a feature?
• Next by Date: Re: Which Test is Used to Verify Assumptions in TTest
• Previous by thread: Re: derivative of matrix in mathematica
• Next by thread: Which Test is Used to Verify Assumptions in TTest