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

Advanced simplification #27

Open
sharkdp opened this issue Jun 25, 2017 · 4 comments
Open

Advanced simplification #27

sharkdp opened this issue Jun 25, 2017 · 4 comments

Comments

@sharkdp
Copy link
Owner

sharkdp commented Jun 25, 2017

For example:

Pa · m² -> N
J/s -> W

Idea: only apply simplifications that minimize the sum of the absolute value of all unit exponents.

@ghost
Copy link

ghost commented Feb 3, 2018

@sharkdp If I understood your conversation on reddit with doodle77 correctly: How about an explicit, unary simplification operator with a similar operator precedence like parentheses?

@sharkdp
Copy link
Owner Author

sharkdp commented Feb 3, 2018

@sauer2 Yes, that would also be an option! Instead of the unary operator, I was thinking of something like "convert to SI" or "convert to base" with a syntax similar to the normal conversion operator

<expr> -> SI
<expr> -> base

@nimashoghi
Copy link

nimashoghi commented Feb 3, 2018

@sharkdp How about a combination of automatic deduction as well as some sort of user-defined deduction guide?

For example, kg*m*s^(-2) gets converted to N by default, but we can also provide a deduction guide.

Below is the format I was thinking of:

<unit to look for> [explicit] -> <unit to convert to>
kg*m*s^(-2) -> default // resets to automatic conversion
kg*m*s^(-2) -> delete // removes any conversion (same as kg*m*s^(-2) -> kg*m*s^(-2))
N -> kg*m*s^(-2) // converts N and all units equivalent to N to kg*m*s^(-2)
N explicit -> kg*m*s^(-2) // only converts N to kg*m*s^(-2), but not all equivalents.

@ghost

This comment was marked as resolved.

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

2 participants