[SciPy-Dev] Comments on optimize.newton function

josef.pktd at gmail.com josef.pktd at gmail.com
Sun May 22 16:50:42 EDT 2011


On Sun, May 22, 2011 at 4:24 PM, Gökhan Sever <gokhansever at gmail.com> wrote:
> On Sun, May 22, 2011 at 11:12 AM,  <josef.pktd at gmail.com> wrote:
>> I proposed taking logs of left hand side and right hand side
>> separately, since you are just looking for a zero,
>> with myfunc.log(),  it is not simplified
>
> OK, I have gotten this right this time:
>
> myfunc =  rh - exp(kelvin/x) * (x**3 - rd**3) / (x**3 - rd**3 * (1.0 - kappa))
> myfunc2 = log(myfunc) = log(rh) - (kelvin/x) + log(x**3 - rd**3) -
> log(x**3 - rd**3*(1.0 - kappa))
>
> myfunc2_prime = -3*x**2/(rd**3 - x**3) - 3*x**2/((kappa - 1.0)*rd**3 +
> x**3) + kelvin/x**2
>
> How can I proceed this point onwards?

try newton with fprime. My initial suggestion was in response to your
statement that newton with fprime is too slow because the expression
for the derivative is too complicated and slow.

Trying to get the function in a nicer form might help quite a bit, but
it won't be a solution if you have a large set of functions that might
show up in different simulations.

It's just an aside for the main topic of the thread, improving the solvers.

Josef

>
>
>>
>> (I don't have a quick way to do the symbolic derivative, but there
>> shouldn'd be any exp left in the expression)
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>



More information about the SciPy-Dev mailing list