On Mon, Jul 21, 2008 at 6:28 PM, <[EMAIL PROTECTED]> 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.
No, Sage can't do that. There is an ambitious project by Gary Furnish to improve the symbolic manipulation capabilities of Sage, but I think even that wouldn't at all address the problem you state above, because you don't want to specify that dimensions. Of course, if I wanted to do the above in Sage I would likely define some new Python classes that implement that sort of thing (i.e., I would just write it). -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---