<?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: Matrix exponential function via Taylor's series in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937117#M210752</link>
    <description>&lt;P&gt;And also your function:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1710496314913.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100232i522D31C042845084/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_0-1710496314913.png" alt="Cornel_0-1710496314913.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_1-1710496322655.png" style="width: 293px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100233i64EBBF31C9A51C8A/image-dimensions/293x331?v=v2" width="293" height="331" role="button" title="Cornel_1-1710496322655.png" alt="Cornel_1-1710496322655.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>Fri, 15 Mar 2024 09:52:14 GMT</pubDate>
    <dc:creator>Cornel</dc:creator>
    <dc:date>2024-03-15T09:52:14Z</dc:date>
    <item>
      <title>Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/936955#M210745</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I found this file&amp;nbsp;&lt;A href="https://user.eng.umd.edu/~nsw/chbe250/expm.pdf" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Mathcad - expm.xmcd&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;where it calculates:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1710424822428.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100176i855D9CB15C76BFAF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_0-1710424822428.png" alt="Cornel_0-1710424822428.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;It seems that the calculation of exponential with exponent a matrix it is more rapidly done in this way than using e^([matrix]) in Mathcad Prime.&lt;BR /&gt;&lt;BR /&gt;I put this in a Mathcad file (see MCP9 attached file), but I am not sure if I did things correctly (like I do not see a influence of that if 0&amp;lt;n) and I do not fully understand the procedure/calculation (I see that there is 2 methods. What are the difference between them? What is better to use?)&lt;BR /&gt;&lt;BR /&gt;Can someone check and explain the procedure/calculation if understand it?&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_2-1710424864799.png" style="width: 590px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100178i3218B858D386ECD0/image-dimensions/590x155?v=v2" width="590" height="155" role="button" title="Cornel_2-1710424864799.png" alt="Cornel_2-1710424864799.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_1-1710424853105.png" style="width: 551px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100177i256380748CBEDB3F/image-dimensions/551x995?v=v2" width="551" height="995" role="button" title="Cornel_1-1710424853105.png" alt="Cornel_1-1710424853105.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 14:12:44 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/936955#M210745</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-03-14T14:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/936965#M210746</link>
      <description>&lt;P&gt;I also see that it cannot be evaluated symbolically. This method will work only for numeric values, right? Or is it possible to make also to work with symbolic variable?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1710426482001.png" style="width: 722px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100185i0ABE99AAD140F1DE/image-dimensions/722x748?v=v2" width="722" height="748" role="button" title="Cornel_0-1710426482001.png" alt="Cornel_0-1710426482001.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 14:28:15 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/936965#M210746</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-03-14T14:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/936984#M210747</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;I also see that it cannot be evaluated symbolically. This method will work only for numeric values, right? Or is it possible to make also to work with symbolic variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The function uses an approximation (just 21 summands of the Taylor series expansion). So it would not make much sense to evaluate it symbolically.&lt;/P&gt;
&lt;P&gt;Furthermore, because of this 21 summands, the result would be rather large!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason for the while-loop and the continuous division of the matrix A by 2 is to make A small enough so that 21 summand of the series expansion provide enough precision (faster convergence).&lt;/P&gt;
&lt;P&gt;You could as well do without but you will have to use much more summands to get a decent precision if the values of the matrix elements are larger.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1710431169183.png" style="width: 656px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100186i8C2700CC38261BA5/image-dimensions/656x296?v=v2" width="656" height="296" role="button" title="Werner_E_0-1710431169183.png" alt="Werner_E_0-1710431169183.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="Werner_E_1-1710431421625.png" style="width: 697px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100187iA1F83ABCC157A880/image-dimensions/697x380?v=v2" width="697" height="380" role="button" title="Werner_E_1-1710431421625.png" alt="Werner_E_1-1710431421625.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you feel like doing so you may evaluate expm2 symbolically with symbolic variables &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;You could also rewrite the original function an can determine the value of n and the divided matrix using logarithms. That way the function could be evaluated symbolically. But it does not make sense to write an approximation for exp() and using ln() to do so.&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;</description>
      <pubDate>Thu, 14 Mar 2024 16:00:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/936984#M210747</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2024-03-14T16:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937028#M210748</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_2-1710438984170.png" style="width: 566px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100203iEC6A587C2DAB12E2/image-dimensions/566x439?v=v2" width="566" height="439" role="button" title="Cornel_2-1710438984170.png" alt="Cornel_2-1710438984170.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="Cornel_1-1710438905272.png" style="width: 561px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100202i3932BE7976044D64/image-dimensions/561x424?v=v2" width="561" height="424" role="button" title="Cornel_1-1710438905272.png" alt="Cornel_1-1710438905272.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 17:56:07 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937028#M210748</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-03-14T17:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937045#M210749</link>
      <description>&lt;P&gt;So floating point limits are yet another reason for not using expm2() and rather staying with the original expm().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, here is a version which also can be evaluated using a symbolical matrix.&lt;/P&gt;
&lt;P&gt;I didn't wait for the calculation to finish, though, as it does not make any sense at all to evaluate a numerical approximation with symbols.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1710451877449.png" style="width: 793px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100210i943D77E1DC50E26D/image-dimensions/793x300?v=v2" width="793" height="300" role="button" title="Werner_E_0-1710451877449.png" alt="Werner_E_0-1710451877449.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You may use a lower number like 2 or 3 instead of the 20 to see what expression you can expect from a symbolic eval.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I used just 1 instead of 20:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_1-1710452494337.png" style="width: 999px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100211iD78B0595C16C45FA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Werner_E_1-1710452494337.png" alt="Werner_E_1-1710452494337.png" /&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;</description>
      <pubDate>Thu, 14 Mar 2024 21:41:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937045#M210749</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2024-03-14T21:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937111#M210751</link>
      <description>&lt;P&gt;I am thinking to use this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_3-1710496045861.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100229i91D7FC1D8E3265BF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_3-1710496045861.png" alt="Cornel_3-1710496045861.png" /&gt;&lt;/span&gt;&lt;BR /&gt;What do you think&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/66934"&gt;@Werner_E&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;It works for symbolics:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_1-1710495941066.png" style="width: 791px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100227i984C683343B05B38/image-dimensions/791x342?v=v2" width="791" height="342" role="button" title="Cornel_1-1710495941066.png" alt="Cornel_1-1710495941066.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;And also for numerics:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_2-1710495965276.png" style="width: 806px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100228iB35D14381351F832/image-dimensions/806x250?v=v2" width="806" height="250" role="button" title="Cornel_2-1710495965276.png" alt="Cornel_2-1710495965276.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;EDIT:...yeah, but it suffers for same problem:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_5-1710496170114.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100231iEBDB2870B4D43532/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_5-1710496170114.png" alt="Cornel_5-1710496170114.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>Fri, 15 Mar 2024 09:49:44 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937111#M210751</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-03-15T09:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937117#M210752</link>
      <description>&lt;P&gt;And also your function:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_0-1710496314913.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100232i522D31C042845084/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_0-1710496314913.png" alt="Cornel_0-1710496314913.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_1-1710496322655.png" style="width: 293px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100233i64EBBF31C9A51C8A/image-dimensions/293x331?v=v2" width="293" height="331" role="button" title="Cornel_1-1710496322655.png" alt="Cornel_1-1710496322655.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>Fri, 15 Mar 2024 09:52:14 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937117#M210752</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-03-15T09:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937120#M210753</link>
      <description>&lt;P&gt;But I see that this is ok:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cornel_2-1710496395075.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100234iE953FB63A3229775/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cornel_2-1710496395075.png" alt="Cornel_2-1710496395075.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_3-1710496416657.png" style="width: 713px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/100235i45CACE10A3918009/image-dimensions/713x123?v=v2" width="713" height="123" role="button" title="Cornel_3-1710496416657.png" alt="Cornel_3-1710496416657.png" /&gt;&lt;/span&gt;&lt;BR /&gt;But this implementation of expm function does not work for symbolics...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 09:54:35 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937120#M210753</guid>
      <dc:creator>Cornel</dc:creator>
      <dc:date>2024-03-15T09:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix exponential function via Taylor's series</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937136#M210754</link>
      <description>&lt;P&gt;You have to decide what you use depending on your &lt;STRONG&gt;needs&lt;/STRONG&gt;!!&lt;/P&gt;
&lt;P&gt;And its completely unclear to me, what your needs are, why you would need a function like this with results going up to the IEEE limit of 10^307 or why you would like to symbolically evaluate of an appoiximation!!??&lt;/P&gt;
&lt;P&gt;So its your choice ...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 10:43:42 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Matrix-exponential-function-via-Taylor-s-series/m-p/937136#M210754</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2024-03-15T10:43:42Z</dc:date>
    </item>
  </channel>
</rss>

