<div dir="ltr">Hi all, <div><br><div>I did some tests to obtain the Lagrange multipliers. I printed out the multipliers for each iteration (by using "intermediate_callback") and the the multipliers at the last iteration (by using "finalize_solution").  At " finalize_solution", I printed out both "lambda" and the data from "ip_cq'. So my code is like this:<div><br></div><div><div> Ipopt::TNLPAdapter* tnlp_adapter = NULL;</div><div>        if( ip_cq != NULL )</div><div>        {</div><div>            Ipopt::OrigIpoptNLP* orignlp;</div><div>            orignlp = dynamic_cast<Ipopt::OrigIpoptNLP*>(GetRawPtr(ip_cq->GetIpoptNLP()));</div><div>            if( orignlp != NULL )</div><div>            {</div><div>                tnlp_adapter = dynamic_cast<Ipopt::TNLPAdapter*>(GetRawPtr(orignlp->nlp()));</div><div>                double* dualeqs = new double[m];</div><div>                tnlp_adapter->ResortG(*ip_data->curr()->y_c(), *ip_data->curr()->y_d(), dualeqs);</div><div>                for (int ii = 0; ii < m; ii++)</div><div>                {</div><div>                  //1: print out dualeqs[ii]</div><div>                 //2: print out lambda[ii]</div><div>                }</div><div>            }</div><div>        }</div></div><div><br></div><div><br></div><div>For some tests, dualeqs[ii] is the same as lambda[ii]; but for some tests, they are not the same at all. </div><div><br></div><div>Do I miss anything? </div><div><br></div><div>Thank you!</div><div><br></div><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 17, 2017 at 2:59 AM, Antonello Lobianco <span dir="ltr"><<a href="mailto:antonello@lobianco.org" target="_blank">antonello@lobianco.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">From <a href="https://www.coin-or.org/Ipopt/documentation/node23.html#SECTION00053410000000000000" target="_blank">the documentation</a> it should, at least using the C++ interface:<br><br>virtual bool intermediate_callback()<br><br>This method is called once per iteration (during the convergence check), and can be used to obtain information about the optimization status while IPOPT solves the problem, and also to request a premature termination. <br>[...]<br>A frequently asked question is how to access the values of the primal and dual variables in this callback. The values are stored in the ip_cq object for the internal representation of the problem. To access the values in a form that corresponds to those used in the evaluation routines, the user has to request IPOPT's TNLPAdapter object to ``resort'' the data vectors and to fill in information about possibly filtered out fixed variables.<br><br><br><br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 17 May 2017 at 11:32, Alex Ferrer <span dir="ltr"><<a href="mailto:aferrer@cimne.upc.edu" target="_blank">aferrer@cimne.upc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Yes, I need to know the values of the Lagrange multipliers during
    iterations. Does Ipopt (independetly of using Matlab) provide them?
    <p>Thanks,</p>
    <p>Àlex<br>
    </p><div><div class="m_9068175954066107689h5">
    <br>
    <div class="m_9068175954066107689m_-8358227934879661871moz-cite-prefix">On 14/05/17 22:25, Antonello L. wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="auto">sorry, I didn't read that you need it **during
        iterations**..
        <div dir="auto">Jump provides solver callbacks, but I am not
          sure you can use them in nonlinear programming nor to extract
          lagrangian values..</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 14 May 2017 9:39 p.m., "Antonello
          Lobianco" <<a href="mailto:antonello@lobianco.org" target="_blank">antonello@lobianco.org</a>>
          wrote:<br type="attribution">
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>You could access IPOPT using <a href="http://jump.readthedocs.io/en/latest/" target="_blank">Jump</a> instead of Matlab and get the
                lagrangian with getdual([constraint name]).<br>
              </div>
              Antonello<br>
              <div class="gmail_extra"><br>
                <div class="gmail_quote">On 14 May 2017 at 11:34, Àlex
                  Ferrer <span dir="ltr"><<a href="mailto:aferrer@cimne.upc.edu" target="_blank">aferrer@cimne.upc.edu</a>></span>
                  wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
                    everyone,<br>
                    <br>
                    I am using Ipopt via the Matlab interface for
                    solving my optimization problem.<br>
                    <br>
                    I need to know the values of the Lagrange
                    multipliers during iterations and I could not find a
                    way to get them from Ipopt.<br>
                    <br>
                    I was wondering if someone could help me with this.<br>
                    <br>
                    Thank you in advance,<br>
                    <br>
                    Àlex<br>
                    <br>
                    ______________________________<wbr>_________________<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://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=DwIGaQ&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=8oTnxj08sd2ffhbFEprcyo6DDTVDvo_DCJ2aU6CdYWE&m=1jOELYmw264NINGn1HEz2upD-LjqU5T1BFjnufFgTtQ&s=u-hPWd-wE0VwNG492NzItoGXa1vTGSGwtrREgNROxVs&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__list.co<wbr>in-2Dor.org_mailman_listinfo_i<wbr>popt&d=DwIGaQ&c=Ngd-ta5yRYsqeU<wbr>sEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&<wbr>r=8oTnxj08sd2ffhbFEprcyo6DDTVD<wbr>vo_DCJ2aU6CdYWE&m=1jOELYmw264N<wbr>INGn1HEz2upD-LjqU5T1BFjnufFgTt<wbr>Q&s=u-hPWd-wE0VwNG492NzItoGXa1<wbr>vTGSGwtrREgNROxVs&e=</a>
                  </blockquote>
                </div>
                <br>
                <br clear="all">
                <br>
                -- <br>
                <div class="m_9068175954066107689m_-8358227934879661871m_8566417620983721001m_-6838170445233590243gmail_signature" data-smartmail="gmail_signature">
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr"><span><span>Antonello Lobianco<br>
                                AgroParisTech, Laboratoire d'Economie
                                Forestière<br>
                                14 Rue Girardet - 54000 Nancy, France<br>
                                Tel: <a href="tel:+33%203%2083%2039%2068%2065" value="+33383396865" target="_blank">+33.383396865</a><br>
                                Email, university: <a href="mailto:antonello.lobianco@nancy.inra.fr" target="_blank">antonello.lobianco@inra.fr</a><br>
                                Email, personal: <a href="mailto:antonello@lobianco.org" target="_blank">antonello@lobianco.org</a><br>
                                <a href="http://antonello.lobianco.org/" target="_blank">http://antonello.lobianco.org</a></span></span></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
    </div></div><span class="m_9068175954066107689HOEnZb"><font color="#888888"><div class="m_9068175954066107689m_-8358227934879661871moz-signature">-- <br>
      <table style="background:none;border-width:0px;border:0px;margin:0;padding:0" cellspacing="0" cellpadding="0" border="0">
        <tbody>
          <tr>
            <td colspan="2" style="padding-bottom:5px;color:#f7751f;font-size:18px;font-family:Arial,Helvetica,sans-serif">Alex Ferrer</td>
          </tr>
          <tr>
            <td colspan="2" style="color:#333333;font-size:14px;font-family:Arial,Helvetica,sans-serif"><i>Ph.D.
                candidate student, M.Sc. Aeronautical Engineering</i></td>
          </tr>
          <tr>
            <td colspan="2" style="color:#333333;font-size:14px;font-family:Arial,Helvetica,sans-serif"><strong>CIMNE</strong></td>
          </tr>
          <tr>
            <td style="vertical-align:top;width:20px;color:#f7751f;font-size:14px;font-family:Arial,Helvetica,sans-serif" width="20" valign="top">a:</td>
            <td style="vertical-align:top;color:#333333;font-size:14px;font-family:Arial,Helvetica,sans-serif" valign="top">Building C1 Campus Nord UPC C/ Gran Capità,
              S/N 08034 Barcelona, Spain</td>
          </tr>
          <tr>
            <td style="vertical-align:top;width:20px;color:#f7751f;font-size:14px;font-family:Arial,Helvetica,sans-serif" width="20" valign="top">w:</td>
            <td style="vertical-align:top;color:#333333;font-size:14px;font-family:Arial,Helvetica,sans-serif" valign="top"><a href="http://www.cimne.com/" style="color:#1da1db;text-decoration:none;font-weight:normal;font-size:14px" target="_blank">www.cimne.com/</a>  <span style="color:#f7751f">e: </span><a href="mailto:aferrer@cimne.upc.edu" style="color:#1da1db;text-decoration:none;font-weight:normal;font-size:14px" target="_blank">aferrer@cim<wbr>ne.upc.edu</a></td>
          </tr>
        </tbody>
      </table>
    </div>
  </font></span></div>

</blockquote></div><br><br clear="all"><br>-- <br><div class="m_9068175954066107689gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><span>Antonello Lobianco<br>AgroParisTech, Laboratoire d'Economie Forestière<br>14 Rue Girardet - 54000 Nancy, France<br>Tel: <a href="tel:+33%203%2083%2039%2068%2065" value="+33383396865" target="_blank">+33.383396865</a><br>Email, university: <a href="mailto:antonello.lobianco@nancy.inra.fr" target="_blank">antonello.lobianco@inra.fr</a><br>Email, personal: <a href="mailto:antonello@lobianco.org" target="_blank">antonello@lobianco.org</a><br><a href="http://antonello.lobianco.org/" target="_blank">http://antonello.lobianco.org</a></span></span></div></div></div></div></div></div>
</div>
</div></div><br>______________________________<wbr>_________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org">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/<wbr>mailman/listinfo/ipopt</a><br>
<br></blockquote></div><br></div>