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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

What is the difference in units positions in MathCad

YA_10963798
14-Alexandrite

What is the difference in units positions in MathCad

I have a question >> What it is the difference when mathcad write the unit of a resulte inside the brackets [result*Unit] and outside [result]* unit?

YA_10963798_0-1734697237736.png

is there any difference ? and how to make all units showed the same way?

Thanks in advance

Yusra 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:YA_10963798)

If all elements of a vector/matrix are of the same dimension, then Prime uses to place the unit (for all elements) after the matrix and you are also allowed to change this unit to something you like more.

If the matrix contains quantities of different dimensions, Prime places the units right to the values inside the matrix and unfortunately does not allow to change this unit directly. You can write a different unit after the matrix and Prime will change the units inside the matrix accordingly - sometimes with unexpected effects.

In case of nested matrices Prime seems to show units only if all the dimensions in a 'subvector' are the same. Manually editing the unit at the end of the matrix without expanding nested matrices has a strange effect which maybe also could be called a bug...?

Werner_E_0-1734698627913.png

 

 

View solution in original post

6 REPLIES 6
Werner_E
25-Diamond I
(To:YA_10963798)

If all elements of a vector/matrix are of the same dimension, then Prime uses to place the unit (for all elements) after the matrix and you are also allowed to change this unit to something you like more.

If the matrix contains quantities of different dimensions, Prime places the units right to the values inside the matrix and unfortunately does not allow to change this unit directly. You can write a different unit after the matrix and Prime will change the units inside the matrix accordingly - sometimes with unexpected effects.

In case of nested matrices Prime seems to show units only if all the dimensions in a 'subvector' are the same. Manually editing the unit at the end of the matrix without expanding nested matrices has a strange effect which maybe also could be called a bug...?

Werner_E_0-1734698627913.png

 

 

MartinHanak_0-1734702310672.png

 


Martin Hanák
Werner_E
25-Diamond I
(To:MartinHanak)

Yes, that's why I wrote "without expanding" 😉

YA_10963798
14-Alexandrite
(To:Werner_E)

does that affect the results, or just the units?

Werner_E
25-Diamond I
(To:YA_10963798)


@YA_10963798 wrote:

does that affect the results, or just the units?


In itself, it is only a representation problem of (nested) matrices. But of course the numbers in the matrix are adjusted accordingly if you change the unit at the back.

StuartBruff
23-Emerald III
(To:YA_10963798)

You also need to be careful if you have NaNs in your results.   A NaN will attract the units of the first element with units in a matrix.   

 

I noticed it in this thread: https://community.ptc.com/t5/Mathcad/Vectorizing-SIUnitsOf-over-array-containing-NaN/m-p/981787/highlight/true#M214833

 

There is a bug report in the system that will hopefully deal with this issue in a (not too distant) future version.

 

I also found that it was commented on in this thread back in January 2023: https://community.ptc.com/t5/Mathcad/Having-fun-with-NaNs-and-mixed-units-in-matrices/m-p/852699/highlight/true#M204913. I was unaware of this thread until I searched for my thread; I also found the '0' problem and that behaviour should also be addressed as part of the same bug report.

 

Stuart

Announcements

Top Tags