Ask Your Question

# Specifying variables to be included in Hessian calculation

I want to calculate the Hessian of a function that has 5 variables and 6 parameters. I do not want the derivatives taken by the parameters.

Is there a way to separately define parameters and variables in sage?

Alternatively, is there a way to make the Hessian function only use some variables for derivation?

edit retag close merge delete

## 1 answer

Sort by ยป oldest newest most voted

You can try something like this (with x and y as variables and z as parameter):

sage: var('x y z')
(x, y, z)
sage: f(x,y) = x*y*z

sage: f.arguments()
(x, y)
sage: f.variables()
(x, y, z)

sage: f.hessian()
[(x, y) |--> 0 (x, y) |--> z]
[(x, y) |--> z (x, y) |--> 0]

more

## Comments

Thank you. That's exactly what I was looking for.

( 2014-08-13 08:46:25 -0500 )edit

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2014-08-11 07:58:23 -0500

Seen: 261 times

Last updated: Aug 11 '14