Files
anum/Chapitre1-PointFixe.ipynb
2025-08-18 12:04:55 +02:00

32 KiB

In [1]:
import numpy as np
import matplotlib.pyplot as plt
In [7]:
def f(x):
    return (x**2 * np.e**x + 1)/(x * np.e**x + np.e**x)
In [8]:
def pointfixe(x,f,k=50):
    for _ in range(0,k):
        x = f(x)
    return x
In [16]:
xfs = np.arange(0,1.5,0.01)
yfs = np.array(f(xfs))
xs = np.arange(0,1.5,0.01)
x = pointfixe(1,f,1000)
plt.plot(xfs,yfs,'r')
plt.plot(xs,xs,'g')
plt.plot(x,x,'.b')
Out[16]:
[<matplotlib.lines.Line2D at 0x263c0492290>]
No description has been provided for this image
In [ ]: