<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Automating matrix calculations</title>
    <link>http://www.mapleprimes.com/questions/143987-Automating-Matrix-Calculations</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Sat, 13 Jun 2026 18:25:06 GMT</lastBuildDate>
    <pubDate>Sat, 13 Jun 2026 18:25:06 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Automating matrix calculations</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Automating matrix calculations</title>
      <link>http://www.mapleprimes.com/questions/143987-Automating-Matrix-Calculations</link>
    </image>
    <item>
      <title>Simple solution</title>
      <link>http://www.mapleprimes.com/questions/143987-Automating-Matrix-Calculations?ref=Feed:MaplePrimes:Automating matrix calculations:Comments#answer143990</link>
      <itunes:summary>&lt;p&gt;Since Ts and Ths are lists of matrices and Q is a matrix, you could do&lt;br&gt;Qb:=[seq(Ts[i]^(-1).Q.Ths[i],i=1..nops(Ts))];&lt;br&gt;to get a list of the matrices you need.&lt;/p&gt;
&lt;p&gt;Another way:&lt;/p&gt;
&lt;p&gt;Qb:=Ts^~(-1).~[Q$nops(Ts)].~Ths;&lt;/p&gt;
&lt;p&gt;I find the first one easier to understand.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Since Ts and Ths are lists of matrices and Q is a matrix, you could do&lt;br&gt;Qb:=[seq(Ts[i]^(-1).Q.Ths[i],i=1..nops(Ts))];&lt;br&gt;to get a list of the matrices you need.&lt;/p&gt;
&lt;p&gt;Another way:&lt;/p&gt;
&lt;p&gt;Qb:=Ts^~(-1).~[Q$nops(Ts)].~Ths;&lt;/p&gt;
&lt;p&gt;I find the first one easier to understand.&lt;/p&gt;</description>
      <guid>143990</guid>
      <pubDate>Thu, 28 Feb 2013 07:27:28 Z</pubDate>
      <itunes:author>Preben Alsholm</itunes:author>
      <author>Preben Alsholm</author>
    </item>
    <item>
      <title>radians and zip</title>
      <link>http://www.mapleprimes.com/questions/143987-Automating-Matrix-Calculations?ref=Feed:MaplePrimes:Automating matrix calculations:Comments#answer143993</link>
      <itunes:summary>&lt;p&gt;Before answering your main question, I want to point out that angles need to be in radians in Maple. You can enter them in degrees and then convert to radians, like this&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Angles:= [30, 60, 90];&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;Angles:= Angles *~ Pi/180:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;or&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Angles:= map(convert, Angles *~ degrees, radians):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Second, in my previous post, I said that you'd probably want to use more than 4 digits in actual practice, but you kept it at 4. You should change all occurences of &lt;strong&gt;evalf[4]&lt;/strong&gt; to &lt;strong&gt;evalf[15] &lt;/strong&gt;or simply &lt;strong&gt;evalf&lt;/strong&gt; (for reasons that I won't go into here, 15 digits usually gives the optimal balance of speed and accuracy).&lt;/p&gt;
&lt;p&gt;Third, you should probably use different names for the two &lt;strong&gt;Constructor&lt;/strong&gt; procedures: the one that constructs the &lt;strong&gt;Ts&lt;/strong&gt; and the one that constructs the &lt;strong&gt;Ths&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now for your main questions. You have two lists of eight matrices each, &lt;strong&gt;Ts&lt;/strong&gt; and &lt;strong&gt;Ths&lt;/strong&gt;, and a single matrix &lt;strong&gt;Q&lt;/strong&gt;, and you want to compute a list of matrices &lt;strong&gt;Qb&lt;/strong&gt; such that &lt;strong&gt;Qb[k] = Ts[k]^(-1).Q.Ths[k] &lt;/strong&gt;for &lt;strong&gt;k &lt;/strong&gt;from 1 to 8. Here are two ways do that:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Qb:= [seq](Ts[k]^(-1).Q.Ths[k], k= 1..8):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;or&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Qb:= zip((X,Y)-&amp;gt; X^(-1).Q.Y, Ts, Ths):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Finally, you want to construct a 6x6 matrix from 3x3 matrices &lt;strong&gt;A&lt;/strong&gt;, &lt;strong&gt;B&lt;/strong&gt;, and &lt;strong&gt;D&lt;/strong&gt;, with pattern&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A B&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;B D&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The command for this is&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;M:= &amp;lt; &amp;lt; A | B &amp;gt; , &amp;lt; B | D &amp;gt; &amp;gt;:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Let me know if that is all clear to you!&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Before answering your main question, I want to point out that angles need to be in radians in Maple. You can enter them in degrees and then convert to radians, like this&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Angles:= [30, 60, 90];&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;Angles:= Angles *~ Pi/180:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;or&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Angles:= map(convert, Angles *~ degrees, radians):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Second, in my previous post, I said that you'd probably want to use more than 4 digits in actual practice, but you kept it at 4. You should change all occurences of &lt;strong&gt;evalf[4]&lt;/strong&gt; to &lt;strong&gt;evalf[15] &lt;/strong&gt;or simply &lt;strong&gt;evalf&lt;/strong&gt; (for reasons that I won't go into here, 15 digits usually gives the optimal balance of speed and accuracy).&lt;/p&gt;
&lt;p&gt;Third, you should probably use different names for the two &lt;strong&gt;Constructor&lt;/strong&gt; procedures: the one that constructs the &lt;strong&gt;Ts&lt;/strong&gt; and the one that constructs the &lt;strong&gt;Ths&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now for your main questions. You have two lists of eight matrices each, &lt;strong&gt;Ts&lt;/strong&gt; and &lt;strong&gt;Ths&lt;/strong&gt;, and a single matrix &lt;strong&gt;Q&lt;/strong&gt;, and you want to compute a list of matrices &lt;strong&gt;Qb&lt;/strong&gt; such that &lt;strong&gt;Qb[k] = Ts[k]^(-1).Q.Ths[k] &lt;/strong&gt;for &lt;strong&gt;k &lt;/strong&gt;from 1 to 8. Here are two ways do that:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Qb:= [seq](Ts[k]^(-1).Q.Ths[k], k= 1..8):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;or&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Qb:= zip((X,Y)-&amp;gt; X^(-1).Q.Y, Ts, Ths):&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Finally, you want to construct a 6x6 matrix from 3x3 matrices &lt;strong&gt;A&lt;/strong&gt;, &lt;strong&gt;B&lt;/strong&gt;, and &lt;strong&gt;D&lt;/strong&gt;, with pattern&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A B&lt;/strong&gt;&lt;br&gt;&lt;strong&gt;B D&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The command for this is&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;M:= &amp;lt; &amp;lt; A | B &amp;gt; , &amp;lt; B | D &amp;gt; &amp;gt;:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;Let me know if that is all clear to you!&lt;/p&gt;</description>
      <guid>143993</guid>
      <pubDate>Thu, 28 Feb 2013 08:23:25 Z</pubDate>
      <itunes:author>Carl Love</itunes:author>
      <author>Carl Love</author>
    </item>
  </channel>
</rss>