| Hosted by CoCalc | Download

Exemple

- Trouver et classifier les points critiques de f(x,y)=x4+y44xy+1f(x,y) = x^4 +y^4-4xy+1

- Maximiser et minimiser ff sur [0,3]×[0,2][0,3]\times [0,2].

var('x,y') f(x,y) = x^4+y^4-4*x*y+1 C= contour_plot(f, (x,-3,3), (y,-3, 3),cmap='hot',contours = 20,linestyles='solid', fill=False, colorbar=True) show(C)
(x\displaystyle x, y\displaystyle y)
df = f.gradient() df(x,y)
f.hessian()(x,y)
(12x24412y2)\displaystyle \left(\begin{array}{rr} 12 \, x^{2} & -4 \\ -4 & 12 \, y^{2} \end{array}\right)
P1 = (1,1) B1 = (3,0) B2=(3,3^(1/3)) B3 = (3,2) B4=(2^(1/3),2) B5 = (0,2) B6 = (0,0) ListePoints = [P1,B1,B2,B3,B4,B5,B6] ListePoints [f(P[0],P[1]) for P in ListePoints] # Les valeurs exactes [f(P[0],P[1]).n(digits = 4) for P in ListePoints] # Une aprox décimale
[(1\displaystyle 1, 1\displaystyle 1), (3\displaystyle 3, 0\displaystyle 0), (3\displaystyle 3, 313\displaystyle 3^{\frac{1}{3}}), (3\displaystyle 3, 2\displaystyle 2), (213\displaystyle 2^{\frac{1}{3}}, 2\displaystyle 2), (0\displaystyle 0, 2\displaystyle 2), (0\displaystyle 0, 0\displaystyle 0)]
[1.000\displaystyle -1.000, 82.00\displaystyle 82.00, 69.02\displaystyle 69.02, 74.00\displaystyle 74.00, 9.440\displaystyle 9.440, 17.00\displaystyle 17.00, 1.000\displaystyle 1.000]
C1= contour_plot(f, (x,0,3), (y,0, 2),cmap='hot',contours = 20,linestyles='solid', fill=True, colorbar=True) C1.show()
cmsel = [colormaps['hot'](i) for i in sxrange(0,1,0.05)] S = plot3d(f(x,y),(x,0,3),(y,0,2), adaptive = True, color = cmsel) S.show(frame_aspect_ratio = [40,40,1])
3D rendering not yet implemented