<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Dear Roy,<DIV>I just tried to verify and I can use imported ampl functions with bonmin on my machine without problem. </DIV><DIV>Please submit a ticket with as precise a description as you can do so that we can try to reproduce it. Please also include the model file so that you are using.</DIV><DIV>Best regards,</DIV><DIV>Pierre<BR><DIV><DIV>On Mar 3, 2007, at 7:56 PM, Roy Chen wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV>Dear Andreas</DIV> <DIV>I tried function ginv() with bonmin, which is an example in funcadd.c. The followings are two experiments I did:</DIV> <DIV><FONT color="#3333ff">Experiment 1:</FONT></DIV> <DIV><FONT color="#ff0000">ampl: function ginv(Reals);<BR>ampl: display {i in -3...3} ginv(i);<BR>ginv(i) [*] :=<BR>-3  -0.333333<BR>-2  -0.5<BR>-1  -1<BR> 0   0<BR>;<BR></FONT><FONT color="#3333ff">Experiment 2:</FONT></DIV> <DIV><FONT color="#ff6600">ampl: reset;<BR>ampl: function ginv(Reals);<BR>ampl: var x;<BR>ampl: minimize Z:x*x+x+1+ginv(x);<BR>ampl: subject to cons:x&gt;=0.8;<BR>ampl: option solver bonmin;<BR>ampl: solve;<BR>bonmin: <BR> Cannot load library /home/chen11q/AMPL_Learning/ampl_external_function/ASL/solvers/funclink/amplfunc.dll:<BR>/home/chen11q/AMPL_Learning/ampl_external_function/ASL/solvers/funclink/amplfunc.dll: cannot open shared object file: No such file or directory <BR>function ginv not available<BR>user-defined function not available<BR>exit code 255<BR>&lt;BREAK&gt;</FONT></DIV> <DIV><FONT color="#ff6600"><FONT color="#000000">What I do not quite understand is: as you said in this example, the first and second derivatives of the function ginv() has been defined properly in C code, then why couldn't gin()still be used with Bonmin in AMPL? I am just trying to run this small example to make sure that once I can successfully write the first and second derivative of the external function, it will work properly with Bonmin as the solver in ampl. </FONT></FONT></DIV> <DIV> </DIV> <DIV><FONT color="#ff6600"><FONT color="#000000">Thanks a lot for your time.</FONT></FONT></DIV><SPAN class="sg"> <DIV> </DIV> <DIV><FONT color="#ff6600"><FONT color="#000000">Roy</FONT></FONT></DIV></SPAN><BR><BR> <DIV><SPAN class="gmail_quote">On 3/2/07, <B class="gmail_sendername">Roy Chen</B> &lt;<A href="mailto:ytboy0208@gmail.com">ytboy0208@gmail.com</A>&gt; wrote:</SPAN> <BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <DIV>Hello, Andreas</DIV> <DIV>I appreciate your timely and helpful response very much.</DIV> <DIV>I am kind of confused with the situation now because of the following reasons:</DIV> <DIV>The way I need to define one of those integral functions in my problem is like this:</DIV> <DIV>Integral(var1,var2,var3), assume I need these three inputs to do the calculation.</DIV> <DIV>In my ampl .mod file, I used this function like this:</DIV> <DIV><FONT color="#ff0000">set k;</FONT></DIV> <DIV><FONT color="#ff0000">sum{s in k} Integral(x[s],y[s],z[s])<FONT color="#000000"> + .....; # x[s] is decision variable, y[s] and z[s] are parameters defined in .dat file.</FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">The coded Integral() function will give you the value give those three inputs.</FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">My question is:</FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">What are first and second order direvatives for in AMPL modeling? </FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">What kind of format you code the first and second order direvatives for Bonmin? </FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">How Bonmin can know and use the first and second orfer direvatives coded in AMPL external function?</FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">Again, if there could be a small example to illustrate this idea, that's will be better, I think.</FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">Very appreciate your time.</FONT></FONT></DIV> <DIV><FONT color="#ff0000"><FONT color="#000000">Best</FONT></FONT></DIV><SPAN class="sg"> <DIV><FONT color="#ff0000"><FONT color="#000000">Roy</FONT></FONT></DIV> <DIV><BR><BR> </DIV></SPAN> <DIV><SPAN class="q"><SPAN class="gmail_quote">On 3/2/07, <B class="gmail_sendername">Andreas Waechter</B> &lt;<A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:andreasw@watson.ibm.com" target="_blank"> andreasw@watson.ibm.com</A>&gt; wrote:</SPAN> </SPAN> <DIV><SPAN class="e" id="q_111157a60e785a42_4"> <BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Roy,<BR><BR>&gt; Could you actually provide one example which uses automatic differentiation<BR>&gt; to give the first and second direvatives with ampl external function? <BR><BR>I'm not sure, part of the code was not written by me and I'm not sure if I<BR>can give it away.<BR><BR>&gt; Another question coming into my mind is:<BR>&gt; Does that mean I don't need code to calculate the value of the integration <BR>&gt; function, instead, I just need to code to calculate the first and second<BR>&gt; direvatives?<BR><BR>No, we still also need the values.<BR><BR>However, if your function (including the integral) is such that the first <BR>derivative is some analytic function without the integral, you could just<BR>code the first derivatives using that analytic expression, from which you<BR>could also easily the second derivative (as the first derivative of that <BR>other function).<BR><BR>&gt; Again, if you can give me the example you mentioned in your email, I would<BR>&gt; appreciate it very much.<BR><BR>Given what I wrote in the last paragraph, let me know if you still want me <BR>to look for an example with ADOL-C.<BR><BR>Cheers,<BR><BR>Andreas<BR></BLOCKQUOTE></SPAN></DIV></DIV><BR></BLOCKQUOTE></DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Bonmin mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Bonmin@list.coin-or.org">Bonmin@list.coin-or.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://list.coin-or.org/mailman/listinfo/bonmin">http://list.coin-or.org/mailman/listinfo/bonmin</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>