next up previous contents index
Next: CriticalPoint[expr, aVariable] Up: Vector Differentiation Previous: DirectionalD[expr, aVariable, h]   Contents   Index

Grad[expr, aVariable]

Aliases: Grad, NEVER USE Gradient
Description: $ Grad[expr, aVariable]$ takes the gradient of expression $ expr$ with respect to the variable $ aVariable$. Quite useful for computations with quadratic Hamiltonians in $ H^\infty $ control. BEWARE Gradient calls the Mma gradient and makes a mess.
Arguments: $ expr$ is an expression containing $ var$. $ aVariable$ is a variable.
Comments / Limitations: This only works reliably for quadratic expressions. It is not even correct on all of these. For example, $ Grad[a**x+a**tp[x],x]$ returns $ 2 tp[a]$. The reason is fundamental mathematics, not programming. If $ a$ is a row vector and $ x$ is a column vector, then $ a**x$ is a number, but $ a**tp[x]$ is not.



NCAlgebra Project 2002-09-09