Created
July 5, 2011 20:47
-
-
Save kmels/1065881 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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