Hi Jason and anybody interested in symbolics in Sage,

On Fri, 04 Sep 2009 07:33:12 -0500
Jason Grout <jason-s...@creativetrax.com> wrote:

> 
> Golam Mortuza Hossain wrote:
> > 
> > 
> > On Sep 3, 10:52 am, Nicolas <nicolas.fresseng...@gmail.com> wrote:
> >> I am trying to do the following thing but I am not sure whether
> >> this is possible in sage (though I think it is in Mathematica)
> >>
> >> Let's say I define a symbolic function
> >>
> >> sage: f=function('f',x)
> >>
> >> I would like to issue some command to "tell" sage what the
> >> derivative of f is (for instance : g) so that the command
> >>
> >> sage: diff(f)
> >>
> >> would yield g
> > 
> > Yes, its possible also in Sage. I am giving you an example that you
> > can adapt for your need. (if you have have a function of multiple
> > arguments then you should read diff_param keywords. For example,
> > try heaviside?? in sage prompt to see how to read diff_param)
> > 
> > --------
> > sage: g = function('g')
> > sage: def f_deriv(*args, **kwds):
> > ....:     return g(*args)
> > ....:
> > sage: f = function('f', derivative_func=f_deriv)
> 
> 
> Where is this documented?  I see some examples (of this and lots of 
> other keywords) under:
> 
> sage.symbolic.function.SFunction??
> 
> But I don't think most users would use sage_search or grep to find it 
> like I had to resort to after guessing a bunch of places the 
> documentation might be...
> 
> It looks like there are quite a lot of very interesting and useful 
> arguments to function.  I had no idea these existed!

This is some of the new functionality that came with the GiNaC wrapper.
It was one of the first things I wrapped, and in the rush for the
switch over from maxima, it still remains in its raw state.

The interface to define new functions needs more care and polish. ATM,
you define a class with methods _eval_, _evalf_, _derivative_, etc. and
your function ends up being an instance of this class. I find this
rather confusing and would appreciate any suggestions on other design
options.


There are still lots of rough edges in the new symbolics code. I don't
have time to fix all these problems or write documentation. Though, I
will do my best to answer questions and explain any tricky parts of the
new symbolics to anybody interested, and put in the work to make the
required changes (if any) at the c++ level in pynac.

So if you're interested in getting the symbolics up to snuff, please
take the plunge and look at the new symbolics code in sage/symbolic/.

There are lot's of symbolics bugs on trac:

http://is.gd/2SqFy [symbolics]
http://is.gd/2SqMs [calculus]

I can help fix the ones related to new symbolics, #6220 looks like a
good start for example.

If there is interest we can even hold a symbolics bug day where we meet
on IRC and work on some of these. 


Cheers,
Burcin

P.S. Many thanks to Karl-Dieter and Golam for the patches waiting for
review on trac. I'll try to do the reviews this weekend if no one gets
there first.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to