[SciPy-Dev] Comments on optimize.newton function

Gökhan Sever gokhansever at gmail.com
Sun May 22 17:21:08 EDT 2011


On Sun, May 22, 2011 at 2:51 PM, Charles R Harris
<charlesr.harris at gmail.com> wrote:
> I think the zeros of this function can be bracketed by inspection. What sort
> of values do rd, rh, and kappa have? What is kelvin?

This is the original function:

cpdef double petters_solve_for_rw(double x, double rd, double rh):
    return rh - exp(kelvin/x) * (x**3 - rd**3) / (x**3 - rd**3 * (1.0 - kappa))

"kelvin" is a constant: 1.04962912337e-09 and stays constant
throughout all of the simulations.

"kappa" is a constant, but its value set before the simulation.
Default is 1, but can range from 0.001 to 2 depend on the simulation

"rd" is initialized differently. For one simulation about 20k element
rd array created --this number changes depends on the simulation
--solving a set of five ODE equations. For one case:

I[3]: rd.min()
O[3]: 1.1926858018899999e-08

I[4]: rd.max()
O[4]: 1.3455000000000001e-06

"rh" is the relative humidity. Starts at rh=0.95, and evolves like
"rd" within the simulation, and differs from simulation to simulation
depends on the initial conditions.

I[9]: rh.max()
O[9]: 1.0050122345200001

I[10]: rh.min()
O[10]: 0.95017287164200004

With these numbers, I still think it is hard to bracket this function
within which a root is searched.



More information about the SciPy-Dev mailing list