Hi Nikhil Nikhil Sarda wrote: > Sir, > I wanted to let you know that I have completed coding for a Hessian > Matrix calculator. It accepts input as a CString (written in c++) and > constructs the Hessian Matrix as a 2d array of strings.
That is very good news! This means that you have made progress on implementing symbolic second derivatives, which is a good thing, and will help us to judge your application. I'd like to see your code. Have you based it on other publicly-available code, or implemented from scratch? I think that probably what we need however is code for performing 'automatic differentiatiation' which is a bit different from symbolic diff. Autodiff works by starting off with an 'expression tree', then traversing it in such a way that the derivative of each term or factor is calculated and added to the result. It requires the use of a stack. The code in compiler/relation_util.c currently performs this operation. The following document outlines a method for performing autodiff to calculate second derivatives: http://ascendwiki.cheme.cmu.edu/images/c/c3/PhDthesisChungExactNumDiffChapt6.pdf I need to just mention that we need to use pure C for anything in the ASCEND compiler, for consistency with the other code that is already there. I think that we need to implement this autodiff method. I will forward you another message from Art and Ben that outlines some difficulties with implementing this, including (a) the current implementation of 'expressions' in ASCEND is difficult to use, (b) the current implementation of first derivatives in ASCEND uses 'forward' autodiff, but what we need is backward autodiff in order for it to work properly with second-order derivs. Both Art and I think that solving this problem and getting IPOPT working 100% with ASCEND is a high priority. Ben is of the view that this is a more difficult problem then we realise. It could be a very challenging project, and will require some pretty tough C language programming. Do you feel you can handle it? > However I am > having a tough time reading the code that you pointed me too, and the > documentation is not very comprehensive as well. Could you point me to > the data structure that holds the function of which you need the > Hessian calculated? This information will help me to complete my > application. > You're right that the code for the compiler is hard to read! Here are some links that might lead to some additional information that maybe you have not yet seen: http://ascend.cheme.cmu.edu/dox/index.html http://ascendwiki.cheme.cmu.edu/Developer%27s_Manual http://ascendwiki.cheme.cmu.edu/Media:Ascendimpl.pdf http://ascend.cheme.cmu.edu/ascend_bibliography.htm Cheers JP ------------------------------------------------------------------------------ _______________________________________________ Ascend-sim-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ascend-sim-users

