Skip to content

Instantly share code, notes, and snippets.

@kmels
Created July 5, 2011 20:47
Show Gist options
  • Save kmels/1065881 to your computer and use it in GitHub Desktop.
Save kmels/1065881 to your computer and use it in GitHub Desktop.
#Punto fijo, que avisa si la sucesion de numeros dada la ecuacion de recurrencia G(x) no es una contraccion, i.e. si | G'(x) | >= 1. Hay que mandarle la derivada de G(x), i.e. G_ en el parametro
def PuntoFijoAPruebaDeMuladas(G,G_,x0,e):
if abs(G_(x0)) >= 1:
print "Esta funcion G(x) esta tricky, la derivada evaluada en x=",x, " es mayor que 1, por lo que se podria salir de la recta f(x)=x y no converger"
else:
print "x_i: " , x0, " G(x_i): ", G(x0)
x0 = G(x0)
return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment