<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>Hi Everyone,</div>
<div><br>
</div>
<div>My previous post was about different results on Hardware than on my laptop. I found out by trial and error that it seems related to the
<b>nlp_scaling_method</b>.&nbsp;</div>
<div>
<ul>
<li style="font-family: Tahoma; font-size: 10pt; ">When using a &quot;gradient-based&quot; I get nice results on Simulink (laptop), but on xPC-target (real-time hardware), I get some &quot;Invalid number&quot; or &quot;restoration failed&quot; message.</li><li><font size="2">When using &quot;user-scaling&quot; and not specify any scaling anywhere (I cannot find it in the 'options' appendix C of the documentation), Simulink and xPC-target show&nbsp;</font>similar<font size="2">&nbsp;results, but much slower.&nbsp;</font><span style="font-family: Tahoma; font-size: 10pt; ">If
 I look at the logs, the slower response does not come from the number of iterations, but from the number of function evaluations during&nbsp;</span><span style="font-family: Tahoma; font-size: 10pt; "><u>one</u></span><span style="font-family: Tahoma; font-size: 10pt; ">&nbsp;iteration.</span></li></ul>
<div>I am using a simple forward-difference approximation for the gradient with a static stepsize of h=1e-7 (machine accuracy of laptop is 2.22e-16, not sure about the xPC-target Intel Xeon).</div>
<div><br>
</div>
<div>Two questions:</div>
<div><u>1. The high number of function evaluations per iteration seems to point to a gradient issue. Am I correct in this?</u></div>
<div><br>
</div>
<div><u>2. Ideally I would like to use gradient-based scaling, but does anyone have any experience in using this method i.c.w. finite difference approximation?</u></div>
<div><br>
</div>
<div>I hope someone can help me, because I am really lost in this for a week now. :)</div>
<div><br>
</div>
<div>Best,</div>
<div><br>
</div>
<div>Martijn Disse</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div><br>
</div>
<div><br>
</div>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF988378" style="direction: ltr; "><font face="Tahoma" size="2" color="#000000"><b>Van:</b> ipopt-bounces@list.coin-or.org [ipopt-bounces@list.coin-or.org] namens Martijn Disse [M.W.Disse@student.tudelft.nl]<br>
<b>Verzonden:</b> dinsdag 2 oktober 2012 11:35<br>
<b>To:</b> ipopt@list.coin-or.org<br>
<b>Onderwerp:</b> [Ipopt] Issue on hardware implementation IPOPT: scaling issue?<br>
</font><br>
</div>
<div></div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi everyone,
<div><br>
</div>
<div>I've build an NMPC controller as a Matlab C-mex S-function and it works like a charm in Simulink. When I however compile to an xPC-target (turn a PC into a dedicated hardware) executable using MSVS 2010 express, I get different results.</div>
<div><br>
</div>
<div>I used the &quot;output_file&quot; option on to see what is happening. There are several differences between the Simulink log and the target hardware log:</div>
<div><br>
</div>
<div>1. <span class="Apple-tab-span" style="white-space:pre"></span>Xpc:&nbsp;<span class="Apple-tab-span" style="white-space:pre">
</span>Scaling parameter for objective function = 1.000000e-008</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Simulink: <span class="Apple-tab-span" style="white-space:pre">
</span>Scaling parameter for objective function = 1.163760e-003</div>
<div>2.&nbsp;<span class="Apple-tab-span" style="white-space:pre"> </span>Xpc:&nbsp;<span class="Apple-tab-span" style="white-space:pre">
</span>compl_inf &nbsp; &nbsp; = 4.0000000500000000e&#43;005</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Simulink:&nbsp;<span class="Apple-tab-span" style="white-space:pre">
</span>compl_inf &nbsp; &nbsp; = 3.4371342722094269e&#43;000</div>
<div>3.&nbsp;<span class="Apple-tab-span" style="white-space:pre"> </span>Xpc:<span class="Apple-tab-span" style="white-space:pre">
</span>overall_error = 4.0000000499999999e-003</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Simulink:<span class="Apple-tab-span" style="white-space:pre">
</span>overall_error = 1.0000000000000000e&#43;002</div>
<div>Iteration 0:</div>
<div>4.<span class="Apple-tab-span" style="white-space:pre"> </span>Xpc:<span class="Apple-tab-span" style="white-space:pre">
</span>inf_du lg(mu) =&nbsp;8.59e-004</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>Simulink:<span class="Apple-tab-span" style="white-space:pre">
</span>inf_du lg(mu) =&nbsp;1.00e&#43;002</div>
<div><br>
</div>
<div>It ends up with:</div>
<div>-EXIT: Invalid number in NLP function or derivative detected.</div>
<div>-Restoration phase is called at point that is almost feasible, with constraint violation 5.672143e-007. Abort.</div>
<div>-EXIT: Restoration Failed!</div>
<div><br>
</div>
<div>My question: <b>What could case a difference in the hardware implementation (xPC-target, Mathworks) and the Simulink results? The difference is already visible in the completely different scaling values.</b></div>
<div><b><br>
</b></div>
<div>I hope someone can help me :)</div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>-Martijn Disse</div>
<div><b><br>
</b></div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>