<?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: BE. How to better translate this matlab code into Mathcad Prime implementation? in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952397#M212098</link>
    <description>&lt;P&gt;How to find also the maximum peak values for V1 and V2, and the coresponding time at which these maximum values occure?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1716803749496.png" style="width: 705px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105139i63E5E088FAE6BA4B/image-dimensions/705x444?v=v2" width="705" height="444" role="button" title="Cornel_0-1716803749496.png" alt="Cornel_0-1716803749496.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2024 09:57:18 GMT</pubDate>
    <dc:creator>Cornel</dc:creator>
    <dc:date>2024-05-27T09:57:18Z</dc:date>
    <item>
      <title>BE. How to better translate this matlab code into Mathcad Prime implementation?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952370#M212096</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have this matlab code and I want to translate it to Mathcad Prime. I tried below one way, but maybe someone can implement better.&lt;BR /&gt;Matlab:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_4-1716797345678.png" style="width: 575px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105128iDFB50ECAEEB687EB/image-dimensions/575x807?v=v2" width="575" height="807" role="button" title="Cornel_4-1716797345678.png" alt="Cornel_4-1716797345678.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Mathcad Prime 9:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_5-1716797359262.png" style="width: 398px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105129iFEF3A20D83BD6348/image-dimensions/398x1021?v=v2" width="398" height="1021" role="button" title="Cornel_5-1716797359262.png" alt="Cornel_5-1716797359262.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_6-1716797376291.png" style="width: 563px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105130i7FEFAEB80E277D57/image-dimensions/563x535?v=v2" width="563" height="535" role="button" title="Cornel_6-1716797376291.png" alt="Cornel_6-1716797376291.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;And if I remove evaluation of t, the the plot does not work anymore:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_7-1716797469212.png" style="width: 640px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105131iC026537000E409A1/image-dimensions/640x723?v=v2" width="640" height="723" role="button" title="Cornel_7-1716797469212.png" alt="Cornel_7-1716797469212.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;And then how to make this difference/calculation:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1716797666610.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105132i80D1FF7732383F71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_0-1716797666610.png" alt="Cornel_0-1716797666610.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_1-1716797705955.png" style="width: 533px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105133iEA9A21A1C4BD6406/image-dimensions/533x426?v=v2" width="533" height="426" role="button" title="Cornel_1-1716797705955.png" alt="Cornel_1-1716797705955.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 08:15:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952370#M212096</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-05-27T08:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: BE. How to better translate this matlab code into Mathcad Prime implementation?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952394#M212097</link>
      <description>&lt;P&gt;Using inline evaluation after defining the range t is an undocumented trick to turn the range into a vector. Thats the reason it does not work if you omit this evaluation. This trick also does not work anymore in Prime 10, so you should create the vector in a different way (see the screenshot below and the attached file).&lt;/P&gt;
&lt;P&gt;V1 is a vector with 501 elements, but the vector V2 you create has 502 elements! Thats the reason why V1-V2 does not work. You have to take care of the number of times the loop runs and also note that you use ORIGIN=0 in your sheet, so the first vector index is 0, not 1.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1716802765506.png" style="width: 507px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105137iEE41BE6D6376C613/image-dimensions/507x318?v=v2" width="507" height="318" role="button" title="Werner_E_0-1716802765506.png" alt="Werner_E_0-1716802765506.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But as you are working in Mathcad/Prime, so why aren't you using units? You may also consider using "Odesolve" instead of programming your own numeric approximation.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1716803150782.png" style="width: 572px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105138iD2D8AED6D3E2F057/image-dimensions/572x535?v=v2" width="572" height="535" role="button" title="Werner_E_1-1716803150782.png" alt="Werner_E_1-1716803150782.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>Mon, 27 May 2024 09:46:25 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952394#M212097</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2024-05-27T09:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: BE. How to better translate this matlab code into Mathcad Prime implementation?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952397#M212098</link>
      <description>&lt;P&gt;How to find also the maximum peak values for V1 and V2, and the coresponding time at which these maximum values occure?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1716803749496.png" style="width: 705px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105139i63E5E088FAE6BA4B/image-dimensions/705x444?v=v2" width="705" height="444" role="button" title="Cornel_0-1716803749496.png" alt="Cornel_0-1716803749496.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 09:57:18 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952397#M212098</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-05-27T09:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: BE. How to better translate this matlab code into Mathcad Prime implementation?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952412#M212102</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/300363"&gt;@Cornel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How to find also the maximum peak values for V1 and V2, and the coresponding time at which these maximum values occure?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should have no problems finding the maxima of the pure sine wave V1, don't you? &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;According V2 - if you decide for the functional approach as shown before, you may use the "root" function in one of its flavors to see where the first derivative is zero.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1716806071222.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105140i138A3BBA9392AE34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1716806071222.png" alt="Werner_E_0-1716806071222.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the array approach you may use "lookup" with all its drawbacks (was discussed quite some times here in the forum, last thread about the problems was &lt;A href="https://community.ptc.com/t5/Mathcad/BUG-inconsequent-behaviour-of-match-function/m-p/951606#M212007" target="_blank"&gt;BUG: inconsequent behaviour of match() function&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1716806768251.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105143i1B5EA388F15DDA57/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_1-1716806768251.png" alt="Werner_E_1-1716806768251.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>Mon, 27 May 2024 10:46:20 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952412#M212102</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2024-05-27T10:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: BE. How to better translate this matlab code into Mathcad Prime implementation?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952429#M212104</link>
      <description>&lt;P&gt;And this? Value and time at that lowest part/point.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1716810003704.png" style="width: 748px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105150iE96585747D251BC9/image-dimensions/748x476?v=v2" width="748" height="476" role="button" title="Cornel_0-1716810003704.png" alt="Cornel_0-1716810003704.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 11:40:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952429#M212104</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-05-27T11:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: BE. How to better translate this matlab code into Mathcad Prime implementation?</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952445#M212105</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_2-1716811634373.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105156iA561B946A5B4182E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_2-1716811634373.png" alt="Werner_E_2-1716811634373.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1716811509199.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/105154i00BCEB34DFD26245/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1716811509199.png" alt="Werner_E_0-1716811509199.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 12:07:31 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/BE-How-to-better-translate-this-matlab-code-into-Mathcad-Prime/m-p/952445#M212105</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2024-05-27T12:07:31Z</dc:date>
    </item>
  </channel>
</rss>

