Hi,
On Sat, 29 May 2010 08:39:17 -0700 (PDT)
isurug <[email protected]> wrote:
> I was wondering if there is any support in sagemath to define new
> variables that are derivatives or integrals of existing variables. for
> instance, suppose that i define a variable called "theta" , is it now
> possible to define "omega" that is omega=thetal.derivative(t). This
> problem occured when i tried to do some derivations in mechanics. Any
> help will be highly appreciated.
sage: var('t')
t
sage: function('omega')
omega
sage: def d(self, x, diff_param=None):
....: return omega(x)
....:
sage: function('theta',derivative_func=d)
theta
sage: theta(t).derivative(t)
omega(t)
sage: theta(2*t^2).derivative(t)
4*t*omega(2*t^2)
To see all the options accepted by the global function constructor see
sage: sage.symbolic.function_factory.function?
Perhaps we should change this construction so it just works with:
sage: def d(x, diff_param=None):
....: return omega(x)
....:
sage: function('theta',derivative_func=d)
Cheers,
Burcin
--
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
URL: http://www.sagemath.org