solveset should be able to solve equations like this. If it can't,
please open an issue for it. For me it works just fine for
solveset(Eq((1-(x**2))**(S(1)/2), S(1)/2), x). It does have problems
with the general symbolic solveset(Eq((1-(x**n))**(S(1)/n), y), x)
because of domain and assumptions issues.
>>> solveset(Eq((1-x**n)**(1/n), y), x)
ConditionSet(x, Eq(-y + (1 - x**n)**(1/n), 0), Complexes(Reals x Reals, False))
>>> solveset(Eq((1-x**n)**(1/n), y), x, Reals)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "./sympy/solvers/solveset.py", line 1696, in solveset
return solveset(f.xreplace({symbol: r}), r, domain
File "./sympy/solvers/solveset.py", line 1714, in solveset
return _solveset(f, symbol, domain, _check=True)
File "./sympy/solvers/solveset.py", line 916, in _solveset
result = solver(Add(f.lhs, - f.rhs, evaluate=False), symbol, domain)
File "./sympy/solvers/solveset.py", line 883, in <lambda>
solver = lambda f, x, domain=domain: _solveset(f, x, domain)
File "./sympy/solvers/solveset.py", line 931, in _solveset
lhs, rhs_s = inverter(f, 0, symbol)
File "./sympy/solvers/solveset.py", line 884, in <lambda>
inverter = lambda f, rhs, symbol: _invert(f, rhs, symbol, domain)
File "./sympy/solvers/solveset.py", line 156, in _invert
x1, s = _invert_real(f_x, FiniteSet(y), x)
File "./sympy/solvers/solveset.py", line 202, in _invert_real
return _invert_real(h, imageset(Lambda(n, n - g), g_ys), symbol)
File "./sympy/solvers/solveset.py", line 237, in _invert_real
raise ValueError("x**w where w is irrational is not "
ValueError: x**w where w is irrational is not defined for negative x
>>> solve(Eq((1-x**n)**(1/n), y), x)
[(1 - y**n)**(1/n)]
I don't know if this can be improved.
Aaron Meurer
On Fri, Mar 8, 2019 at 11:16 AM Stuart Reynolds
<[email protected]> wrote:
>
> Ahh -- thank you. I was using solveset. Should have used solve.
>
> On Fri, Mar 8, 2019 at 9:57 AM Oscar Benjamin <[email protected]>
> wrote:
>>
>> On Fri, 8 Mar 2019 at 17:25, Stuart Reynolds <[email protected]>
>> wrote:
>> >
>> > Dear Sympy users,
>> >
>> > I'm new to sympy and interested in using it for function design.
>> > I'm curious about what types of things I should be able to expected
>> > sympy.solve to solve. In particular, trying to solve:
>> > (1. - (x ** 2)) ** (1. / 2) = 1/2
>> > seems to fail for me:
>>
>> You can solve it like this using rational or floats:
>>
>> In [9]: solve(Eq((1-(x**2))**(S(1)/2), S(1)/2), x)
>>
>> Out[9]:
>>
>> ⎡-√3 √3⎤
>>
>> ⎢────, ──⎥
>>
>> ⎣ 2 2 ⎦
>>
>>
>> In [10]: solve(Eq((1.0-(x**2))**0.5, 0.5), x)
>>
>> Out[10]: [-0.866025403784439, 0.866025403784439]
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/sympy.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/CAHVvXxQv3OQVtaFRMT44v4qWUoxgq35dL0jFSi_NTpfg9O5YPw%40mail.gmail.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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAAy-kdkVyuvWiUt1ArXpZhJPDtWn4hswdC6wXfpGn--fwVRNfw%40mail.gmail.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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/CAKgW%3D6KAEgh53QctXZaWjKMFhgf97hQro%2BoJARCOHreGew%3DimQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.