Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You get a matrix of functions. Apply them :

sage: L.hessian()(x, y, λ)
[A*x^(α - 2)*y^β*(α - 1)*α A*x^(α - 1)*y^(β - 1)*α*β                      -p_x]
[A*x^(α - 1)*y^(β - 1)*α*β A*x^α*y^(β - 2)*(β - 1)*β                      -p_y]
[                     -p_x                      -p_y                         0]

HTH,

You get a matrix of functions. Apply them :

sage: L.hessian()(x, y, λ)
[A*x^(α - 2)*y^β*(α - 1)*α A*x^(α - 1)*y^(β - 1)*α*β                      -p_x]
[A*x^(α - 1)*y^(β - 1)*α*β A*x^α*y^(β - 2)*(β - 1)*β                      -p_y]
[                     -p_x                      -p_y                         0]

HTH,

EDIT : The peculiar Mathjax interpreter of this site does not typeset this correctly. LaTeX does (provided you replace the non-ASCII variable names wit their conventional replacement... or ui use XeLaTeX to typeset...).

You get a matrix of functions. Apply them :

sage: L.hessian()(x, y, λ)
[A*x^(α - 2)*y^β*(α - 1)*α A*x^(α - 1)*y^(β - 1)*α*β                      -p_x]
[A*x^(α - 1)*y^(β - 1)*α*β A*x^α*y^(β - 2)*(β - 1)*β                      -p_y]
[                     -p_x                      -p_y                         0]

HTH,

EDIT : The peculiar Mathjax interpreter of this site does not typeset this correctly. correctly (ignores the linebreaks). LaTeX does (provided you replace the non-ASCII variable names wit their conventional replacement... or ui use XeLaTeX to typeset...).typeset...). Trying HTML is no more successful (same problem).

You get a matrix of functions. Apply them :

sage: L.hessian()(x, y, λ)
[A*x^(α - 2)*y^β*(α - 1)*α A*x^(α - 1)*y^(β - 1)*α*β                      -p_x]
[A*x^(α - 1)*y^(β - 1)*α*β A*x^α*y^(β - 2)*(β - 1)*β                      -p_y]
[                     -p_x                      -p_y                         0]

HTH,

EDIT NOTE : The peculiar Mathjax interpreter of this site does not typeset this correctly (ignores the linebreaks). LaTeX does (provided you replace the non-ASCII variable names wit their conventional replacement... or ui use XeLaTeX to typeset...). Trying HTML is no more successful (same problem).

I have search for hessian? but there is no entry in the online documentation.

L.hessian? prints :

Docstring:     
   Compute the hessian of a function. This returns a matrix components
   are the 2nd partial derivatives of the original function.

   EXAMPLES:

      sage: x,y = var('x y')
      sage: f = x^2+y^2
      sage: f.hessian()
      [2 0]
      [0 2]
      sage: g(x,y) = x^2+y^2
      sage: g.hessian()
      [(x, y) |--> 2 (x, y) |--> 0]
      [(x, y) |--> 0 (x, y) |--> 2]
Init docstring: Initialize self.  See help(type(self)) for accurate signature.
File:           /usr/local/sage-10/src/sage/symbolic/expression.pyx
Type:           builtin_function_or_method

HTH,

You get a matrix of functions. functions :

sage: L.hessian().parent()
Full MatrixSpace of 3 by 3 dense matrices over Callable function ring with arguments (x, y, λ)

Apply them :

sage: L.hessian()(x, y, λ)
[A*x^(α - 2)*y^β*(α - 1)*α A*x^(α - 1)*y^(β - 1)*α*β                      -p_x]
[A*x^(α - 1)*y^(β - 1)*α*β A*x^α*y^(β - 2)*(β - 1)*β                      -p_y]
[                     -p_x                      -p_y                         0]

NOTE : The peculiar Mathjax interpreter of this site does not typeset this correctly (ignores the linebreaks). LaTeX does (provided you replace the non-ASCII variable names wit their conventional replacement... or ui you use XeLaTeX to typeset...). Trying HTML is no more successful (same problem).

I have search for hessian? but there is no entry in the online documentation.

L.hessian? prints :

Docstring:     
   Compute the hessian of a function. This returns a matrix components
   are the 2nd partial derivatives of the original function.

   EXAMPLES:

      sage: x,y = var('x y')
      sage: f = x^2+y^2
      sage: f.hessian()
      [2 0]
      [0 2]
      sage: g(x,y) = x^2+y^2
      sage: g.hessian()
      [(x, y) |--> 2 (x, y) |--> 0]
      [(x, y) |--> 0 (x, y) |--> 2]
Init docstring: Initialize self.  See help(type(self)) for accurate signature.
File:           /usr/local/sage-10/src/sage/symbolic/expression.pyx
Type:           builtin_function_or_method

HTH,