On Sun, Jul 5, 2009 at 3:34 AM, Golam Mortuza Hossain<gmhoss...@gmail.com> wrote: > > Hi all, > > It seems none of the current substitute methods for symbolic > expressions works for the argument of the derivative operator. > > In computing functional derivative, I need to vary > a functional. For example, in sage-3.4 I can do as follows > ------- > sage: f(x) = function('f',x) > sage: df(x) = function('df',x) > sage: g = f(x).diff(x) > sage: g > diff(f(x), x, 1) > sage: g.subs_expr(f(x)==f(x)+df(x)) > diff(f(x) + df(x), x, 1) > ------- > > In new symbolics, if I do the same I get > -------- > sage: g > D[0](f)(x) > sage: g.subs_expr(f(x)==f(x)+df(x)) > D[0](f)(x) > --------- > > Is there a way to do this in new symbolics? It seems > to be a road block in implementing calculus of variations > in new symbolics. >
I don't see any way to do this yet, which is frustrating. This was as close as I got, which is really awful: sage: g.operator().change_function(f(x)+df(x))(x) D[0](f)(x) + D[0](df)(x) I really hope once we get these issues sorted out and you implement calculus of variations, that you include it in Sage. If we had your code before it would have been good test code to have when we were transition from old to new symbolics code. -- William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---