Re: [sympy] Bug with solve function

2020-04-21 Thread Oscar Benjamin
Thanks I think that this is a bug on roots_quintic. Can you open an
issue on github:
https://github.com/sympy/sympy/

On Mon, 20 Apr 2020 at 20:02, Tiam Koukpari  wrote:
>
> I found a bug in Sympy's solve function.
>
> from sympy import solve
> from sympy.abc import x
> solve(x**5 - 6*x**3 - 6*x**2 + x - 6)
>
> I attached a .png of the error above. The same thing in Matlab returns
>
> >> syms x
> >> eqn = x^5 - 6*x^3 - 6*x^2 - 6 == 0
> >> S = solve(eqn)
>
> S =
>
>  root(z^5 - 6*z^3 - 6*z^2 - 6, z, 1)
>  root(z^5 - 6*z^3 - 6*z^2 - 6, z, 2)
>  root(z^5 - 6*z^3 - 6*z^2 - 6, z, 3)
>  root(z^5 - 6*z^3 - 6*z^2 - 6, z, 4)
>  root(z^5 - 6*z^3 - 6*z^2 - 6, z, 5)
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/a34a0c26-b176-49a6-ba66-a8e69994b1e4%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxQ9YwCO6chZLJ%3D98n_sHxSyxCosyuCg%2B_F%3DnoeD7H3FCg%40mail.gmail.com.


[sympy] Bug with solve function

2020-04-21 Thread Nicolas Guarin

I was not able to reproduce your error. This is what I get instead

print(sol)
[CRootOf(x**5 - 6*x**3 - 6*x**2 - 6, 0), CRootOf(x**5 - 6*x**3 - 6*x**2 - 6, 
1), CRootOf(x**5 - 6*x**3 - 6*x**2 - 6, 2), CRootOf(x**5 - 6*x**3 - 6*x**2 - 6, 
3), CRootOf(x**5 - 6*x**3 - 6*x**2 - 6, 4)]

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/f4e57b73-71df-439f-8e73-0caac4ad21ca%40googlegroups.com.


Re: [sympy] Bug with solve

2015-05-28 Thread Aaron Meurer
It looks like this is fixed in master. I bisected it to
https://github.com/sympy/sympy/commit/9b1f3d7402538c587a00fa4df162208998727830.

Aaron Meurer

On Wed, May 20, 2015 at 12:46 AM, Arnaud Usciati rait...@gmail.com wrote:
 Right,

 I have sympy-0.7.6.win32.

 --
 You received this message because you are subscribed to the Google Groups
 sympy group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sympy+unsubscr...@googlegroups.com.
 To post to this group, send email to sympy@googlegroups.com.
 Visit this group at http://groups.google.com/group/sympy.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/sympy/f0619d17-cdc0-47dd-858c-6a6415d212d3%40googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JLdNQZjY0d6dXjFA7Yf9kg1pnj02hBp_LctipuLH_6Uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Bug with solve

2015-05-19 Thread Arnaud Usciati
Hello,

I tried to find the roots of : 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 - 
x**2 + x*sqrt(x**3 - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1) 
- 3*x**2.5 - 4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 
3*x**5.5 - 1 = 0.

x = symbols('x', real=True)
f = Lambda(x, 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 - x**2 + x*sqrt(x**3 
- x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1) - 3*x**2.5 - 
4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 3*x**5.5 - 1)

Input : solve(f(x), x)
Output : [0.149910458676117, 0.865324593883105, 1.00, 
1.24896947842683, 2.56371129870321, 3.02429035798029]

But only 0.149910458676117 and 1 are really roots :
f(0.865324593883105) = 0.735269457206734
f(1.24896947842683) = -4.09736628717860
f(2.56371129870321) = -509.709822051607
f(3.02429035798029) = -1361.51149028959

Arnaud,

Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 
bit (Intel)] on win32

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/ece1f69e-919b-4bde-ab31-9213adf06c35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Bug with solve

2015-05-19 Thread Arnaud Usciati
Hi,

I have : Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC 
v.1600 32 bit (Intel)] on win32

