Hi all, I came to post a similar question and stumbled upon this discussion, which I realize is from 2008 - perhaps some of this functionality has been developed by now!
In any case, I'm brand new to Sage, as in I haven't used it at all yet though I'm excited to try it. So, if my question is answered somewhere in the documentation, you can just direct me to the right spot, but I haven't been able to find it. Basically, I have a function of three vectors, let's call them x1, x2 and x3. The function consists of a complicated expression using dot and cross products. I may know the dimension of the vector space, so this is not the primary issue (also as far as I know, cross products are only defined for 3 or 7 dimensions). The issue is that I want the answer to be in terms of the vectors, not their individual components / coordinates in an equivalent Euclidean vector space. The function is vector-valued (the output value is of the same dimension as the input vectors), and I need to apply a composition of this function multiple times. So, the result will be overly complicated and needs to be simplified using vector identities. So, I need to obtain something like f(a4, b4, f(a3, b3, f(a2, b2, f(a1, b1, c1)))). Can Sage do anything like this currently? If not, is there a suggested workaround with Sage, and if not, then what other software might help? Thanks so much! Sherif On Monday, July 21, 2008 12:28:19 PM UTC-4, Justin Domke wrote: > > Hello all, > > I have a simple question about the capabilities of Sage that I have > not been able to resolve by looking at the documentation. I often > find myself manipulating somewhat complex functions that take vector > arguments. I then need to derive gradients, hessians, etc. I need to > do this with out knowing the dimensions of the vectors. So for > example, what I would like to do is something like the following. > First, I would define the function f(x)=.5 * x' * A * x + b, perhaps > something like: > > A = matrix(); > x = vector(); > b = vector(); > f = function( x' * A * x + b); > > Then, I would like Sage to do the calculus for me, something like, > say: > > f.gradient() > sage) 2*A*x > f.hessian() > sage) A > > (Of course, I wouldn't bother using a computer algebra system for such > a simple function, but you get the idea.) My question is: can Sage do > things like this? I would like to avoid specifying the dimensions of > x, or giving the entries of A when I define the function. > > Thanks! > Justin > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
