Mathematica seems confused about Kilograms vs KilogramsForce
$begingroup$
This does what I expect:
Quantity["Kilograms"*"Meters"] // InputForm
Quantity[1, "Kilograms"*"Meters"]
This, on the other hand, bungles the units:
Quantity[1, "Kilograms*Meters"] // InputForm
Quantity[1, "KilogramsForce"*"Meters"]
Note that KilogramsForce
is a unit of force, not mass, and strictly different from Kilograms
. This is not a case of a subtle and understandable misinterpretation as in the case of Kelvins
vs KelvinsDifference
, but a parsing error.
- What do we need to be careful about when writing down units for parsing? How can we prevent parsing errors, other than splitting the units as in the first input line above?
- Are there other cases like this one?
- Is this a residue of Imperial Units parsing, where pounds and pounds-force are sometimes used interchangeably?
- Is this the result of an overly greedy way of interpreting a torque? This parsing error seems specific to the $text{kg}cdottext{m}$ unit and does not occur, e.g., with $text{kg}cdottext{s}$.
units
$endgroup$
add a comment |
$begingroup$
This does what I expect:
Quantity["Kilograms"*"Meters"] // InputForm
Quantity[1, "Kilograms"*"Meters"]
This, on the other hand, bungles the units:
Quantity[1, "Kilograms*Meters"] // InputForm
Quantity[1, "KilogramsForce"*"Meters"]
Note that KilogramsForce
is a unit of force, not mass, and strictly different from Kilograms
. This is not a case of a subtle and understandable misinterpretation as in the case of Kelvins
vs KelvinsDifference
, but a parsing error.
- What do we need to be careful about when writing down units for parsing? How can we prevent parsing errors, other than splitting the units as in the first input line above?
- Are there other cases like this one?
- Is this a residue of Imperial Units parsing, where pounds and pounds-force are sometimes used interchangeably?
- Is this the result of an overly greedy way of interpreting a torque? This parsing error seems specific to the $text{kg}cdottext{m}$ unit and does not occur, e.g., with $text{kg}cdottext{s}$.
units
$endgroup$
2
$begingroup$
AndQuantity[1, "Kilograms*Meters^2"] // InputForm
is interpreted correctly
$endgroup$
– Gustavo Delfino
14 hours ago
$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
7 hours ago
$begingroup$
Maybe it's time to retire the kilogram-force? According to the English Wikipedia, "Kilogram-force is a non-standard unit and is classified in SI Metric System as a unit that is unacceptable for use with SI." According to the German Wikipedia, "Das Kilopond ist per Gesetz seit 1. Januar 1978 in Deutschland für die Angabe der Kraft unzulässig und wurde durch das Newton ersetzt." ("The kilogram-force is disallowed by law in Germany since January 1st, 1978, and has been replaced by the Newton.")
$endgroup$
– Roman
3 hours ago
add a comment |
$begingroup$
This does what I expect:
Quantity["Kilograms"*"Meters"] // InputForm
Quantity[1, "Kilograms"*"Meters"]
This, on the other hand, bungles the units:
Quantity[1, "Kilograms*Meters"] // InputForm
Quantity[1, "KilogramsForce"*"Meters"]
Note that KilogramsForce
is a unit of force, not mass, and strictly different from Kilograms
. This is not a case of a subtle and understandable misinterpretation as in the case of Kelvins
vs KelvinsDifference
, but a parsing error.
- What do we need to be careful about when writing down units for parsing? How can we prevent parsing errors, other than splitting the units as in the first input line above?
- Are there other cases like this one?
- Is this a residue of Imperial Units parsing, where pounds and pounds-force are sometimes used interchangeably?
- Is this the result of an overly greedy way of interpreting a torque? This parsing error seems specific to the $text{kg}cdottext{m}$ unit and does not occur, e.g., with $text{kg}cdottext{s}$.
units
$endgroup$
This does what I expect:
Quantity["Kilograms"*"Meters"] // InputForm
Quantity[1, "Kilograms"*"Meters"]
This, on the other hand, bungles the units:
Quantity[1, "Kilograms*Meters"] // InputForm
Quantity[1, "KilogramsForce"*"Meters"]
Note that KilogramsForce
is a unit of force, not mass, and strictly different from Kilograms
. This is not a case of a subtle and understandable misinterpretation as in the case of Kelvins
vs KelvinsDifference
, but a parsing error.
- What do we need to be careful about when writing down units for parsing? How can we prevent parsing errors, other than splitting the units as in the first input line above?
- Are there other cases like this one?
- Is this a residue of Imperial Units parsing, where pounds and pounds-force are sometimes used interchangeably?
- Is this the result of an overly greedy way of interpreting a torque? This parsing error seems specific to the $text{kg}cdottext{m}$ unit and does not occur, e.g., with $text{kg}cdottext{s}$.
units
units
edited 15 hours ago
Roman
asked 15 hours ago
RomanRoman
1,586614
1,586614
2
$begingroup$
AndQuantity[1, "Kilograms*Meters^2"] // InputForm
is interpreted correctly
$endgroup$
– Gustavo Delfino
14 hours ago
$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
7 hours ago
$begingroup$
Maybe it's time to retire the kilogram-force? According to the English Wikipedia, "Kilogram-force is a non-standard unit and is classified in SI Metric System as a unit that is unacceptable for use with SI." According to the German Wikipedia, "Das Kilopond ist per Gesetz seit 1. Januar 1978 in Deutschland für die Angabe der Kraft unzulässig und wurde durch das Newton ersetzt." ("The kilogram-force is disallowed by law in Germany since January 1st, 1978, and has been replaced by the Newton.")
$endgroup$
– Roman
3 hours ago
add a comment |
2
$begingroup$
AndQuantity[1, "Kilograms*Meters^2"] // InputForm
is interpreted correctly
$endgroup$
– Gustavo Delfino
14 hours ago
$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
7 hours ago
$begingroup$
Maybe it's time to retire the kilogram-force? According to the English Wikipedia, "Kilogram-force is a non-standard unit and is classified in SI Metric System as a unit that is unacceptable for use with SI." According to the German Wikipedia, "Das Kilopond ist per Gesetz seit 1. Januar 1978 in Deutschland für die Angabe der Kraft unzulässig und wurde durch das Newton ersetzt." ("The kilogram-force is disallowed by law in Germany since January 1st, 1978, and has been replaced by the Newton.")
$endgroup$
– Roman
3 hours ago
2
2
$begingroup$
And
Quantity[1, "Kilograms*Meters^2"] // InputForm
is interpreted correctly$endgroup$
– Gustavo Delfino
14 hours ago
$begingroup$
And
Quantity[1, "Kilograms*Meters^2"] // InputForm
is interpreted correctly$endgroup$
– Gustavo Delfino
14 hours ago
$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
7 hours ago
$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
7 hours ago
$begingroup$
Maybe it's time to retire the kilogram-force? According to the English Wikipedia, "Kilogram-force is a non-standard unit and is classified in SI Metric System as a unit that is unacceptable for use with SI." According to the German Wikipedia, "Das Kilopond ist per Gesetz seit 1. Januar 1978 in Deutschland für die Angabe der Kraft unzulässig und wurde durch das Newton ersetzt." ("The kilogram-force is disallowed by law in Germany since January 1st, 1978, and has been replaced by the Newton.")
$endgroup$
– Roman
3 hours ago
$begingroup$
Maybe it's time to retire the kilogram-force? According to the English Wikipedia, "Kilogram-force is a non-standard unit and is classified in SI Metric System as a unit that is unacceptable for use with SI." According to the German Wikipedia, "Das Kilopond ist per Gesetz seit 1. Januar 1978 in Deutschland für die Angabe der Kraft unzulässig und wurde durch das Newton ersetzt." ("The kilogram-force is disallowed by law in Germany since January 1st, 1978, and has been replaced by the Newton.")
$endgroup$
– Roman
3 hours ago
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Under the hood, units not recognized by Quantity
use Wolfram|Alpha's NLP to parse the unit.
In this case we see there are 2 possibilities:
It's probably worth leaving feedback at the bottom of the Alpha page making your case that 'kilogram meters' should be the default for this query.
I don't think there's a way to access all possibilities in Quantity
and I think the best way to avoid this is to use the canonical form of the units from the beginning.
If that's not feasible, as a workaround you can stringify your entire input and use Interpreter
:
Interpreter["Quantity", AmbiguityFunction -> All]["1 Kilograms*Meters"]
AmbiguityList[
{Quantity[1, "KilogramsForce" "Meters"], Quantity[1, "Kilograms" "Meters"]},
"Kilograms*Meters",
{<|"Description" -> "kilogram-force meters"|>, <|"Description" -> "kilogram meters"|>}]
$endgroup$
1
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
1
$begingroup$
Considering how wide theInterpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly,Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and evenInterpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).
$endgroup$
– Roman
13 hours ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191816%2fmathematica-seems-confused-about-kilograms-vs-kilogramsforce%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Under the hood, units not recognized by Quantity
use Wolfram|Alpha's NLP to parse the unit.
In this case we see there are 2 possibilities:
It's probably worth leaving feedback at the bottom of the Alpha page making your case that 'kilogram meters' should be the default for this query.
I don't think there's a way to access all possibilities in Quantity
and I think the best way to avoid this is to use the canonical form of the units from the beginning.
If that's not feasible, as a workaround you can stringify your entire input and use Interpreter
:
Interpreter["Quantity", AmbiguityFunction -> All]["1 Kilograms*Meters"]
AmbiguityList[
{Quantity[1, "KilogramsForce" "Meters"], Quantity[1, "Kilograms" "Meters"]},
"Kilograms*Meters",
{<|"Description" -> "kilogram-force meters"|>, <|"Description" -> "kilogram meters"|>}]
$endgroup$
1
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
1
$begingroup$
Considering how wide theInterpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly,Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and evenInterpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).
$endgroup$
– Roman
13 hours ago
add a comment |
$begingroup$
Under the hood, units not recognized by Quantity
use Wolfram|Alpha's NLP to parse the unit.
In this case we see there are 2 possibilities:
It's probably worth leaving feedback at the bottom of the Alpha page making your case that 'kilogram meters' should be the default for this query.
I don't think there's a way to access all possibilities in Quantity
and I think the best way to avoid this is to use the canonical form of the units from the beginning.
If that's not feasible, as a workaround you can stringify your entire input and use Interpreter
:
Interpreter["Quantity", AmbiguityFunction -> All]["1 Kilograms*Meters"]
AmbiguityList[
{Quantity[1, "KilogramsForce" "Meters"], Quantity[1, "Kilograms" "Meters"]},
"Kilograms*Meters",
{<|"Description" -> "kilogram-force meters"|>, <|"Description" -> "kilogram meters"|>}]
$endgroup$
1
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
1
$begingroup$
Considering how wide theInterpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly,Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and evenInterpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).
$endgroup$
– Roman
13 hours ago
add a comment |
$begingroup$
Under the hood, units not recognized by Quantity
use Wolfram|Alpha's NLP to parse the unit.
In this case we see there are 2 possibilities:
It's probably worth leaving feedback at the bottom of the Alpha page making your case that 'kilogram meters' should be the default for this query.
I don't think there's a way to access all possibilities in Quantity
and I think the best way to avoid this is to use the canonical form of the units from the beginning.
If that's not feasible, as a workaround you can stringify your entire input and use Interpreter
:
Interpreter["Quantity", AmbiguityFunction -> All]["1 Kilograms*Meters"]
AmbiguityList[
{Quantity[1, "KilogramsForce" "Meters"], Quantity[1, "Kilograms" "Meters"]},
"Kilograms*Meters",
{<|"Description" -> "kilogram-force meters"|>, <|"Description" -> "kilogram meters"|>}]
$endgroup$
Under the hood, units not recognized by Quantity
use Wolfram|Alpha's NLP to parse the unit.
In this case we see there are 2 possibilities:
It's probably worth leaving feedback at the bottom of the Alpha page making your case that 'kilogram meters' should be the default for this query.
I don't think there's a way to access all possibilities in Quantity
and I think the best way to avoid this is to use the canonical form of the units from the beginning.
If that's not feasible, as a workaround you can stringify your entire input and use Interpreter
:
Interpreter["Quantity", AmbiguityFunction -> All]["1 Kilograms*Meters"]
AmbiguityList[
{Quantity[1, "KilogramsForce" "Meters"], Quantity[1, "Kilograms" "Meters"]},
"Kilograms*Meters",
{<|"Description" -> "kilogram-force meters"|>, <|"Description" -> "kilogram meters"|>}]
edited 10 hours ago
answered 14 hours ago
Chip HurstChip Hurst
21.5k15790
21.5k15790
1
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
1
$begingroup$
Considering how wide theInterpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly,Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and evenInterpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).
$endgroup$
– Roman
13 hours ago
add a comment |
1
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
1
$begingroup$
Considering how wide theInterpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly,Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and evenInterpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).
$endgroup$
– Roman
13 hours ago
1
1
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
14 hours ago
1
1
$begingroup$
Considering how wide the
Interpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly, Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and even Interpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).$endgroup$
– Roman
13 hours ago
$begingroup$
Considering how wide the
Interpreter
casts its net, its full reply is of limited use for an automated procedure and I cannot do better than pick its most likely answer (other than checking the ambiguity list manually). Surprisingly, Interpreter["Quantity", AmbiguityFunction -> All]["1 Second"]
gives four possible interpretations, and even Interpreter["Quantity", AmbiguityFunction -> All]["1 Meter"]
finds two ways of interpreting, even though these units are about as basic as it gets. NLP is not the right tool here, as it fails in unexpected ways (hence my reference to robopsychology).$endgroup$
– Roman
13 hours ago
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f191816%2fmathematica-seems-confused-about-kilograms-vs-kilogramsforce%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
And
Quantity[1, "Kilograms*Meters^2"] // InputForm
is interpreted correctly$endgroup$
– Gustavo Delfino
14 hours ago
$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
7 hours ago
$begingroup$
Maybe it's time to retire the kilogram-force? According to the English Wikipedia, "Kilogram-force is a non-standard unit and is classified in SI Metric System as a unit that is unacceptable for use with SI." According to the German Wikipedia, "Das Kilopond ist per Gesetz seit 1. Januar 1978 in Deutschland für die Angabe der Kraft unzulässig und wurde durch das Newton ersetzt." ("The kilogram-force is disallowed by law in Germany since January 1st, 1978, and has been replaced by the Newton.")
$endgroup$
– Roman
3 hours ago