Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Newtonmeters are displayed in the wrong order #708

Open
TS-CUBED opened this issue Feb 22, 2024 · 4 comments
Open

Newtonmeters are displayed in the wrong order #708

TS-CUBED opened this issue Feb 22, 2024 · 4 comments

Comments

@TS-CUBED
Copy link

Unitful seems to follow the ordering of dimensions in the MLT system, but if forces are defined in Newton it does not follow the order of the FLT convention.

The unit Nm for moment is displayed as mN

@TS-CUBED
Copy link
Author

Screenshot from 2024-05-19 23-22-16

@sostock
Copy link
Collaborator

sostock commented May 27, 2024

Currently, units and dimensions are ordered alphabetically (by their full name, i.e., m comes before N because Meter comes before Newton alphabetically). This order is used in the internal representation, not just for printing. In my opinion, we should not change the internal representation (it might break code that relies on it), but we could re-order the units for printing.

However, I am not familiar with the conventions you mentioned (MLT, FLT). Does MLT mean that the dimensions are printed in this order? Currently they are not (𝐋 comes before 𝐌):

julia> dimension(u"N*m")
𝐋^2 𝐌 𝐓^-2

@TS-CUBED
Copy link
Author

I don't know if there is a hard "law" for it. But in my experience the composed units are always presented in the MLT or FLT order:

N = kg m s^-2
J = N m = kg m^2 s^-2
W = N m s^-1 = kg m^2 s^-3

In any case the standard units for torque are all in the order [FL]: SI: Nm, US: lbf ft, lbf in, ...

Interestingly, your alphabetic ordering works out nicely in most other cases :-)

BTW: the situation is not made easier by naming common unit combinations in the LMT order, e.g., CGS or MKS (but those are all over the place with their capitalisation anyway).

@TS-CUBED
Copy link
Author

TS-CUBED commented May 27, 2024

Just checked in Matlab, and it's correct there (let's not dwell on the many rendering issues that violate engineering standards in that screenshot for the moment: upright for variables, italic for units? Should be the other way round, and definitely not mixed as in N and kg. Omitting the quantity just because its 1? Very questionable. Unitful and Latexify are much better there!):

image

In the case of Nm vs mN, the problem is also, that the space between the m and the N is too small to prevent my students to read it as milli-Newton :-)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants