Opened 4 years ago

Closed 4 years ago

#25628 closed defect (fixed)

translation errors from fricas to sage

Reported by: Nasser Owned by:
Priority: minor Milestone: sage-8.3
Component: interfaces: optional Keywords: fricas
Cc: Merged in:
Authors: Martin Rubey Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: 83e8132 (Commits, GitHub, GitLab) Commit: 83e81329f819d5b673d8214d00f11207f97ebb25
Dependencies: Stopgaps:

Status badges

Description

Sorry that I do not know if these are known issues or not. Thought to report them. If there are known, feel free to close this.

Using Sage version 8.3.beta6 This one seems to be that there is no translation from fricas to sage. Is this due to the atan ?

           sage:  var('x a')
           sage:  integrate(1/(1+a*cos(x)),x,algorithm="fricas")

    NotImplementedError: The translation of the FriCAS Expression "atan(((cos(x)+a)*((-1)*a^2+1)^(1/2))/((a^2+(-1))*sin(x)))/(((-1)*a^2+1)^(1/2)) to sage is not yet implemented.

And this one

    sage: var('x a b')
    sage: anti=integrate(1/(b*x^2+a),x,algorithm="fricas")

    NotImplementedError: The translation of the FriCAS Expression "log(((b*x^2+(-1)*a)*((-1)*a*b)^(1/2)+2*a*b*x)/(b*x^2+a))/(2*((-1)*a*b)^(1/2)) to sage is not yet implemented.

Change History (10)

comment:1 Changed 4 years ago by Martin Rubey

Component: PLEASE CHANGEinterfaces: optional

Thank you for reporting!

Both are fixed with #25606...

comment:2 Changed 4 years ago by Martin Rubey

Authors: Martin Rubey
Status: newneeds_review

comment:3 Changed 4 years ago by Frédéric Chapoton

Martin, one should add doctests for these.

comment:4 Changed 4 years ago by Martin Rubey

Branch: u/mantepse/translation_errors_from_fricas_to_sage

comment:5 Changed 4 years ago by Martin Rubey

Commit: 83e81329f819d5b673d8214d00f11207f97ebb25

Done, good idea!


New commits:

83e8132add integration doctests

comment:6 Changed 4 years ago by Martin Rubey

Hm, would you mind looking also at #25602?

comment:7 Changed 4 years ago by Frédéric Chapoton

Reviewers: Frédéric Chapoton
Status: needs_reviewpositive_review

ok for this one. For the other one, it looks like more work..

comment:8 Changed 4 years ago by Martin Rubey

No problem! Thank you for this one!

comment:9 Changed 4 years ago by Nasser

Hello; Fyi. I installed sagemath 8.3 beta7 and also installed Fricas 1.3.4 and the above error are no longer there. So this confirms your fixes worked.

>sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.3.beta7, Release Date: 2018-06-23               │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Setting permissions of DOT_SAGE directory so only you can read and write it.
sage: var('x a')
(x, a)

sage: integrate(1/(1+a*cos(x)),x,algorithm="fricas")
[1/2*log((2*(a^3 + (a^2 - 1)*cos(x) - a)*sin(x) - ((a^2 - 2)*cos(x)^2 - 2*a^2 - 2*a*cos(x) + 1)*sqrt(a^2 - 1))/(a^2*cos(x)^2 + 2*a*cos(x) + 1))/sqrt(a^2 - 1),
 arctan(sqrt(-a^2 + 1)*(a + cos(x))/((a^2 - 1)*sin(x)))/sqrt(-a^2 + 1)]
sage: 
sage: var('x a b')
(x, a, b)

sage: anti=integrate(1/(b*x^2+a),x,algorithm="fricas")

sage: anti
[1/2*log((2*a*b*x + (b*x^2 - a)*sqrt(-a*b))/(b*x^2 + a))/sqrt(-a*b),
 arctan(sqrt(a*b)*x/a)/sqrt(a*b)]
sage: 

Working very well. Thank you for making this fix.

--Nasser

comment:10 Changed 4 years ago by Volker Braun

Branch: u/mantepse/translation_errors_from_fricas_to_sage83e81329f819d5b673d8214d00f11207f97ebb25
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.