<?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 Restrict result to Positive Solutions? in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677323#M190929</link>
    <description>&lt;P&gt;Dear All&lt;/P&gt;
&lt;P&gt;For the given attachment file how I can restrict the output results of minerr function to get positive only, as in my problem I need all the parameter that is calculated with minerr to be positive&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Abdelazeem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jul 2020 11:22:04 GMT</pubDate>
    <dc:creator>Abdelazeem</dc:creator>
    <dc:date>2020-07-14T11:22:04Z</dc:date>
    <item>
      <title>Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677323#M190929</link>
      <description>&lt;P&gt;Dear All&lt;/P&gt;
&lt;P&gt;For the given attachment file how I can restrict the output results of minerr function to get positive only, as in my problem I need all the parameter that is calculated with minerr to be positive&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Abdelazeem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 11:22:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677323#M190929</guid>
      <dc:creator>Abdelazeem</dc:creator>
      <dc:date>2020-07-14T11:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677396#M190940</link>
      <description>&lt;P&gt;As far as I see the results already ARE all positive!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1594736404578.png" style="width: 282px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/29242iCA11C8AC9FB3B253/image-dimensions/282x122?v=v2" width="282" height="122" role="button" title="Werner_E_0-1594736404578.png" alt="Werner_E_0-1594736404578.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But you always can add constraints like&amp;nbsp;&amp;nbsp; A&amp;gt;0, etc. in your solve block. A negative A is taken as an error and Prime will try to minimize the overall errors. Constraints are soft constraints and you can weight them by multiplication. A negative A=-1 ist maybe considered a small error but if your constraint reads 10^5*A&amp;gt;0 its taken as a far larger error and Prime will try to make it smaller.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 14:26:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677396#M190940</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-07-14T14:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677407#M190941</link>
      <description>&lt;P&gt;Firstly thank you indeed for your reply, secendly, I used another example and I attached another one&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is the new issue&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Abdelazeem_0-1594737428017.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/29243iABB44E05BAC7B435/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Abdelazeem_0-1594737428017.png" alt="Abdelazeem_0-1594737428017.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I attached the file&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 14:37:52 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677407#M190941</guid>
      <dc:creator>Abdelazeem</dc:creator>
      <dc:date>2020-07-14T14:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677417#M190943</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;I attached the file&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But its the same file as in your first post. Still only positive results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you already tried adding constraints like A&amp;gt;0, etc. ?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 14:50:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677417#M190943</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-07-14T14:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677430#M190947</link>
      <description>&lt;P&gt;I am sorry about that , I added all parameters &amp;gt;0 but still problem exist&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as in the attachment file&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 15:34:03 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677430#M190947</guid>
      <dc:creator>Abdelazeem</dc:creator>
      <dc:date>2020-07-14T15:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677465#M190952</link>
      <description>&lt;P&gt;Your system seems to be quite unstable and is VERY sensitive wrt the guess values.&lt;/P&gt;
&lt;P&gt;I played around with the guesses and found that especially changing the guess for C has a great impact an the result. Some values for C like 1.41, 2, 5 gives you positive results but those results are quite different from each other. You'll have to decide if they are meaningful and trustworthy at all.&lt;/P&gt;
&lt;P&gt;To make it easier to compare results for different guess values for C I turned the solve block into a function f(C) depending on the guess value. Thats what you see in the pic below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1594747893753.png" style="width: 784px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/29253iAC913C512CF855D2/image-dimensions/784x198?v=v2" width="784" height="198" role="button" title="Werner_E_1-1594747893753.png" alt="Werner_E_1-1594747893753.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 17:33:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677465#M190952</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-07-14T17:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677485#M190956</link>
      <description>&lt;P&gt;really thank you for your help, please could you send the mathcade file in the attachment with me&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 19:20:08 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677485#M190956</guid>
      <dc:creator>Abdelazeem</dc:creator>
      <dc:date>2020-07-14T19:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677492#M190958</link>
      <description>&lt;P&gt;Sorry, I didn't save the file.&lt;/P&gt;
&lt;P&gt;But you just need to change your guess of C:=0.2 to, lets say, C:=2 and you will get the positive results.&lt;/P&gt;
&lt;P&gt;You may experiment with different values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason I turned the solve block into a function of the guess for C was because I wanted to be able to show the effects of different guess values side by side without the need to make multiple screen shots.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to do this, you just have to modify the last line in the solve block to read f(C):=minerr(...) and delete the = after the minerr command - you can see it in the screenshot I posted.&lt;/P&gt;
&lt;P&gt;Of course you also have to delete the guess C:=0.2 on top of the solve block.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 19:49:17 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677492#M190958</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-07-14T19:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677496#M190959</link>
      <description>&lt;P&gt;Thank you for you fast help and your easy discussion&lt;/P&gt;
&lt;P&gt;According to your advice ,the issue is solved now&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 19:56:43 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677496#M190959</guid>
      <dc:creator>Abdelazeem</dc:creator>
      <dc:date>2020-07-14T19:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677502#M190960</link>
      <description>&lt;P&gt;I played around with your sheet again and found, that if we weight the constraints A&amp;gt;0 very high by multiplying A with a high number, the solve block delivers a solution with all positive values even with the guess value C:=0.2.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1594756979021.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/29262iCBB2320B0D6DB404/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1594756979021.png" alt="Werner_E_0-1594756979021.png" /&gt;&lt;/span&gt;&amp;nbsp; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1594757007537.png" style="width: 241px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/29263i7CD147EA6E303F87/image-dimensions/241x148?v=v2" width="241" height="148" role="button" title="Werner_E_1-1594757007537.png" alt="Werner_E_1-1594757007537.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The price is that the other constraints, your four equation, are now weighted much lower and if you check I guess the result is not satisfying:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_2-1594757121007.png" style="width: 561px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/29264i4A20B8FEB7B29F32/image-dimensions/561x251?v=v2" width="561" height="251" role="button" title="Werner_E_2-1594757121007.png" alt="Werner_E_2-1594757121007.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Ideally all four results should be close to zero!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may experiment with different guesses and maybe different values for "factor".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prime6 worksheet attached &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The prove&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 20:07:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677502#M190960</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-07-14T20:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677505#M190961</link>
      <description>&lt;P&gt;really I appreciate your help, you are very helpful&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 20:19:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677505#M190961</guid>
      <dc:creator>Abdelazeem</dc:creator>
      <dc:date>2020-07-14T20:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict result to Positive Solutions?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677507#M190963</link>
      <description>&lt;P&gt;One last idea: I noticed that you had uses a lot of unnecessary parenthesis in your expression. I deleted most of them, but maybe you'd like to check you equations if all the signs are really correct.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 20:24:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Restrict-result-to-Positive-Solutions/m-p/677507#M190963</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2020-07-14T20:24:41Z</dc:date>
    </item>
  </channel>
</rss>