Le mardi 19 mai 2015 18:25:33 UTC+2, Aaron Meurer a écrit :

 What version of SymPy is this? On master I get 

 In [1]: x = symbols('x', real=True) 

 In [2]: f = Lambda(x, 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 - x**2 
 + x*sqrt(x**3 - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1) 
 - 3*x**2.5 - 4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 
 3*x**5.5 - 1) 

 In [3]:  solve(f(x), x) 
 Out[3]: [0.149910458676117, 1.0] 

 (note that it takes a while) 

 Aaron Meurer 


 On Tue, May 19, 2015 at 6:29 AM, Arnaud Usciati rai...@gmail.com 
 javascript: wrote: 
  Hello, 
  
  I tried to find the roots of : 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 
 - 
  x**2 + x*sqrt(x**3 - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 
 1) - 
  3*x**2.5 - 4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 
 3*x**5.5 - 
  1 = 0. 
  
  x = symbols('x', real=True) 
  f = Lambda(x, 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 - x**2 + 
 x*sqrt(x**3 
  - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1) - 3*x**2.5 - 
  4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 3*x**5.5 - 1) 
  
  Input : solve(f(x), x) 
  Output : [0.149910458676117, 0.865324593883105, 1.00, 
  1.24896947842683, 2.56371129870321, 3.02429035798029] 
  
  But only 0.149910458676117 and 1 are really roots : 
  f(0.865324593883105) = 0.735269457206734 
  f(1.24896947842683) = -4.09736628717860 
  f(2.56371129870321) = -509.709822051607 
  f(3.02429035798029) = -1361.51149028959 
  
  Arnaud, 
  
  Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 
 bit 
  (Intel)] on win32 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  sympy group. 
  To unsubscribe from this group and stop receiving emails from it, send 
 an 
  email to sympy+un...@googlegroups.com javascript:. 
  To post to this group, send email to sy...@googlegroups.com 
 javascript:. 
  Visit this group at http://groups.google.com/group/sympy. 
  To view this discussion on the web visit 
  
 https://groups.google.com/d/msgid/sympy/ece1f69e-919b-4bde-ab31-9213adf06c35%40googlegroups.com.
  

  For more options, visit https://groups.google.com/d/optout. 


-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/b0503758-e6c6-4152-8bc4-c594526d4908%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Bug with solve

2015-05-19 Thread Denis Akhiyarov
You gave Python version not sympy.__version__

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/d05d4cdb-11d4-4474-8543-a76bcf4e0018%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Bug with solve

2015-05-19 Thread Arnaud Usciati
Right,

I have sympy-0.7.6.win32.

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/f0619d17-cdc0-47dd-858c-6a6415d212d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Bug with solve

2015-05-19 Thread Aaron Meurer
What version of SymPy is this? On master I get

In [1]: x = symbols('x', real=True)

In [2]: f = Lambda(x, 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 - x**2
+ x*sqrt(x**3 - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1)
- 3*x**2.5 - 4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 -
3*x**5.5 - 1)

In [3]:  solve(f(x), x)
Out[3]: [0.149910458676117, 1.0]

(note that it takes a while)

Aaron Meurer


On Tue, May 19, 2015 at 6:29 AM, Arnaud Usciati rait...@gmail.com wrote:
 Hello,

 I tried to find the roots of : 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 -
 x**2 + x*sqrt(x**3 - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1) -
 3*x**2.5 - 4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 3*x**5.5 -
 1 = 0.

 x = symbols('x', real=True)
 f = Lambda(x, 2*sqrt(x)*sqrt(x**3 - x**2 + 1) + 2*x**3 - x**2 + x*sqrt(x**3
 - x**2 + 1) + 2*x**1.5 + 2*x**2.5*sqrt(x**3 - x**2 + 1) - 3*x**2.5 -
 4*x**3.5*sqrt(x**3 - x**2 + 1) - 2*x**3.5 + 5*x**4.5 - 3*x**5.5 - 1)

 Input : solve(f(x), x)
 Output : [0.149910458676117, 0.865324593883105, 1.00,
 1.24896947842683, 2.56371129870321, 3.02429035798029]

 But only 0.149910458676117 and 1 are really roots :
 f(0.865324593883105) = 0.735269457206734
 f(1.24896947842683) = -4.09736628717860
 f(2.56371129870321) = -509.709822051607
 f(3.02429035798029) = -1361.51149028959

 Arnaud,

 Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit
 (Intel)] on win32

 --
 You received this message because you are subscribed to the Google Groups
 sympy group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sympy+unsubscr...@googlegroups.com.
 To post to this group, send email to sympy@googlegroups.com.
 Visit this group at http://groups.google.com/group/sympy.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/sympy/ece1f69e-919b-4bde-ab31-9213adf06c35%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6K924%2BxJm25isfUaA%2BxhtH%3DdBcDyK5esyJKYEapK1siJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[sympy] Bug in solve including commutative and non-commutative symbols

2015-04-23 Thread j . gonthier01
The simplest example I could think if is:

 a = symbols('a',commutative=True)
 c = symbols('c', commutative=False)
 solve(a-c,a)
[]

which returns an empty list. If both symbols have commutative=True or both 
have commutative=False, the correct solution [c] is returned.

Is there anything I am doing wrong here ?

-- 
You received this message because you are subscribed to the Google Groups 
sympy group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/a7d9e447-d259-440d-a6b0-cc7bb6626429%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.