Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Looks like a conversion error between rpm and rad/s. #187

Open
loristns opened this issue Dec 28, 2018 · 7 comments
Open

Looks like a conversion error between rpm and rad/s. #187

loristns opened this issue Dec 28, 2018 · 7 comments
Labels

Comments

@loristns
Copy link

Tried to convert 10rpm to rad/s but it seems to give a bad result.

image
But 10rpm * 2pi / 60 = 1.047... rad/s

Is this a bug or am I using the tool the wrong way?

@sharkdp
Copy link
Owner

sharkdp commented Dec 28, 2018

Thank you for your feedback.

Looks like this is a duplicate of #50. Please see my answer there (#50 (comment)) and let me know if that makes sense.

@loristns
Copy link
Author

Thank you for the answer and sorry for the duplication.
This makes totally sense and I find the reason for this problem quite interesting in the end.

Perhaps it may be useful to have some kind of disclaimer when dealing with dimensionless units since mistakes may be silently returned.

Anyway, congratulations on this very useful project.

@sharkdp
Copy link
Owner

sharkdp commented Jan 8, 2019

Thank you for the answer and sorry for the duplication.
This makes totally sense and I find the reason for this problem quite interesting in the end.

👍

Perhaps it may be useful to have some kind of disclaimer when dealing with dimensionless units since mistakes may be silently returned.

That's kind of the reason why I wrote insect 😄 Calculating without units can be dangerous. Insect even provides a few "dummy" units like pixel, dot, frame, piece or person that can be used for calculations where most people would probably not put any unit at all:

  (2 piece / person) × (10 USD / piece) × 30 person

   = 600 USD

In your example, you could use one of these dummy units (say piece) to mean "rotation":

>>> 10 pieces per minute * 2 pi / piece -> rad / s

  (10 piece / min) × (2 × pi / piece) ➞ rad / s

   = 1.0472 rad/s

Anyway, I think the really confusing part here is probably the unit "rpm" which a lot of people think is somehow connected with "rotation" but is really just defined as "1 / min".

I guess we could add a section to the FAQs about calculations with RPM. What do you think?

@pierstitus
Copy link

pierstitus commented Nov 1, 2020

@sharkdp I'd like to reopen this issue, as I believe RPM is in fact defined incorrectly.

I understand the logic behind a radian being a m/m, hence a scalar. Also I agree RPM is the same base unit as Hz: 1/s, but it should be scaled so that 1 RPM is 2π / min.

That's the way it is done in GNU units:

You have: 1rpm
You want: radian/min
	* 6.2831853
	/ 0.15915494

Compared to the behaviour of insect:

  1 rpm ➞ rad / min

   = 1 rad/min

Also it makes sense to introduce the unit 'revolution(s)' or short 'rev', equal to 2π radians, so that you can define RPM as rev/min. That's the way it's done in GNU units also:

You have: rpm
You want: 
        Definition: rev/min = 0.10471976 radian / s

Actually in GNU units a revolution is defined as turn which is defined as circle which is defined as 2 pi radian. It might be useful to include those units too.

You have: revolution
You want: 
        Definition: turn = circle = 2 pi radian = 6.2831853 radian

Thanks for the great tool!

@sharkdp sharkdp reopened this Nov 2, 2020
@sharkdp
Copy link
Owner

sharkdp commented Nov 2, 2020

but it should be scaled so that 1 RPM is 2π / min.

Wikipedia actually talks about those two conflicting definitions:

If the non-SI unit rpm is considered a unit of frequency, then 1 rpm = 1/60 Hz. If it instead is considered a unit of angular velocity and the word "revolution" is considered to mean 2π radians, then 1 rpm = 2π/60 rad/s.

In insect, we chose the former ("RPM a unit of frequency"), while units apparently chose the latter ("unit of angular velocity").

I have added a FAQ entry (https://github.com/sharkdp/insect#faq) regarding RPM some time ago, but this keeps on popping up. So I guess it's time for me to reconsider my initial choice. The fact that we are not compatible with units is actually a valid reason to change our default.

If someone wants to make this change (and update the FAQ/documentation), I'd be okay with that.

Also it makes sense to introduce the unit 'revolution(s)' or short 'rev', equal to 2π radians, so that you can define RPM as rev/min.

Actually in GNU units a revolution is defined as turn which is defined as circle which is defined as 2 pi radian. It might be useful to include those units too.

Sounds like a great idea 👍

Thanks for the great tool!

Thank you very much for the feedback!

@pierstitus
Copy link

pierstitus commented Nov 4, 2020

If the non-SI unit rpm is considered a unit of frequency, then 1 rpm = 1/60 Hz

How I understand that is that the Hz is the one that can be interpreted differently, not rpm. So when 1 rpm = 1/60 Hz, then 1 Hz means one revolution per second (= 2π radians per second).

On the Hertz Wikipedia page that is explained more clearly:

Even though angular velocity, angular frequency and the unit hertz all have the dimension 1/s, angular velocity and angular frequency are not expressed in hertz,[10] but rather in an appropriate angular unit such as radians per second. Thus a disc rotating at 60 revolutions per minute (rpm) is said to be rotating at either 2π rad/s or 1 Hz, where the former measures the angular velocity and the latter reflects the number of complete revolutions per second.

Confusing stuff :) It does make sense to have angles be a dimension, but I guess the SI people have thought long about what would be the best choice. From the radian Wikipedia page:

The radian is defined as 1.[5] There is controversy as to whether it is satisfactory in the SI to consider angles to be dimensionless.[6] This can lead to confusion when considering the units for frequency and the Planck constant.[4][7]

But yeah, some things are the way they are, even though things could have been so much easier with decimal time, or even using base 12 as default instead of 10.

If someone wants to make this change (and update the FAQ/documentation), I'd be okay with that.

Good, as it feels like a good habit to try a new language every once in a while and I didn't try PureScript yet I might give it a try.

@sharkdp
Copy link
Owner

sharkdp commented Sep 28, 2023

In the follow-up project, Numbat, we can now easily play with this. If you are interested in more details, please see sharkdp/numbat#91 and sharkdp/numbat#167.

You can try the normal version of Numbat here (same behavior as Insect): https://numbat.dev/
And a modified version of Numbat with dimensionful angles here: https://numbat.dev/angles/

The latter version allows you to do:

I'd be glad to get some feedback on this.

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

No branches or pull requests

4 participants