Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Specifying a limit for a symbolic function?

Hi there,

I am working on symbolic functions, and I do have a lot of integration by parts to be done, in which I have to evaluate some exact derivative terms at infinity.

I am defining this function, specifying its derivative.

def deriv_F_0(self,*args,**kwds):
    return -exp(2*i*args[kwds['diff_param']])/args[kwds['diff_param']]

F_0=function('F_0',nargs=1,derivative_func=deriv_F_0)

It works fine, but, I would like to add to it an option doing something like

limit_func=mylimit_F_0

to specify various asymptotic limits. Of course, the goal being that:

F_0(x).limit(x=infinity)

returns the value I specify. Any help welcome!

Specifying a limit for a symbolic function?

Hi there,

I am working on with symbolic functions, and I do have a lot of integration by parts to be done, in which I have to evaluate some exact derivative terms at infinity.

I am defining this symbolic function, specifying its derivative.

def deriv_F_0(self,*args,**kwds): deriv_F_0(self,args,kwds): return -exp(2*i*args[kwds['diff_param']])/args[kwds['diff_param']] -exp(2i*args[kwds['diff_param']])/args[kwds['diff_param']]

F_0=function('F_0',nargs=1,derivative_func=deriv_F_0)

It works fine, but, I would also like to add to it an option like "limit_func" doing something like

limit_func=mylimit_F_0

this:

F_0=function('F_0',nargs=1,derivative_func=deriv_F_0,limit_func=mylimit_F_0)

where "mylimit_F_0" would be a function of mine. Notice that my problem is just that "limit_func" does not exist :)

For instance, I could set:

def mylimit_F_0(self,x):
   if bool(x==infinity):
      return pi

the goal being to specify various asymptotic limits. Of course, the goal being that:limits, and makes this

F_0(x).limit(x=infinity)

returns returning the value I specify. Any specify, here pi.

I have started SageMath a few days ago, so any help welcome!welcome! Let me know if there are any alternative methods for setting limit on symbolic functions!

Cheers, chris.

Specifying a limit for a symbolic function?

Hi there,

I am working with symbolic functions, and I do have a lot of integration by parts to be done, in which I have to evaluate some exact derivative terms at infinity.

I am defining this symbolic function, specifying its derivative.

def deriv_F_0(self,args,kwds):
deriv_F_0(self, *args, **kwds):
    return -exp(2i*args[kwds['diff_param']])/args[kwds['diff_param']]

F_0=function('F_0',nargs=1,derivative_func=deriv_F_0)
-exp(2*i*args[kwds['diff_param']])/args[kwds['diff_param']]

F_0 = function('F_0', nargs=1, derivative_func=deriv_F_0)

It works fine, but, I would also like to add to it an option like "limit_func" doing this:

F_0=function('F_0',nargs=1,derivative_func=deriv_F_0,limit_func=mylimit_F_0)
F_0 = function('F_0', nargs=1, derivative_func=deriv_F_0, limit_func=mylimit_F_0)

where "mylimit_F_0" would be a function of mine. mine. Notice that my problem is just that "limit_func" does not exist :)

For instance, I could set:

def mylimit_F_0(self,x):
mylimit_F_0(self, x):
   if bool(x==infinity):
      return pi

the goal being to specify various asymptotic limits, and makes this

F_0(x).limit(x=infinity)

returning the value I specify, here pi.pi.

I have started SageMath a few days ago, so any help welcome! welcome! Let me know if there are any alternative methods for setting limit on symbolic functions!

Cheers, chris.