<div dir="ltr"><div> The difficulty is in programming. But here is an example.<br></div><div><br></div><div>Example objective function f:<br></div><div><br></div><div><span style="font-family:monospace,monospace">f(vector x) = g(vector x)h(vector x)</span></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace">where:<br></span></div><div><span style="font-family:monospace,monospace"> N N</span></div><div><span style="font-family:monospace,monospace">g(vector x) = Sum sum c_n c_m x_n</span></div><div><span style="font-family:monospace,monospace"> n=1 m=1</span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> N</span></span></div><div><span style="font-family:monospace,monospace">h(vetor x)<span style="font-family:monospace,monospace"> = <span style="font-family:monospace,monospace">Sum<span style="font-family:monospace,monospace"> c_n c_m x_n</span></span></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"> n=1</span></span></span></span></div><div><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><span style="font-family:monospace,monospace"><br></span></span></span></span></div><div>Gradient calculated by product rule:</div><div><br></div><div>f ' (x) = g ' (x) h(x) + g(x) + h' (x)</div><div><br></div><div>The function g(x) and h(x) are common between f and f '.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 27, 2018 at 1:59 PM Chintan Pathak <<a href="mailto:cp84@uw.edu">cp84@uw.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear R Zu, <br></div><div><br></div><div>Might be helpful if you give a small example demonstrating your usecase. For example, are the common terms dependent on 'x', etc. <br></div><div><br></div><div>Thanks <br></div><div><br></div><div><div><div dir="ltr" class="m_5754590950814498276gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><a href="https://about.me/chintanpathak" target="_blank">https://about.me/chintanpathak</a></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 27, 2018 at 9:55 AM R zu <<a href="mailto:rzu512@gmail.com" target="_blank">rzu512@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi.</div><div><br></div><div>- The hessian, gradient, and objective function have some common terms.</div><div>- The common terms depends on the variables of the objective function.</div><div><br></div><div>I calculate each common terms for three times because I need the term for Hessian, gradient, and objective function.</div><div><br></div><div>Is it possible to only calculate each common term for only once in each step of optimization?</div><div><br></div><div>Thank you.</div></div>
_______________________________________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org" target="_blank">Ipopt@list.coin-or.org</a><br>
<a href="https://list.coin-or.org/mailman/listinfo/ipopt" rel="noreferrer" target="_blank">https://list.coin-or.org/mailman/listinfo/ipopt</a><br>
</blockquote></div>
</blockquote></div>