<div dir="auto">Where does the division occur? If it's in an equality constraint, reformulating the constraint by multiplying both sides by the denominator is usually better behaved numerically. Otherwise you can try rescaling, or bounding the denominator variables strictly away from 0.</div><div class="gmail_extra"><br><div class="gmail_quote">On Jun 7, 2017 2:29 AM, "Thomas Braam" <<a href="mailto:thomas.braam@gmail.com">thomas.braam@gmail.com</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"><span style="font-size:12.8px">Hello everyone,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><div>We are doing some modelling of plant metabolism. For this we use Flux Balance Analysis which represents metabolic networks as a series of linear differential equations. <span style="font-size:12.8px">However, recently we have introduced an additional equation into the model that describes the exchange of gases (CO2 and water vapour) between the plant and the atmosphere. This creates a non-linearity and we have to use a more complex optimisation approach. We are following the methods described in: </span><a href="https://doi.org/10.1371/journal.pone.0151722" style="font-size:12.8px" target="_blank">https://doi.org/10.1371/jo<wbr>urnal.pone.0151722</a><span style="font-size:12.8px"> which uses IPOPT with the HSL-MA97 solver, implemented in Python (PyIpopt).</span></div><div><br></div><div>Our problem is that when we try to implement the scripts with our gas-exchange equation included, we get a generic numpy error of the type caused by attempting to divide by 0. The gas-exchange equation (below) does contain some small numbers, so our first thought is that maybe the error is caused by IPOPT or PyIpopt rounding down.</div><div><br></div><div>Could you confirm if this is something that is not supported by IPOPT (or something I should generally avoid) or if this is error is possibly introduced by PyIpopt? Or do you have any ideas for changing the equation into something I can work with (I am not a mathematician).</div><div><br></div><div><div style="font-size:12.8px">Link to equation: <a href="https://drive.google.com/file/d/0ByNhotKkxQHMMEZqTkFrT21xUlBYMElvOVllWGxPcEphb1VV/view?usp=sharing" target="_blank">https://drive.<wbr>google.com/file/d/<wbr>0ByNhotKkxQHMMEZqTkFrT21xUlBYM<wbr>ElvOVllWGxPcEphb1VV/view?usp=<wbr>sharing</a><br></div><div style="font-size:12.8px">The variables CwvIn, CwOut, RH & Temp are static (they have equality bounds), JCO2 has bounds 0 to 1000. The values for the equality bounds that we use cause the result of the equation to be between 2*JCO2 and 4*JCO2 (if that makes sense) so the result of the equation is that small.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Many thanks,</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Thomas Braam</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></div>