Re: [sage-support] Re: integrate(sec(t)*tan(t),t,0,pi/3), why does definite integral of trig functions give error?

2009-12-27 Thread Martin Rubey
Robert Bradshaw  writes:

> Sage has an input form as well:
>
> sage: R. = QQ[]
> sage: sage_input(t^3-t)
> R. = QQ[]
> t^3 - t
>
> sage: R. = GF(101)[]
> sage: sage_input(random_matrix(ZZ, 2, 2) + t)
> R. = GF(101)[]
> matrix(R, [[t, 1], [96, t + 98]])

Oh, this is wonderful!  

(ideally, i.e., for many types it is not implemented, but it's mostly a
triviality) we'd have something like

($elt (MyType myop) arg1 arg2 ...)

for 

myop(arg1, arg2, ...)$MyType

Of course, since there may be several operations myop in MyType, the
types of arg1, arg2, etc. should be specified too.

>> I think we would need a FriCAS-SAGE programmer, who implements a
>> dictionary style translation between the two type systems.  But maybe
>> I'm too optimistic here...
>
> Well, I'm pretty sure there's not a FriCAS equivalent of every Sage  
> type, and vice-versa, but even doing a little better would be very  
> useful (right now, it doesn't do anything that's not just passing  
> strings back and forth.

Exactly.

Martin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: integrate(sec(t)*tan(t),t,0,pi/3), why does definite integral of trig functions give error?

2009-12-26 Thread Robert Bradshaw
On Dec 26, 2009, at 12:42 PM, Martin Rubey wrote:

> William Stein  writes:
>
>>> I admit however, that calling FriCAS from sage is very awkward,  
>>> since
>>> the interface is absolutely dumb.
>>
>> Could you please give constructive criticism instead?  I for one
>> appreciate the work Bill Page did at Sage Days 2 to write an axiom
>> interface.  I think enumerating some specific criticism of it would  
>> be
>> more useful.  If you've already done so, maybe you could post a link?
>
> I also think that Bill Page did and does a good job.
>
> The main thing that's missing is a proper way to translate between
> fricas and sage types.

Yes.

> Eg: (without understanding the issues involved...)
>
>>> sage: fricas.integrate('sec(t)*tan(t)','t=0..%pi/3','"noPole"')
>>> 1
>
> why is it, that I can't write
>
> fricas.integrate(sec(t)*tan(t),(t,0,%pi/3),"noPole")

You can do fricas.eval("...any valid fricas command..."), though  
fricas.integrate(...) and integrate(..., algorithm='fricas') should  
work much better.

> (and I think that "SegmentBinding", i.e., something of the form
>
>t=a..
>
> or
>
>t=a..b
>
> is something missing from sage.  On the other hand, "=" seems to be
> reserved for keyword arguments and assignment in python, except that
> sage uses it at least in "limit" also in the sense of an equation.

Yes, that is correct. The decision to stay close to Python is a  
constraint in some ways, but in many others is a huge benefit.

> I would have expected "==".)
> FriCAS has a type called InputForm, which (in an ideal world) captures
> the semantics of any given object.  (I guess, it's somewhat similar to
> the pickle mechanism?)

Sage has an input form as well:

sage: R. = QQ[]
sage: sage_input(t^3-t)
R. = QQ[]
t^3 - t

sage: R. = GF(101)[]
sage: sage_input(random_matrix(ZZ, 2, 2) + t)
R. = GF(101)[]
matrix(R, [[t, 1], [96, t + 98]])

Pickling is a binary representation, more optimized for compactness  
and speed (and also may store pre-computed cached data).

> I think we would need a FriCAS-SAGE programmer, who implements a
> dictionary style translation between the two type systems.  But maybe
> I'm too optimistic here...

Well, I'm pretty sure there's not a FriCAS equivalent of every Sage  
type, and vice-versa, but even doing a little better would be very  
useful (right now, it doesn't do anything that's not just passing  
strings back and forth.

- Robert

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: integrate(sec(t)*tan(t),t,0,pi/3), why does definite integral of trig functions give error?

2009-12-26 Thread Martin Rubey
William Stein  writes:

>> I admit however, that calling FriCAS from sage is very awkward, since
>> the interface is absolutely dumb.
>
> Could you please give constructive criticism instead?  I for one
> appreciate the work Bill Page did at Sage Days 2 to write an axiom
> interface.  I think enumerating some specific criticism of it would be
> more useful.  If you've already done so, maybe you could post a link?

I also think that Bill Page did and does a good job.

The main thing that's missing is a proper way to translate between
fricas and sage types.

Eg: (without understanding the issues involved...)

>> sage: fricas.integrate('sec(t)*tan(t)','t=0..%pi/3','"noPole"')
>> 1

why is it, that I can't write

fricas.integrate(sec(t)*tan(t),(t,0,%pi/3),"noPole")

(and I think that "SegmentBinding", i.e., something of the form

t=a..

or

t=a..b

is something missing from sage.  On the other hand, "=" seems to be
reserved for keyword arguments and assignment in python, except that
sage uses it at least in "limit" also in the sense of an equation.  I
would have expected "==".)

FriCAS has a type called InputForm, which (in an ideal world) captures
the semantics of any given object.  (I guess, it's somewhat similar to
the pickle mechanism?)

I think we would need a FriCAS-SAGE programmer, who implements a
dictionary style translation between the two type systems.  But maybe
I'm too optimistic here...

Martin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: integrate(sec(t)*tan(t),t,0,pi/3), why does definite integral of trig functions give error?

2009-12-26 Thread William Stein
On Sat, Dec 26, 2009 at 8:28 AM, Robert Dodier  wrote:
> On Dec 24, 11:18 am, William Stein  wrote:
>
>> The problem -- which is a serious one -- is that Sage's symbolic
>> integration is by default done using Maxima (this is currently the
>> main way in which Maxima is used in Sage; the other big way is for
>> solving symbolic equations).  Maxima has a somewhat weak assumptions
>> system and was designed in the 1960s when the assumption that a user
>> was at the terminal happily answering questions -- a sort of
>> conversation -- was considered reasonable.
>
> For the record, I believe that strengthening the assume
> system would be the shortest path towards solving the
> problem which started this thread.
> (As opposed to revising or reimplementing the code
> for definite integration.)

Cool.  I didn't know that.  What do you have in mind?

William

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: integrate(sec(t)*tan(t),t,0,pi/3), why does definite integral of trig functions give error?

2009-12-26 Thread William Stein
On Sat, Dec 26, 2009 at 7:18 AM, Martin Rubey
 wrote:
> Jason Grout  writes:
>
>> 3. Use an alternative system for evaluating the integral, like sympy or
>> mathematica_free
>
> ceterum censeo:
>
> sage: fricas.integrate('sec(t)*tan(t)','t=0..%pi/3','"noPole"')
> 1
>
>
> the noPole argument instructs FriCAS to ignore possible poles that the
> integral without limits could have:
>
> sage: fricas.integrate('sec(t)*tan(t)','t')
>
>  cos(t) + 1
>  --
>    cos(t)
>
> I admit however, that calling FriCAS from sage is very awkward, since
> the interface is absolutely dumb.

Could you please give constructive criticism instead?I for one
appreciate the work Bill Page did at Sage Days 2 to write an axiom
interface.   I think enumerating some specific criticism of it would
be more useful.  If you've already done so, maybe you could post a
link?

William

>
> I think that's a shame, because FriCAS is quite good at differential
> algebra.
>
> Martin
>
> --
> To post to this group, send email to sage-support@googlegroups.com
> To unsubscribe from this group, send email to 
> sage-support+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


Re: [sage-support] Re: integrate(sec(t)*tan(t),t,0,pi/3), why does definite integral of trig functions give error?

2009-12-26 Thread Martin Rubey
Jason Grout  writes:

> 3. Use an alternative system for evaluating the integral, like sympy or 
> mathematica_free

ceterum censeo:

sage: fricas.integrate('sec(t)*tan(t)','t=0..%pi/3','"noPole"')
1


the noPole argument instructs FriCAS to ignore possible poles that the
integral without limits could have:

sage: fricas.integrate('sec(t)*tan(t)','t')

  cos(t) + 1
  --
cos(t)

I admit however, that calling FriCAS from sage is very awkward, since
the interface is absolutely dumb.

I think that's a shame, because FriCAS is quite good at differential
algebra.

Martin

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org