Opened 5 months ago

Closed 2 months ago

#24800 closed defect (wontfix)

Sage unable to make sense of Maxima expression when solving a system involving square roots

Reported by: tmonteil Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: symbolics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

As reported on his ask question, trying to solve the following equation leads to an error:

var('r2 si co r12 r22 r32 d32')
eq1 = r12==r2*d32*(1-si*(co+sqrt(3*(1-co*co)))/2)/2
eq2 = r22==r2*d32*(1-si*(co-sqrt(3*(1-co*co)))/2)/2
eq3 = r32==r2*d32*(1+si*co)/2
solve([eq1,eq2,eq3],r2,si,co)

leads to

TypeError: unable to make sense of Maxima expression '[if((-pi/2<parg(-((3*_SAGE_VAR_r22-3*_SAGE_VAR_r12)*sqrt(_SAGE_VAR_r32^2+((-_SAGE_VAR_r22)-_SAGE_VAR_r12)*_SAGE_VAR_r32+_SAGE_VAR_r22^2-_SAGE_VAR_r12*_SAGE_VAR_r22+_SAGE_VAR_r12^2))/(2*_SAGE_VAR_r32^2+((-2*_SAGE_VAR_r22)-2*_SAGE_VAR_r12)*_SAGE_VAR_r32+2*_SAGE_VAR_r22^2-2*_SAGE_VAR_r12*_SAGE_VAR_r22+2*_SAGE_VAR_r12^2)))and(parg(-((3*_SAGE_VAR_r22-3*_SAGE_VAR_r12)*sqrt(_SAGE_VAR_r32^2+((-_SAGE_VAR_r22)-_SAGE_VAR_r12)*_SAGE_VAR_r32+_SAGE_VAR_r22^2-_SAGE_VAR_r12*_SAGE_VAR_r22+_SAGE_VAR_r12^2))/(2*_SAGE_VAR_r32^2+((-2*_SAGE_VAR_r22)-2*_SAGE_VAR_r12)*_SAGE_VAR_r32+2*_SAGE_VAR_r22^2-2*_SAGE_VAR_r12*_SAGE_VAR_r22+2*_SAGE_VAR_r12^2))<==pi/2),[_SAGE_VAR_co==-((2*_SAGE_VAR_r32-_SAGE_VAR_r22-_SAGE_VAR_r12)*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VAR_r22^2-2*_SAGE_VAR_r12*_SAGE_VAR_r22+2*_SAGE_VAR_r12^2))<==pi/2),[_SAGE_VAR_co==((2*_SAGE_VAR_r32-_SAGE_VAR_r22-_SAGE_VAR_r12)*sqrt(_SAGE_VAR_r32^2+((-_SAGE_VAR_r22)-_SAGE_VAR_r12)*_SAGE_VAR_r32+_SAGE_VAR_r22^2-_SAGE_VAR_r12*_SAGE_VAR_r22+_SAGE_VAR_r12^2))/(2*_SAGE_VAR_r32^2+((-2*_SAGE_VAR_r22)-2*_SAGE_VAR_r12)*_SAGE_VAR_r32+2*_SAGE_VAR_r22^2-2*_SAGE_VAR_r12*_SAGE_VAR_r22+2*_SAGE_VAR_r12^2),_SAGE_VAR_r2==(2*_SAGE_VAR_r32+2*_SAGE_VAR_r22+2*_SAGE_VAR_r12)/(3*_SAGE_VAR_d32),_SAGE_VAR_si==(2*sqrt(_SAGE_VAR_r32^2+((-_SAGE_VAR_r22)-_SAGE_VAR_r12)*_SAGE_VAR_r32+_SAGE_VAR_r22^2-_SAGE_VAR_r12*_SAGE_VAR_r22+_SAGE_VAR_r12^2))/(_SAGE_VAR_r32+_SAGE_VAR_r22+_SAGE_VAR_r12)],union())]' in Sage

I am not familiar with the interface between Sage and Maxima, but it seems that Sage is not able to handle the conditional answers (if ... and ...)

Change History (4)

comment:1 Changed 5 months ago by rws

Duplicate of #13773. Unfortunately SymPy takes forever in this case.

comment:2 Changed 5 months ago by rws

  • Milestone changed from sage-8.2 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

comment:3 Changed 4 months ago by kcrisman

  • Status changed from needs_review to positive_review

comment:4 Changed 2 months ago by vdelecroix

  • Resolution set to wontfix
  • Status changed from positive_review to closed

closing positively reviewed duplicates

Note: See TracTickets for help on using tickets.