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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Rank matrix with mixed units

ValeryOchkov
24-Ruby IV

Rank matrix with mixed units

Is it an error in Prime or I do somethink wrong? The Prime 2 sheet in attch.

rankUnitMatrix.png

1 ACCEPTED SOLUTION

Accepted Solutions

Solution:

But I think not all is correct in Prime! Jakov Kucan, where are yuo!?

17-17-EMF-symbol.png

View solution in original post

17 REPLIES 17

I think it is an error. Or?

rankUnitMatrixSimpl.png

I don't think it's an error. To find the rank of a matrix one has to perform some operations that involve subtraction of terms from different rows. This only makes sense if all the terms in the matrix are of the same type. The determinant works for your examp;les because items of different type are only multiplied together (which can make sense).

Alan

Fully agreed. I, too, won't consider this an error.

This only makes sense if all the terms in the matrix are of the same type.

And thats the reason the numeric processor fails - its aware of units. While I don't consider it a bug or error I can see that it could be convenient if Prime would see the unit not as a real unit but rather as a simple factor in that case.

The symbolic processor is not aware of units and treats it as normal (unknown) variables. Consequently a symbolic evaluation works.

21.12.png

I think must be so (the system has infinity numbers of solutions) - Prime must have a new rank function.

(I think I am a first man of the World who try to calculate a rank of one mixed units matrix. )

17-15-EMF-rank.png

Your routine can be written more compact using vectorization, but it (and yours) yields wrong results in some (not so rare) occasions:

21.12.png

Werner Exinger wrote:

Your routine can be written more compact using vectorization, but it (and yours) yields wrong results in some (not so rare) occasions:

21.12.png

Yes! My routine is better for education

And as in "old dood" Mathcad 15:

m := 1 km := 1000m V :=1 etc


Yes! My routine is better for education

Matter of taste and in this case I tend to disagree.

But the critical point is that the routine (both) aren't correct. They yield wrong results as in my second example. They shouldn't give a correct result ("if m=Ohm then rank is 1, otherwise its 2") or at least fail in the secon example if the units don't "match". Writing the routine that way would require loops instead of vectorization anyway 😉

I hope we have correct rank and others same functions in Prime 4.

Units still are not fully supported throughout - see changing display units for single elelements of a matrix or, as here some functions like rank.

In urgent need you may use the attached, which, when numerically evaluated gives the appropriate error message if the units don't fit and which can be used to get the correct result with symbolical eval. Unfortunately we can't put the latter in a single function as the intermediate numeric evaluation (matrix M2) is needed to get the units correctly simplified an cannot be achieved inside a program, AFAIK.

rank.png

Thanks, Werner.

(I will try to create one correct system for this circuit with rank(M)=rank(M1)=number of unknowns)

17-16-EMF-rank-symbol.png

Valery Ochkov wrote:

I will try to create one correct system for this circuit with rank(M)=rank(M1)=number of unknowns)

I think must be so:

17-16-EMF-rank-symbol.png

Solution:

But I think not all is correct in Prime! Jakov Kucan, where are yuo!?

17-17-EMF-symbol.png

As the symbolics is not aware of units its right.

21.12.png

But using a modifier like "fully" I would have expected muPad to give me a more complete result by telling me, that the rank = 2 only if V is not Omega*A and its 1 otherwise.

Valery Ochkov wrote:

See too http://communities.ptc.com/message/220306

????? There are no zeros in my example.

Werner Exinger wrote:

Valery Ochkov wrote:

See too http://communities.ptc.com/message/220306

????? There are no zeros in my example.

I would like to point the others part of this discussion - 0A or 0, 0V or 0 etc. in symbolic and numeric math.

Valery Ochkov wrote:

I would like to point the others part of this discussion - 0A or 0, 0V or 0 etc. in symbolic and numeric math.

But I thought that Jakov explained that sufficantly - its the price we have to pay for dynamic unit checking which enables units of different dimensions in one matrix.

I think it should be no problem to consequently write 0V instead of just 0.

Top Tags