The number p is a fixed point of the function f iff f(p)=p.
Existence and uniqueness
If g∈C[a,b] and g(x)∈[a,b]∀x∈[a,b], then g has
at least one fixed point in [a,b].
If in addition, g′(x) exists on (a,b) and
∃k ∈(0,1) such that:
g′(x)≤k∀x∈(a,b)
Then g has a unique fixed point in (a,b).
Iteration algorithm
Start with p0 (arbitrary point). Iterate using pn+1=g(pn) until
convergence. Convergence is guaranteed if the fixed point exists and is
unique.
Implementation
def fixed_point(g, p0, tolerance=1e-6, max_iteration_count=100):
for _ in range(max_iteration_count):
if abs(p_new - p) < tolerance:
raise ValueError("Fixed point not found")
Fixed point theorem
If:
- g∈C[a,b]
- ∀x∈[a,b],g(x)∈[a,b]
- g′ exists on (a,b)
- ∃k∈(0,1) and
g′(x)≤k∀x∈(a,b)
Then both equations mentioned below hold:
pn−p≤knmax{p0−a,b−p0}
∣pn−p∣≤1−kkn∣p1−p0∣