Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImprove simplification of physical quantities #37
Comments
sharkdp
added
idea
prio
labels
Mar 18, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
itdaniher
Mar 21, 2017
Possibly related:
Welcome to insect. Type '?' if this is your first visit.
> 1 watt -> joules
Cannot unify unit 'W' with unit 'J'
> joules
1J
> watt
1W
compare to gnu units expansion and simplification:
You have: 1 watt
You want: 1 joule
conformability error
1 kg m^2 / s^3
1 kg m^2 / s^2
You have: 1 watt
You want:
Definition: 1 kg m^2 / s^3
You have: 1 joule
You want:
Definition: 1 kg m^2 / s^2
the latter explains this issue at hand and relates it to physical quantities, allowing a user to debug their expression.
This is by far my favorite feature of gnu units and make-or-break for a CAS-like system that offers dimensional analysis and unit conversion.
Definitely interesting work overall, I would love to see this replace connectbot + gnu units or wolfram for basic engineering math.
Regards!
itdaniher
commented
Mar 21, 2017
|
Possibly related:
compare to gnu units expansion and simplification:
the latter explains this issue at hand and relates it to physical quantities, allowing a user to debug their expression. This is by far my favorite feature of gnu units and make-or-break for a CAS-like system that offers dimensional analysis and unit conversion. Definitely interesting work overall, I would love to see this replace connectbot + gnu units or wolfram for basic engineering math. Regards! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sharkdp
Mar 21, 2017
Owner
@itdaniher That's a cool feature, indeed! Thank you for the feedback... I think this is something that could be implemented rather easily.
|
@itdaniher That's a cool feature, indeed! Thank you for the feedback... I think this is something that could be implemented rather easily. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
itdaniher
commented
Mar 21, 2017
|
Happy to share! I'll be keeping an eye on this project for sure. |
added a commit
that referenced
this issue
Mar 24, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sharkdp
Mar 24, 2017
Owner
@itdaniher This feature is now supported:
> 1 watt -> joules
Unification error:
Cannot unify unit W (base units: m²·g/s³)
with unit J (base units: m²·g/s²)
> g0 * 40s + 5m
Unification error:
Cannot unify unit m (base units: m)
with unit m/s (base units: m/s)
|
@itdaniher This feature is now supported:
|
sharkdp
closed this
in
2707028
Mar 30, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sharkdp
Mar 30, 2017
Owner
Simplification is now supported:
>>> 5Mbit/s * 2h
(5Mbit / s) × 2h
= 36000Mbit
>>> 5cm * 5m
5cm × 5m
= 2500cm²
>>> 120km/h * 2min
(120km / h) × 2min
= 4km
|
Simplification is now supported:
|
sharkdp commentedMar 18, 2017
•
edited
Edited 1 time
-
sharkdp
edited Mar 30, 2017 (most recent)
An input like
should be simplified to
36 Gbit, i.e. units of the same dimension should always be unified (here:secondandhour). Similarlyshould be simplified to either
0.25m²or2500cm²This is related to sharkdp/purescript-quantities#16