<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Solving system of linear equations with  transpose matrix</title>
    <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 05:19:10 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 05:19:10 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Solving system of linear equations with  transpose matrix</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Solving system of linear equations with  transpose matrix</title>
      <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With</link>
    </image>
    <item>
      <title>two ways</title>
      <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With?ref=Feed:MaplePrimes:Solving system of linear equations with  transpose matrix:Comments#answer99113</link>
      <itunes:summary>&lt;p&gt;You can do it like you've described. But you can also just use the LeastSquares command.&lt;/p&gt;
&lt;pre&gt;&amp;gt; restart:
&amp;gt; with(LinearAlgebra):

&amp;gt; M := RandomMatrix(607,400,generator=0.0..10.0):
&amp;gt; B := RandomVector(607,generator=0.0..1.0):

&amp;gt; X1 := LeastSquares(M, B):
&amp;gt; res1 := M . X1 - B:
&amp;gt; add( res1[i]^2, i=1..607 );
                   20.31481555375303

&amp;gt; Norm( M^%T . (B - M . X1) );
                                         -13
                   4.52970994047063869 10   

&amp;gt; X2 := (M^%T . M)^(-1) . M^%T . B:
&amp;gt; res2 := (M . X2 - B):
&amp;gt; add( res2[i]^2, i=1..607 );
                   20.31481555375302

&amp;gt; Norm( M^%T . (B - M . X2) );
                                         -11
                   4.29691837666723586 10   
&lt;/pre&gt;
&lt;p&gt;By the way, you may want to rethink what you wrote about the dimensions of B being 400x1, instead of 607x1.&lt;/p&gt;
&lt;p&gt;Now, to slice up 400x1 Vector X into four pieces.&lt;/p&gt;
&lt;pre&gt;&amp;gt; for i from 1 to 4 do
&amp;gt;   piece[i] := X1[(i-1)*100+1 .. i*100];
&amp;gt; end do:

&amp;gt; Norm( X1 - Vector([piece[1],piece[2],piece[3],piece[4]]) ); # test it
                               0.
&lt;/pre&gt;</itunes:summary>
      <description>&lt;p&gt;You can do it like you've described. But you can also just use the LeastSquares command.&lt;/p&gt;
&lt;pre&gt;&amp;gt; restart:
&amp;gt; with(LinearAlgebra):

&amp;gt; M := RandomMatrix(607,400,generator=0.0..10.0):
&amp;gt; B := RandomVector(607,generator=0.0..1.0):

&amp;gt; X1 := LeastSquares(M, B):
&amp;gt; res1 := M . X1 - B:
&amp;gt; add( res1[i]^2, i=1..607 );
                   20.31481555375303

&amp;gt; Norm( M^%T . (B - M . X1) );
                                         -13
                   4.52970994047063869 10   

&amp;gt; X2 := (M^%T . M)^(-1) . M^%T . B:
&amp;gt; res2 := (M . X2 - B):
&amp;gt; add( res2[i]^2, i=1..607 );
                   20.31481555375302

&amp;gt; Norm( M^%T . (B - M . X2) );
                                         -11
                   4.29691837666723586 10   
&lt;/pre&gt;
&lt;p&gt;By the way, you may want to rethink what you wrote about the dimensions of B being 400x1, instead of 607x1.&lt;/p&gt;
&lt;p&gt;Now, to slice up 400x1 Vector X into four pieces.&lt;/p&gt;
&lt;pre&gt;&amp;gt; for i from 1 to 4 do
&amp;gt;   piece[i] := X1[(i-1)*100+1 .. i*100];
&amp;gt; end do:

&amp;gt; Norm( X1 - Vector([piece[1],piece[2],piece[3],piece[4]]) ); # test it
                               0.
&lt;/pre&gt;</description>
      <guid>99113</guid>
      <pubDate>Fri, 19 Nov 2010 10:12:41 Z</pubDate>
      <itunes:author>pagan</itunes:author>
      <author>pagan</author>
    </item>
    <item>
      <title>hm ...</title>
      <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With?ref=Feed:MaplePrimes:Solving system of linear equations with  transpose matrix:Comments#answer99119</link>
      <itunes:summary>&lt;p&gt;First I would care for correct dimensions in A.x=b, so it actually is a linear equation.&lt;/p&gt;
