cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

SOLVED
Highlighted

## Inverting a matrix

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.

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

## Re: Inverting a matrix

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:- 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.

10 REPLIES 10

## Re: Inverting a matrix

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

Kind regards

## Re: Inverting a matrix

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

## Re: Inverting a matrix

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:- 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.

## Re: Inverting a matrix

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

## Re: Inverting a matrix

Hi a postscript.

I should show you how to correct the equations to make it simpler. 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

## Re: Inverting a matrix

Thank you very much Terry.  That is an excellent explanation.

## Re: Inverting a matrix

Got it!  Thanks again.  Most helpful.

## Re: Inverting a matrix

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 😉

## Re: Inverting a matrix

Thank you Fred. I will change the way I format the prior calculations in