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

Allow for simplifying units by expanding SI derived units #406

Closed
beastr45 opened this issue Oct 10, 2024 · 1 comment
Closed

Allow for simplifying units by expanding SI derived units #406

beastr45 opened this issue Oct 10, 2024 · 1 comment

Comments

@beastr45
Copy link

beastr45 commented Oct 10, 2024

insect does a great job but when using SI derived units such as newtons, the units are more complex than they need to be. Instead of breaking units such as newtons into the SI derived units insect will display the units in terms of the unit supplied. With complex units given by insect further unit analysis is necessary.

An example of this is when dividing force by acceleration. The units of the answer should be kg since F=ma , Instead insect gives s^2*N/m although the units are correct, Ideally the answer should be kg.

In order to fix this I would recommend adding the functionality to break up SI derived units while calculating units and then show the least complicated units after simplifying as an answer. It may be wise to disallow this functionality if the resulting unit is not one of the SI derived units to avoid confusion with units like kg^2⋅m^2⋅s^−3 which could be a watt kilogram, joule/s kilogram or a newton meter per second kilogram. I would recommend adding a command to display the units result purely in SI units if the user wants to do more analysis themselves.

@sharkdp
Copy link
Owner

sharkdp commented Dec 27, 2024

Please consider using the follow-up project: https://numbat.dev/

An example of this is when dividing force by acceleration. The units of the answer should be kg since F=ma , Instead insect gives s^2*N/m although the units are correct, Ideally the answer should be kg.

Right. In Numbat, the situation is slightly better, because you will see the inferred dimension of Mass:

>>> s^2*N/m

    = 1 N·s²/m    [Mass]

But we don't have full simplification yet. See sharkdp/numbat#89 and sharkdp/numbat#116 for more details.

@sharkdp sharkdp closed this as completed Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@sharkdp @beastr45 and others