Skip to main content
9-Granite
December 30, 2018
Solved

Inverting a matrix

  • December 30, 2018
  • 3 replies
  • 6896 views

I am trying to invert a matrix using the variable names already declared.  I can invert the matrix if I manually enter the values of the variables, but not using the variable names.

 

I am obviously missing something and would be grateful for any guidance towards resolving the issue.

 

I attach the entire worksheet but I am only interested in comments on step 5 where the matrix manipulation appears.  I have left notes on the draft section of the page to show what the variable values are and what the problem is.

 

Kind regards and New Year's greetings to all.

Best answer by terryhendicott

Hi,

This was subtle.

Back in sections 3, the results for the Y's are actually a matrix with one element not a single numeric result.

The same occurs for the Node values in step 4.  The answer is a 1 x 1 matrix.  

For instance:-

Capture.JPG

One is a 1x1 matrix as indicated by the square brackets.  The other is a single numeric result.

Your file Admittance was a matrix made up of nested 1x1 matrices and could not be inverted.  But your B matrix that had just the values not the nested form works.

 

Correct file enclosed.

3 replies

klax9-GraniteAuthor
9-Granite
January 2, 2019

I should have added that I am using Mathcad prime version 5.0.0.0

 

Kind regards

25-Diamond I
January 2, 2019

The reason for you problem is that the elements you put in your Admittance matrix (A[0,4, etc) are not scalars but 1x1 matrices.

The reason for this is that you use the row operator to access the elements of the vector "length" instead of the vector index like "length[0".

If you fix this the inverse matrix calculates without problems. See attached.

 

BTW, in Prime its a good idea to assign units to zero values, too.

 

EDIT: Just saw that Terry was faster 😉

 

 

klax9-GraniteAuthor
9-Granite
January 2, 2019
Thank you Fred. I will change the way I format the prior calculations in
the future. Your point about units is noted – thanks.



Kind Regards
23-Emerald I
January 2, 2019

I can't open your version 5 (only have 4), but the simple example attached should demonstrate that you can.

klax9-GraniteAuthor
9-Granite
January 2, 2019

Thanks Fred.  I can do the same but when I try as shown on the attached word document, I cannot do it.

 

On the draft side of the document you will see some text and some tests I have been trying.  If I add the values for the variables, then it works OK.

 

I cannot quickly see how to save the file as a Prime 4 version.

 

Kind Regards

 

21-Topaz II
January 2, 2019

Hi,

This was subtle.

Back in sections 3, the results for the Y's are actually a matrix with one element not a single numeric result.

The same occurs for the Node values in step 4.  The answer is a 1 x 1 matrix.  

For instance:-

Capture.JPG

One is a 1x1 matrix as indicated by the square brackets.  The other is a single numeric result.

Your file Admittance was a matrix made up of nested 1x1 matrices and could not be inverted.  But your B matrix that had just the values not the nested form works.

 

Correct file enclosed.

21-Topaz II
January 2, 2019

Hi a postscript.

I should show you how to correct the equations to make it simpler.

 

Capture.JPG

The first equation takes the first row of Length as a matrix and returns a matrix,

The second equation takes a value from the first element of Length and returns it as a value

 

Cheers

Terry

klax9-GraniteAuthor
9-Granite
January 2, 2019

Got it!  Thanks again.  Most helpful.