Mathematica seems confused about Kilograms vs KilogramsForce












8












$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}$.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    And Quantity[1, "Kilograms*Meters^2"] // InputForm is interpreted correctly
    $endgroup$
    – Gustavo Delfino
    Feb 19 at 14:16






  • 1




    $begingroup$
    KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
    $endgroup$
    – MikeY
    Feb 19 at 20:45










  • $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
    Feb 20 at 1:21


















8












$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}$.










share|improve this question











$endgroup$








  • 2




    $begingroup$
    And Quantity[1, "Kilograms*Meters^2"] // InputForm is interpreted correctly
    $endgroup$
    – Gustavo Delfino
    Feb 19 at 14:16






  • 1




    $begingroup$
    KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
    $endgroup$
    – MikeY
    Feb 19 at 20:45










  • $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
    Feb 20 at 1:21
















8












8








8


1



$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}$.










share|improve this question











$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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 19 at 13:12







Roman

















asked Feb 19 at 13:04









RomanRoman

1,870714




1,870714








  • 2




    $begingroup$
    And Quantity[1, "Kilograms*Meters^2"] // InputForm is interpreted correctly
    $endgroup$
    – Gustavo Delfino
    Feb 19 at 14:16






  • 1




    $begingroup$
    KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
    $endgroup$
    – MikeY
    Feb 19 at 20:45










  • $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
    Feb 20 at 1:21
















  • 2




    $begingroup$
    And Quantity[1, "Kilograms*Meters^2"] // InputForm is interpreted correctly
    $endgroup$
    – Gustavo Delfino
    Feb 19 at 14:16






  • 1




    $begingroup$
    KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
    $endgroup$
    – MikeY
    Feb 19 at 20:45










  • $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
    Feb 20 at 1:21










2




2




$begingroup$
And Quantity[1, "Kilograms*Meters^2"] // InputForm is interpreted correctly
$endgroup$
– Gustavo Delfino
Feb 19 at 14:16




$begingroup$
And Quantity[1, "Kilograms*Meters^2"] // InputForm is interpreted correctly
$endgroup$
– Gustavo Delfino
Feb 19 at 14:16




1




1




$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
Feb 19 at 20:45




$begingroup$
KilogramForce are the devil's work. Like HectareVolume or WattTime. :)
$endgroup$
– MikeY
Feb 19 at 20:45












$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
Feb 20 at 1:21






$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
Feb 20 at 1:21












1 Answer
1






active

oldest

votes


















9












$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:



enter image description here



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"|>}]






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
    $endgroup$
    – Roman
    Feb 19 at 14:38






  • 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
    Feb 19 at 15:00











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
});


}
});














draft saved

draft discarded


















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









9












$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:



enter image description here



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"|>}]






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
    $endgroup$
    – Roman
    Feb 19 at 14:38






  • 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
    Feb 19 at 15:00
















9












$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:



enter image description here



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"|>}]






share|improve this answer











$endgroup$









  • 1




    $begingroup$
    Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
    $endgroup$
    – Roman
    Feb 19 at 14:38






  • 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
    Feb 19 at 15:00














9












9








9





$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:



enter image description here



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"|>}]






share|improve this answer











$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:



enter image description here



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"|>}]







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 19 at 18:27

























answered Feb 19 at 14:10









Chip HurstChip Hurst

21.8k15790




21.8k15790








  • 1




    $begingroup$
    Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
    $endgroup$
    – Roman
    Feb 19 at 14:38






  • 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
    Feb 19 at 15:00














  • 1




    $begingroup$
    Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
    $endgroup$
    – Roman
    Feb 19 at 14:38






  • 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
    Feb 19 at 15:00








1




1




$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
Feb 19 at 14:38




$begingroup$
Ha that's full-on en.wikipedia.org/wiki/Robopsychology ! Thanks @ChipHurst, this is at least a partial answer.
$endgroup$
– Roman
Feb 19 at 14:38




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
Feb 19 at 15:00




$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
Feb 19 at 15:00


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents