Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Fichiers Sage

Project: Enseignement
Views: 431
var('x, y') f(x,y) = x^2+x*y+y^2+y show(f)
(x, y)
(x,y)  x2+xy+y2+y\displaystyle \left( x, y \right) \ {\mapsto} \ x^{2} + x y + y^{2} + y
%md # Recherche des points critiques et des valeurs extrêmes

Recherche des points critiques et des valeurs extrêmes

gradf = f.gradient() show(gradf)
(x,y)  (2x+y,x+2y+1)\displaystyle \left( x, y \right) \ {\mapsto} \ \left(2 \, x + y,\,x + 2 \, y + 1\right)
eq1 = gradf[0](x,y) == 0 eq2 = gradf[1](x,y) == 0 show(eq1) show(eq2)
2x+y=0\displaystyle 2 \, x + y = 0
x+2y+1=0\displaystyle x + 2 \, y + 1 = 0
solve([eq1, eq2], (x,y))
[[x == (1/3), y == (-2/3)]]
hessf = f.hessian() show(hessf)
((x,y)  2(x,y)  1(x,y)  1(x,y)  2)\displaystyle \left(\begin{array}{rr} \left( x, y \right) \ {\mapsto} \ 2 & \left( x, y \right) \ {\mapsto} \ 1 \\ \left( x, y \right) \ {\mapsto} \ 1 & \left( x, y \right) \ {\mapsto} \ 2 \end{array}\right)
%md # Graphique

Graphique

r = 2 G = plot3d(f(x,y), (x, -r, r), (y, -r, r), plot_points=15, color='orange', mesh=1, opacity=.7) G += points((1/3, -2/3), color='red', pointsize=10) show(G)
3D rendering not yet implemented
show(G, aspect_ratio=[3, 3, 1])
3D rendering not yet implemented