Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Is there any way (or a package built for it) can do simple operations with vectors and matricies of arbitrary size, but conforming extents?

For the simplest example to test, given an arbitrary vector $a,z\in R^n$ and $A \in R^{n \times n}$, $\nabla(a \cdot z) = a$ and the jabobian: $\nabla(A \cdot z) = A$, etc.

I tried the obvious (assuming that $z$ was a vector) Grad[a . z, {z}] etc, but it didn't work. I noticed Differentiating with respect to vectors of unspecified length, and Generating a vector of dummy variables but they didn't appear to help - and may be suggesting that it isn't possible...

share|improve this question
    
You have to use symbolic tensors‌​. –  István Zachar Oct 8 '13 at 23:06
    
Closely related: How to declare a 3D vector variable?. –  Artes Oct 8 '13 at 23:54
    
Tensors and reductions may be overkill, but they sure look like they would work. Are there easy ways to apply differential operators to an expression with tensors, tensor products, etc? (i.e. my gradient operation above). –  jlperla Oct 9 '13 at 2:28
    
If you perform numerical computations you can consider using built-in Experimantal`NumericalFunction for automatic gradients and Jacobians. –  Alexey Popkov Apr 15 at 16:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.