SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Ponto Fixo
Deus não se preocupe das nossas dificuldades matemáticas.
Ele integra empiricamente.
Einstein.
< Posição Falsa | Implementação | Atividades #1.3 >

Implementação

Python Listing: ../Fixed_Point.py.
def Fixed_Point(f,phi,x0,eps=1.0E-6,maxiteration=100):
    #List of x-values
    
    xk=x0
    xs=[xk]
    
    stop=False
    iteration=0
    while (not stop):
        xk1=phi(xk)
        
        if ( abs(f(xk1))<eps   ): stop=True
        if ( abs(xk1-xk)<eps   ): stop=True
        if ( iteration>maxiteration ): stop=True
        
        xk=xk1
        xs.append(xk)
        iteration+=1

    return xs
< Posição Falsa | Implementação | Atividades #1.3 >
Messages:
0 secs.