I have to calculate the gradient and hessian of functions with a lot of paramteres and therefore I started using Mathematica. Calculating the gradient works fine, but Mathematica won't calculate the hessian, it just displays Hessian[function[...]] as output.
What am I doing wrong?
In[18]:= L[P[1],Q[1],V[1]]=a[1]+b[1]*P[1]+c[1]*P[1]^2+l[11]*(P[1]-V[1]*(V[5]*(G[15]*Cos[t[1]-t[5]]+B[15]*Sin[t[1]-t[5]])+V[1]*G[11]))+l[12]*(Q[1]-V[1]*(V[5]*(G[15]*Sin[t[1]-t[2]]-B[15]*Cos[t[1]-t[2]])-V[1]*B[11]))+z[11]*(0.9-V[1])+z[12]*(V[1]-1.1)
Grad[L[P[1],Q[1],V[1]],{P[1],Q[1],V[1]}]
Hessian[L[P[1],Q[1],V[1]],{P[1],Q[1],V[1]}]
Jacobian[{b[1] + l[11] + 2*c[1]*P[1], l[12],
l[12]*(2*B[11]*V[1] - ((-B[15])*Cos[t[1] - t[2]] + G[15]*Sin[t[1] - t[2]])*
V[5]) + l[11]*(-2*G[11]*V[1] - (Cos[t[1] - t[5]]*G[15] +
B[15]*Sin[t[1] - t[5]])*V[5]) - z[11] + z[12]},{P[1],Q[1],V[1]}]
Out[18]= a[1]+b[1] P[1]+c[1] P[1]^2+l[12] (Q[1]-V[1] (-B[11] V[1]+(-B[15] Cos[t[1]-t[2]]+G[15] Sin[t[1]-t[2]]) V[5]))+l[11] (P[1]-V[1] (G[11] V[1]+(Cos[t[1]-t[5]] G[15]+B[15] Sin[t[1]-t[5]]) V[5]))+(0.9-V[1]) z[11]+(-1.1+V[1]) z[12]
Out[19]= {b[1]+l[11]+2 c[1] P[1],l[12],l[12] (2 B[11] V[1]-(-B[15] Cos[t[1]-t[2]]+G[15] Sin[t[1]-t[2]]) V[5])+l[11] (-2 G[11] V[1]-(Cos[t[1]-t[5]] G[15]+B[15] Sin[t[1]-t[5]]) V[5])-z[11]+z[12]}
Out[20]= Hessian[a[1]+b[1] P[1]+c[1] P[1]^2+l[12] (Q[1]-V[1] (-B[11] V[1]+(-B[15] Cos[t[1]-t[2]]+G[15] Sin[t[1]-t[2]]) V[5]))+l[11] (P[1]-V[1] (G[11] V[1]+(Cos[t[1]-t[5]] G[15]+B[15] Sin[t[1]-t[5]]) V[5]))+(0.9-V[1]) z[11]+(-1.1+V[1]) z[12],{P[1],Q[1],V[1]}]
Out[21]= Jacobian[{b[1]+l[11]+2 c[1] P[1],l[12],l[12] (2 B[11] V[1]-(-B[15] Cos[t[1]-t[2]]+G[15] Sin[t[1]-t[2]]) V[5])+l[11] (-2 G[11] V[1]-(Cos[t[1]-t[5]] G[15]+B[15] Sin[t[1]-t[5]]) V[5])-z[11]+z[12]},{P[1],Q[1],V[1]}]