jacobian not listed



On 5/31/07, Wolfgang Lindner <LindnerW at t-online.de> wrote:
>
> Q2: Is there any advantage in coding hessian in lisp than in maxima?


Not really, since most of the time will be spent in diff and unless the
expressions are very large, this will be pretty fast anyway.  On the other
hand, the algorithm could be improved so that it doesn't perform 2*n^2
diff's, something like this:

hessian(e, vars) :=
   block( [row],
             row: makelist(diff(e,var),var,vars),
             funmake('matrix, makelist( diff( row, var), var, vars) ) ) $

This performs n+n^2 diffs.

What's more, Maxima assumes that differentiation by different variables
commutes (which is in principle not true, but in practice I believe it is),
so the matrix is symmetric. Taking advantage of that makes Hessian require
only 3/2*n+n^2/2 diffs, almost 4 times as fast as the original method -- if
that matters. Coding that is left as an exercise for the reader.

After those improvements are made, then, and only then, might it be
worthwhile to recode in Lisp (but even then, probably not...).

             -s