Tim Lahey wrote:
> 
> On Dec 17, 2008, at 8:03 PM, Jason Grout wrote:
> 
>> Tim Lahey wrote:
>>> There are certainly some things you can do with general matrices and
>>> vectors, but I think doing something like defining A as an nxm matrix
>>> and allowing various operations on it is a very useful thing.
>>> Mathematica has some support for this, but I don't think it has a
>>> general solve.
>>
>> Could you maybe give an example session in Mathematica doing something
>> like this?
>>
> 
> You can define a, and c as vectors and B as a matrix and then do,
> 

Oh, I understood the above to mean that you could define a matrix B, for 
example, without defining the elements of the matrix.  I don't know how 
to do that in Mathematica; maybe I'm confused.  At any rate, for now, 
I'll assume that you mean that you define "vectors" a and c and a 
"matrix" B in Mma by specifying the entries as symbolic expressions.  I 
put vectors and matrix in quotes since I just ran into some trouble 
trying to do an example session in Mma.  To my knowledge, Mma really has 
no notion of a "vector" or a "matrix", but instead has just the notion 
of a list and a list of lists.  This gave me problems in trying to do 
what what you did below.  Here, I define n to be a "vector" and try to 
compute NN^T

In[2]:= n = {1, t, Cos[t]}

Out[2]= {1, t, Cos[t]}

In[3]:= b=n.Transpose[n]

Transpose::nmtx:
    The first two levels of the one-dimensional list {1, t, Cos[t]}
      cannot be transposed.


Instead, I assume you mean to define n as literally a column vector 
(i.e., a column "matrix")?

In[6]:= n = {{1, t, Cos[t]}}//Transpose

Out[6]= {{1}, {t}, {Cos[t]}}

In[7]:= b=n.Transpose[n]

                               2                                      2
Out[7]= {{1, t, Cos[t]}, {t, t , t Cos[t]}, {Cos[t], t Cos[t], Cos[t] }}




> D[Transpose[a].B.c, c]
> or
> D[Transpose[a].B.c, a]
> 
> If they conform, the operation is valid, and has a simple solution.

Pardon my ignorance, but what do you mean by a "solution"?  Do you mean 
that the derivatives yield a result, or that there is another solving 
step which involves an equation?

I think that this might be possible in Sage using 
http://trac.sagemath.org/sage_trac/ticket/3941 and 
http://trac.sagemath.org/sage_trac/ticket/4493.  Can you give a specific 
Mathematica example session?  I'll try to duplicate it in Sage.

Thanks

Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to