On 12/20/2010 10:03 PM, C Barrington-Leigh wrote:
I cannot figure out what I'm doing wrong. The following does not
return a fixed point:

What did it do? For nearly all such questions, cut and paste actual output or traceback.

from scipy import optimize
xxroot= optimize.fixed_point(lambda xx: exp(-2.0*xx)/2.0, 1.0,
args=(), xtol=1e-12, maxiter=500)
print ' %f solves fixed point, ie f(%f)=%f ?'%
(xxroot,xxroot,exp(-2.0*xxroot)/2.0)

from math import exp
x = 1.0
for i in range(70):
    print(repr(x))
    x = exp(-2.0*x)/2.0

converges to 0.2835716452048919

Did you cut and paste what you actually ran?

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to