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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Units Involving Matrix Math

JF_10371043
2-Guest

Units Involving Matrix Math

Hi everyone! New to posting here. Only slightly less new to MathCad as a whole.

 

I am using a matrix with unitless values, multiplied by a constant that has attached units. The resulting matrix shows units, but it won't allow me to change them. The constant's unit is a force, in tons, and the resulting matrix shows pounds. I was only able to alter the style/number of units displayed. 

 

A few points to clarify: I don't believe I can attach the sheet (work reasons), but if I have not provided some necessary info, I can add more images or provide detail. I have read some of the debate about units in MC on these boards. If the goal I am after in not attainable, that is fine, but I am here for specific information/knowledge. It is not up to me to rework the entire sheet to not include units then append them at the end, or something like that. I just need to know if we can change what we see now or no. Similar pre-comeback to any comments about the way we built the matrix with those text labels in it. I am open/interested in suggestions or alternatives (and I am already aware of embedding an Excel table as an option), but I do need an explicit answer regarding the basic "can this be done" form of my question.

Thanks for reading!InkedScreenshot 2022-07-19 161833_LI.jpg

3 REPLIES 3
Werner_E
25-Diamond I
(To:JF_10371043)

What you want do do unfortunately cannot be done. Main reason is because your matrix also contains strings (text).

It s a huge drawback that we cannot change the unit for single entries in a matrix. We can only change the unit for the whole matrix by using the placeholder after the matrix. This can have unexpected results if the matrix consists of different dimensions (which is not the case in your example) as you can see at the entry 5 Ohm in my picture and Matrix M1.

But even this does not work if the matrix also contains strings which cannot have any unit. Prime throws an error in that case (Matrix M2).

So you either have to get rid of the text entries in your matrix or you will have to live with pound instead of tons.

Werner_E_0-1658268940187.png

 

LucMeekes
23-Emerald III
(To:JF_10371043)

As Werner explained, with a matrix containing strings you cannot change the units of matrix elements:

LucMeekes_0-1658316330609.png

But you can divide out the unit before assembling the matrix:

LucMeekes_2-1658316495229.png

Success!
Luc

 

Werner_E
25-Diamond I
(To:LucMeekes)

Some remarks:

The eval of Matrix A in your pics shows unit kg because you set your sheet to unit system SI. The OP seems to have chosen unit system USCS and so will still see pounds (lb).

Careful with the different definitions of ton/tonne

Werner_E_0-1658327727515.png

@JF_10371043 

If you can live with a table without any units you may apply Luc's suggestion in that way:

B.png

 

Announcements

Top Tags