Re: [sympy] solve(...) and roots(...)

2014-06-30 Thread Vinzent Steinberg
On Friday, June 27, 2014 4:03:27 AM UTC-4, Camille Chambon wrote: Hello Chris, Thanks a lot for your answer! It's very interesting. By now I just need the bisection method: nsolve(eq,c2,(1,1000),solver='bisect'). But I will keep in mind the continuation method for the future. Cheers,

Re: [sympy] solve(...) and roots(...)

2014-06-27 Thread Camille Chambon
Hello Chris, Thanks a lot for your answer! It's very interesting. By now I just need the bisection method: nsolve(eq,c2,(1,1000),solver='bisect'). But I will keep in mind the continuation method for the future. Cheers, Camille Le jeudi 26 juin 2014 18:36:58 UTC+2, Chris Smith a écrit : Above

Re: [sympy] solve(...) and roots(...)

2014-06-26 Thread Chris Smith
Above 0, the function is monotonic but is ill-behaved in that it is very flat; this can cause troubles for different solver routines. A slow but robust method is bisection nsolve(eq,c2,(1,1000),solver='bisect') mpf('22.964256014441664') Using that, you don't need a very precise range for the

Re: [sympy] solve(...) and roots(...)

2014-06-24 Thread Camille Chambon
I want to find the root for various given coefficients. My parameters are fixed. Isn't there any other solution than trying different starting points in an interval and merge the results? I thought that if the function was bijective and monotonic, I wouldn't need to set a starting point,

Re: [sympy] solve(...) and roots(...)

2014-06-23 Thread Camille Chambon
Hello Vinzent, It's exactly what I was looking for. Thanks! How do you choose the starting point? The coefficients (0.66, 0.34 and 0.7) may vary. Is there a way to choose the right starting point automatically? Cheers, Camille P.S. scipy.optimize.root works too, but with a starting point of

Re: [sympy] solve(...) and roots(...)

2014-06-23 Thread Vinzent Steinberg
On Monday, June 23, 2014 3:55:51 AM UTC-4, Camille Chambon wrote: Hello Vinzent, It's exactly what I was looking for. Thanks! How do you choose the starting point? The coefficients (0.66, 0.34 and 0.7) may vary. Is there a way to choose the right starting point automatically? I'm not

Re: [sympy] solve(...) and roots(...)

2014-06-20 Thread Vinzent Steinberg
On Tuesday, June 17, 2014 4:01:05 AM UTC-4, Camille Chambon wrote: Hello Christophe, Thanks for your answer. OK. So if my equation is not solvable symbolically, I can't use SymPy? Then I will use a numeric solver, like SciPy. Have a look at `nsolve`, it solves equations numerically given

Re: [sympy] solve(...) and roots(...)

2014-06-17 Thread Christophe Bal
Hello. Does your equation solvable symbolically ? At a first glance, I don't think. C. 2014-06-16 10:39 GMT+02:00 Camille Chambon camille.cham...@gmail.com: Hello, I would like to find c2 as 0.66 + 0.34 * (1 + 1.0 / c2) - 1.0 / ln(1 + c2) - 0.7 == 0 Thus I used the function solve

Re: [sympy] solve(...) and roots(...)

2014-06-17 Thread Camille Chambon
Hello Christophe, Thanks for your answer. OK. So if my equation is not solvable symbolically, I can't use SymPy? Then I will use a numeric solver, like SciPy. And what does mean PolynomialError: 1/log(c2 + 1) contains an element of the generators set when using the function roots ? Cheers,

[sympy] solve(...) and roots(...)

2014-06-16 Thread Camille Chambon
Hello, I would like to find c2 as 0.66 + 0.34 * (1 + 1.0 / c2) - 1.0 / ln(1 + c2) - 0.7 == 0 Thus I used the function solve like so: c2 = Symbol('c2') solve(0.66 + 0.34 * (1 + 1.0 / c2) - 1.0 / ln(1 + c2) - 0.7, c2) But I got the following error: NotImplementedError