Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

evaluation of hessian in some point

hi this code works very well but i can not manage to make Sagemaths evaluate the matrix H in the critical points : this is the two lines with f

from sage.manifolds.operators import *
E.<x,y> = EuclideanSpace()
f(x,y)=exp(-y^2)+x^4-x^2
F = E.scalar_field(f)
show("3) f",f)
show("grad f=",grad(F)[:])
H=f(x,y).hessian()
show("H=",H)
Cr= solve([grad(f)[0]==0,grad(f)[1]==0],[x,y])
show("points critiques : ",Cr)

#for critique in Cr:
#    show(H(critique))#marche pas je comprend pas pourquoi
show("on voit les deux points-col et le max")
h(x,y,z)=f(x,y)-z
implicit_plot3d(h, (x, -4,4), (y, -4, 4), (z, -0.5, 5),color="blue",adaptive=True,mesh=True)