<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Minerr/nonlinear optimizing in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212435#M83271</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt;What ( if exists ) is the maximum computational time for the Minerr-Levenberg-Marquardt optimization loop?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm nor sure of the details, but there is an upper limit. I suspect it's a maximum number of iterations rather than a time. Whatever the details are, the limit is high, and if it's reached then there is a problem with the optimization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt;How the parameters are varied within the Minerr-Levenberg-Marquard loop ? &lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It's a downhill method. it starts at some point on the (multi-dimensional) error surface that is determined by the guess values. It then iteratively proceeds "downhill", i.e. to lower error, until it can't find a lower error. Ideally that would be because it reached a minimum (even more ideally, it would be the global minimum, but there is never any guarantee of that), but it could also stop because it reaches a discontinuity, a flat spot in the surface, or some other problem that stops it from finding a better solution. I posted the original paper that describes the algorithm here: &lt;A href="https://www.ptcusercommunity.com/message/430712"&gt;Re: Why minimize not work in this Mathcad Prime 3.0 sheet?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt;What does implies if Minerr function stops before converging ( i.e. undefined variables )?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The "undefined variables" error message is useless, because it's the only error message returned by a minerr solve block. It could mean anything. It could really be an undefined variable (i.e. one or more variables do not have guess values assigned, and/or some other variable is undefined), or it could be a divide by zero problem, or some part of the error function can't be evaluated for some other reason, or just about anything else. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2016 13:39:57 GMT</pubDate>
    <dc:creator>RichardJ</dc:creator>
    <dc:date>2016-07-19T13:39:57Z</dc:date>
    <item>
      <title>Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212417#M83253</link>
      <description>In reference to this document: Minerr/nonlinear optimizingYour equation for Function is wrong. For a least squares fit the error function should be the square root of the sum of the squares (or just the sum of the squares). You have the sum of the square root of the squares, which</description>
      <pubDate>Thu, 03 May 2018 14:22:05 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212417#M83253</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2018-05-03T14:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212418#M83254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I played around a little, and it's super sensitive to the guess values. I'm not sure anything we have found is the true minimum, and I'm not sure any gradient method is the way to find the true minimum. Maybe simulated annelaing: &lt;A href="https://www.ptcusercommunity.com/docs/DOC-8868"&gt;Minimizing a Function using Simulated Annealing&lt;/A&gt;. I'm traveling in Europe at the moment though, so I'm not sure when I will find time to try that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:00:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212418#M83254</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2016-07-01T15:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212419#M83255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to joint the discussion about Minerr Levenberg-Marquardt, since&amp;nbsp; I found me to some convergence issue, for some additional points:&lt;/P&gt;&lt;P&gt;1) It is possible to use relative deviations( |X-Xxep|/Xexp instead of residual ( |X-Xexp| (&amp;nbsp; in order to taking in account the variable absolute value) (?)&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; It is possible to consider two ( or more)&amp;nbsp; weighted objective functions to be minimized in the same solve block or it is best to consider the sum of them ( a single boolean equation) (?)&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; In order to check wheter Minerr has found a true minimum, it is possible to use the ERR function&amp;nbsp; alternatively to recalculate the objective function?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 11:35:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212419#M83255</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-07T11:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212420#M83256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;1) It is possible to use relative deviations( |X-Xxep|/Xexp instead of residual ( |X-Xexp| (&amp;nbsp; in order to taking in account the variable absolute value) (?)&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, it is just a weighted fit. For a true least squares fit the errors should all be of equal standard deviation. If the errors are independent of the magnitude of the data that means they should be unweighted. If the errors are proportional to the magnitude of the data then they should be weighted by 1/magnitude, which is what you propose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;2)&amp;nbsp; It is possible to consider two ( or more)&amp;nbsp; weighted objective functions to be minimized in the same solve block or it is best to consider the sum of them ( a single boolean equation) (?)&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, just stack the (weighted) residuals, or put them in two columns of a matrix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;3)&amp;nbsp; In order to check wheter Minerr has found a true minimum, it is possible to use the ERR function&amp;nbsp; alternatively to recalculate the objective function?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm not sure what you mean. The ERR function is a built-in variable, not a function, that gives you the error in the fit. When minerr stops iterating it has found either a flat area in the objective function or a minimum. There is no way to know which (other than by trying different guesses), and no way to know if it is the global minimum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jul 2016 15:47:39 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212420#M83256</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2016-07-07T15:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212421#M83257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;I am currently applying the Minerr Levenberg-Marquardt for the classical chemical engineering problem of fitting the pure component parameters of a volumetric EOS ( Equation of State ) versus experimental vapour pressure and liquid density. Since the equation is implicit on the density, depending on the initial values, Minerr could converge to a false minimum ( e.g. wrong root: vapor density). Could&amp;nbsp; the minimization problem be solved alternatively with Simplex algorithm type. Is this available in MathCAD?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 09:13:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212421#M83257</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-08T09:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212422#M83258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not with Minerr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With minimize, you can impose the adequate conditions inside the solve block with &amp;lt;, &amp;lt;= to the variables to ensure the convergence to the desired range. But then the problem is how to express the zero of the function. For a lot of problems works simply include abs(f(x,y,..))=0 or something about squares and related conditions. But for several variables it could be problematic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With solve you can also include restriction over the variable domain, and don't need to prepare the function to solve too much. But, again, for several variables don't works for the general case, and need to use minimize with an optimized condition for f.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As comment, can't read the water data, mathcad says something about loss region when load the worksheet. But don't know if it is my problem, or others collabs have it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2016 20:11:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212422#M83258</guid>
      <dc:creator>AlvaroDíaz</dc:creator>
      <dc:date>2016-07-08T20:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212423#M83259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Hi Alvaro,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Thank you for your answer. The experimental data are copied and pasted as table from the following&amp;nbsp; &lt;A href="http://webbook.nist.gov/chemistry/fluid/" title="http://webbook.nist.gov/chemistry/fluid/"&gt;Thermophysical Properties of Fluid Systems&lt;/A&gt; ( saturation properties -temperature increments ).&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;The attachment is analogue file for Benzene ( i.e. no association contribution ). Here the minimization algorithm works straightforward, so I think the convergence issues are related to the association contribution ( SAFT type ).&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Your faithfully,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Massimiliano&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 07:01:50 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212423#M83259</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-11T07:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212424#M83260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. I can't read the original data, problems loading the mathcad document, for the benzene too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I copy some data, and what I can see is that the first solve block fails for some points, not all of them. So, guess you can "un-refine" the interval from NIST page, or reduce the whole interval for get some one where all data points gives a solution for the minerr block. See attached. Try also to change the solve method for quasi Newton or Conj-Grad. Also, try for TOL=CTOL=0.01. You have several variables, but for T in K and P in Pa this value is actually a very very small one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can identify points where the solve block fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="errors.gif" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/103920_errors.gif" style="height: 490px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 10:38:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212424#M83260</guid>
      <dc:creator>AlvaroDíaz</dc:creator>
      <dc:date>2016-07-11T10:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212425#M83261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your indications. I will try to apply your suggestions. However the convergence of the solve block is not a "sufficient condition", if you see in most cases the two solutions coincide, while in case of benzene not, the first (0) representing the vapor, the second (1) representing the liquid, with the given reduced density initial values (&amp;nbsp; 0.0001 and 0.6&amp;nbsp; ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your faithfully,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Massimiliano&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 11:55:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212425#M83261</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-11T11:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212426#M83262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimiliano. Yes, you're right about the "sufficient condition" (&amp;lt;=), but it's a "necesary condition" (=&amp;gt;) for working the minerr block. And it's true what you say about the benzene too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't show the correct picture, playing with CTOOL make a nonsense mistake. Attached shows better what's I says: see the result for row 24 of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="errors.gif" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/103921_errors.gif" style="height: 490px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 12:10:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212426#M83262</guid>
      <dc:creator>AlvaroDíaz</dc:creator>
      <dc:date>2016-07-11T12:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212427#M83263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Alvaro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to change method, initial values and tolerances (&amp;nbsp; CTOL and TOL ).&lt;/P&gt;&lt;P&gt;The "on error" conditional function is very useful to analyse the Minerr loop convergence. I think that some convergence issues depends on the analytical form of the association contribution. In a previous thread for instance, it was found out that the second derivative has some numerical instabilities increasing the value of the association parameters ( Vaa and epsilonaa).&lt;A href="https://www.ptcusercommunity.com/thread/129266"&gt;Numerical issues with Symbolic Derivative Operators&lt;/A&gt;‌. Here I was trying to set the association parameters nihil in order to determine the critical parameters and to adjust them&amp;nbsp; for the fitting of the vapour pressure and liquid density.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your faithfully,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Massimiliano&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2016 14:05:51 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212427#M83263</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-11T14:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212428#M83264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been traveling, so I only just got a chance to look at this. Could you please clarify why you think the water worksheet has a problem, but the benzene one does not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: Forget it. It's obvious when I look harder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 17:50:22 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212428#M83264</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2016-07-12T17:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212429#M83265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a consideration: The only difference between the two worksheets is that the Benzene uses an EOS that is a 7th degree polynomial equation in the density (eta) while the EOs in&amp;nbsp; Water.rev&amp;nbsp; is obtained&amp;nbsp; adding to this equation the so-called association contribution ( SAFT type ) due to Wertheim's Perturbation Theory&lt;IMG alt="Ass.1.png" class="jive-image image-1" src="https://community.ptc.com/legacyfs/online/104036_Ass.1.png" style="height: auto;" /&gt;.&lt;/P&gt;&lt;P&gt;Overall there are eight (8) parameters.&lt;IMG alt="Par.png" class="jive-image image-2" src="https://community.ptc.com/legacyfs/online/104037_Par.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Two (2) of them ( epsilon and bc ) are determined by solving the isothermal critical conditions,&lt;IMG alt="Isothermal_Conditions.png" class="jive-image image-3" src="https://community.ptc.com/legacyfs/online/104038_Isothermal_Conditions.png" style="height: auto;" /&gt; &lt;/P&gt;&lt;P&gt;the remaining six by minimizing the objective function in the Minerr Levenberg-Marquardt loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Minerr.png" class="image-4 jive-image" src="https://community.ptc.com/legacyfs/online/104039_Minerr.png" style="height: 441px; width: 620px;" /&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the experimental data ( vapour pressure and liquid density ) are taken from the Matrix&lt;/P&gt;&lt;P&gt;:&lt;IMG alt="Data.png" class="image-5 jive-image" src="https://community.ptc.com/legacyfs/online/104040_Data.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 07:38:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212429#M83265</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-13T07:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212430#M83266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimiliano.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before calling Sol inside the minerr block, ¿do you check that for all i don't have any error for Sol(Texp[i,alpha0,...)? I can't because my mathcad refuses to load your original data "Water" .&lt;/P&gt;&lt;P&gt;If that, you can try to eliminate the problematic rows from the data,as workaround, and then go with the actual issues for the minerr implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:16:33 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212430#M83266</guid>
      <dc:creator>AlvaroDíaz</dc:creator>
      <dc:date>2016-07-13T08:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212431#M83267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alvaro, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; By using the on error conditional function, I noticed that the number of critical rows for temperature depends on parameters and variable initial values. I have not tried to get rid of all the problematic rows, before entering the Minerr since in principle I would like to fit all the reduced temperature range [ about 0.4-0.9 ]. So when Minerr find an error in Sol , it stops the optimization?&lt;/P&gt;&lt;P&gt;I was thinking that the algorithm by changing parameters&amp;nbsp; values was able to converge to a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your faithfully,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Massimiliano&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:34:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212431#M83267</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-13T08:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212432#M83268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Massimiliano Nori wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;.... So when Minerr find an error in Sol , it stops the optimization? ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yep. Use the previous posted error detection with the "on error" command to discard problematic points from the data Water before use the Sol function inside the minerr block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a rude workaround. You can try other techniques, like "un-refine" the interval, or something more elegant, but with those errors can't get a solution from minerr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;... I was thinking that the algorithm by changing parameters&amp;nbsp; values was able to converge to a solution. ...&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No. After Sol was defined, can't modify it by changing anything. Actually that's uncomfortable to me, and I'm use some workarounds, but in Mathcad 11. Also, this is why I comment in the mathcad worksheet that, even can change TOL and CTOL before minerr block, isn't the best practice, just because Sol don't go to use them, and go to take the previous values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2016 08:59:26 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212432#M83268</guid>
      <dc:creator>AlvaroDíaz</dc:creator>
      <dc:date>2016-07-13T08:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212433#M83269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp; No errors is found by the conditional function after&lt;SPAN style="font-size: 13.3333px;"&gt; changing parameters/variables initial values. I&lt;/SPAN&gt;t looks that some limitations are inherent in the model (?).&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;What ( if exists ) is the maximum computational time for the Minerr-Levenberg-Marquardt optimization loop? How the parameters are varied within the Minerr-Levenberg-Marquard loop ? What does implies if Minerr function stops before converging ( i.e. undefined variables )?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 10:07:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212433#M83269</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-19T10:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212434#M83270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimiliano.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Others are the experts in this algorithms, and hope can answer to you more precisely, but there are my answers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;No errors is found by the conditional function after&lt;SPAN style="font-size: 13.3333px;"&gt; changing parameters/variables initial values. I&lt;/SPAN&gt;t looks that some limitations are inherent in the model (?).&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Maybe not, with the usual limitations of all numeric algorithms have enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;What ( if exists ) is the maximum computational time for the Minerr-Levenberg-Marquardt optimization loop?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Usually programs with iterations don't eval the time, but use a counter for check if some MaxIters was rached. If that, program halts. Sometimes the programmer set the answer as the last approximation, but a good best practice is to notify an error. So, the time involved in the loop is variable, depending on the time that the functions and constraints take to eval. See this MaxIters in &lt;A href="http://www.duke.edu/~hpgavin/lm.m" title="http://www.duke.edu/~hpgavin/lm.m"&gt;http://www.duke.edu/~hpgavin/lm.m&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;How the parameters are varied within the Minerr-Levenberg-Marquard loop ? &lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;For that can check &lt;A href="http://people.duke.edu/~hpgavin/ce281/lm.pdf" title="http://people.duke.edu/~hpgavin/ce281/lm.pdf"&gt;http://people.duke.edu/~hpgavin/ce281/lm.pdf&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;What does implies if Minerr function stops before converging ( i.e. undefined variables )?&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Nothing. Can use more iterations, can modify guess values, can do a lot of things before discard a model. Or can use the best calculus method: always use first degree approximation, like in the Newton method. This is: all are rect lines or planes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alvaro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 12:17:16 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212434#M83270</guid>
      <dc:creator>AlvaroDíaz</dc:creator>
      <dc:date>2016-07-19T12:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212435#M83271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt;What ( if exists ) is the maximum computational time for the Minerr-Levenberg-Marquardt optimization loop?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I'm nor sure of the details, but there is an upper limit. I suspect it's a maximum number of iterations rather than a time. Whatever the details are, the limit is high, and if it's reached then there is a problem with the optimization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt;How the parameters are varied within the Minerr-Levenberg-Marquard loop ? &lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;It's a downhill method. it starts at some point on the (multi-dimensional) error surface that is determined by the guess values. It then iteratively proceeds "downhill", i.e. to lower error, until it can't find a lower error. Ideally that would be because it reached a minimum (even more ideally, it would be the global minimum, but there is never any guarantee of that), but it could also stop because it reaches a discontinuity, a flat spot in the surface, or some other problem that stops it from finding a better solution. I posted the original paper that describes the algorithm here: &lt;A href="https://www.ptcusercommunity.com/message/430712"&gt;Re: Why minimize not work in this Mathcad Prime 3.0 sheet?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt;What does implies if Minerr function stops before converging ( i.e. undefined variables )?&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The "undefined variables" error message is useless, because it's the only error message returned by a minerr solve block. It could mean anything. It could really be an undefined variable (i.e. one or more variables do not have guess values assigned, and/or some other variable is undefined), or it could be a divide by zero problem, or some part of the error function can't be evaluated for some other reason, or just about anything else. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 13:39:57 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212435#M83271</guid>
      <dc:creator>RichardJ</dc:creator>
      <dc:date>2016-07-19T13:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Minerr/nonlinear optimizing</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212436#M83272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Thank you Alvaro and Richard for the clarifications. &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;In order to determine the error source of the "undefined variable", is it possible to lively monitor the parameters "guess" values in each iteration of the Minerr solve or to have an indication of the extent of their variation at a given step? &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Furthermore in some cases as in the print-out I have attached before the conditions in the solve Block were not reached ( objective function &amp;lt;CTOL ( e.g.0.001 ) but not error message was returned. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2016 14:01:01 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Minerr-nonlinear-optimizing/m-p/212436#M83272</guid>
      <dc:creator>mnori</dc:creator>
      <dc:date>2016-07-19T14:01:01Z</dc:date>
    </item>
  </channel>
</rss>