&lt;p&gt;LinearSolve should find a solution - but there may be more than only just 1&lt;br&gt;(or otherwise said: why should D be invertible?)&lt;/p&gt;
&lt;p&gt;Usually one can not see that in examples by random values, since generically&lt;br&gt;a matrix is invertible&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edited&lt;/strong&gt; for pagan: the reason that a 'test' fails is, that&amp;nbsp; Det(A) = 0 is an (analytical)&lt;br&gt;meager set, thus meating it has prob = 0 (as far as I remember that stuff), it is &lt;br&gt;like having probability f(x) = 0 in dimension = 1, i.e. that exactly just &lt;strong&gt;1&lt;/strong&gt; value is taken.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;First I would care for correct dimensions in A.x=b, so it actually is a linear equation.&lt;/p&gt;
&lt;p&gt;LinearSolve should find a solution - but there may be more than only just 1&lt;br&gt;(or otherwise said: why should D be invertible?)&lt;/p&gt;
&lt;p&gt;Usually one can not see that in examples by random values, since generically&lt;br&gt;a matrix is invertible&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edited&lt;/strong&gt; for pagan: the reason that a 'test' fails is, that&amp;nbsp; Det(A) = 0 is an (analytical)&lt;br&gt;meager set, thus meating it has prob = 0 (as far as I remember that stuff), it is &lt;br&gt;like having probability f(x) = 0 in dimension = 1, i.e. that exactly just &lt;strong&gt;1&lt;/strong&gt; value is taken.&lt;/p&gt;</description>
      <guid>99119</guid>
      <pubDate>Fri, 19 Nov 2010 17:26:00 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>Comment</title>
      <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With?ref=Feed:MaplePrimes:Solving system of linear equations with  transpose matrix:Comments#comment99138</link>
      <itunes:summary>&lt;p&gt;I'm sorry&amp;nbsp; b of dimension 607x1.&lt;/p&gt;
&lt;p&gt;the system of linear equations coming from solving a moudle in elasticity and this moudle used before for solving extra problems so&amp;nbsp;&amp;nbsp; A must be invertable.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;I'm sorry&amp;nbsp; b of dimension 607x1.&lt;/p&gt;
&lt;p&gt;the system of linear equations coming from solving a moudle in elasticity and this moudle used before for solving extra problems so&amp;nbsp;&amp;nbsp; A must be invertable.&lt;/p&gt;</description>
      <guid>99138</guid>
      <pubDate>Sat, 20 Nov 2010 00:44:48 Z</pubDate>
      <itunes:author>amrramadaneg</itunes:author>
      <author>amrramadaneg</author>
    </item>
    <item>
      <title>ok ... however</title>
      <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With?ref=Feed:MaplePrimes:Solving system of linear equations with  transpose matrix:Comments#comment99147</link>
      <itunes:summary>&lt;p&gt;Ok, if you know, that your A is (theoretical) invertible, it means that there is exactly &lt;strong&gt;1&lt;/strong&gt; solution.&lt;/p&gt;
&lt;p&gt;However you should not use the inverse of the matrix to find it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;it is 'expensive' ( = slow) to find the inverse&lt;/li&gt;
&lt;li&gt;it may be 'numerical unstable' to calculate it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Usually Maple cares quite well to for all while numerical solving that stuff, do not try to&lt;br&gt;to be better (except for very good reasons).&lt;/p&gt;
&lt;p&gt;Already using Digits:= round(evalhf(Digits)) [ = 14 on many machines] may give all&lt;br&gt; you need in going that way.&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;Ok, if you know, that your A is (theoretical) invertible, it means that there is exactly &lt;strong&gt;1&lt;/strong&gt; solution.&lt;/p&gt;
&lt;p&gt;However you should not use the inverse of the matrix to find it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;it is 'expensive' ( = slow) to find the inverse&lt;/li&gt;
&lt;li&gt;it may be 'numerical unstable' to calculate it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Usually Maple cares quite well to for all while numerical solving that stuff, do not try to&lt;br&gt;to be better (except for very good reasons).&lt;/p&gt;
&lt;p&gt;Already using Digits:= round(evalhf(Digits)) [ = 14 on many machines] may give all&lt;br&gt; you need in going that way.&lt;/p&gt;</description>
      <guid>99147</guid>
      <pubDate>Sat, 20 Nov 2010 02:36:26 Z</pubDate>
      <itunes:author>Axel Vogt</itunes:author>
      <author>Axel Vogt</author>
    </item>
    <item>
      <title>Pagan</title>
      <link>http://www.mapleprimes.com/questions/99112-Solving-System-Of-Linear-Equations-With?ref=Feed:MaplePrimes:Solving system of linear equations with  transpose matrix:Comments#comment99192</link>
      <itunes:summary>&lt;p&gt;thanks, pagan the method is good (LeastSquares), but my method gave the same results, Now i want to plot the 4 vectors i got from the order piece[i];&lt;/p&gt;
&lt;p&gt;Amr&lt;/p&gt;</itunes:summary>
      <description>&lt;p&gt;thanks, pagan the method is good (LeastSquares), but my method gave the same results, Now i want to plot the 4 vectors i got from the order piece[i];&lt;/p&gt;
&lt;p&gt;Amr&lt;/p&gt;</description>
      <guid>99192</guid>
      <pubDate>Sun, 21 Nov 2010 13:05:18 Z</pubDate>
      <itunes:author>amrramadaneg</itunes:author>
      <author>amrramadaneg</author>
    </item>
  </channel>
</rss>