Timeline for Why are Quantity and Units inconsistent with regular Mathematica behavior?
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 30, 2020 at 19:18 | comment | added | Michael E2 |
"WR has chosen the physicist's view of units" -- Have they really? Reference? Especially concerning Quantity[1, "m"] representing an approximate quantity. To me Quantity[] works exactly according to the mathematical conception of a unit being a distinguished basis vector. I'm not suggesting that one can meaningfully add quantities with distinct units. I think we agree on that. In the math view, vectors can be added only when from the same vector space. Where we disagree is whether a "margin of error" model or a "distinct vector space" model explains it, and whether quantities can be exact.
|
|
Nov 30, 2020 at 18:48 | comment | added | Roman | @MichaelE2 WR has chosen the physicist's view of units, not the mathematician's; you can agree or disagree with this choice. There are advantages and disadvantages on both ends, and choices need to be made. In the physicist's view, adding two objects with different units is a "syntax error" and makes no sense. If you want to define a mathematician's addition operation that accommodates divergent units, that's fine; but that's not how physical units work. Physical units have a real-world correspondence to satisfy (through the measurement process) and cannot be redefined ad lib. | |
Nov 30, 2020 at 16:18 | comment | added | Michael E2 |
There are gaps, like the distributive law: 0. (Quantity[1, "m"] + Quantity[2, "m/s"]) vs. 0. Quantity[1, "m"] + 0. Quantity[2, "m/s"] . As I said, I don't think Plus was designed to do this.
|
|
Nov 30, 2020 at 16:17 | comment | added | Michael E2 |
As for a sum of quantities, which is not as ridiculous as other commenters make appear — consider "bundles of goods" in rational choice theory in economic — the question is how to represent a sum of quantities such as five cats plus four dogs. The standard representation is the direct product (or direct sum) of unit vector spaces, which is a Cartesian product when finite and in Mathematica would be represented by a vector List . The Plus representation the OP presents is in effect a disjoint sum of the unit spaces. I don't think Plus was designed to do this.
|
|
Nov 30, 2020 at 16:14 | comment | added | Michael E2 |
Since I can't post an answer....As a mathematician, I don't agree that you cannot represent an exact number of units. I would assert Quantity[0, "m"] does this, whereas Quantity[0., "m"] with a Real scalar represents an approximate amount. Conceptually (to me), Quantity[x, "m"] lives in a 1D vector space $\langle u\rangle$ generated by $u=$ "m" that is disjoint from other vector spaces $\langle u'\rangle$ with different units. There is a unique bilinear product on the collection unit spaces, which includes dimensionless scalars, fixed by $1u_1\times 1u_2=1(u_1\times u_2)$....
|
|
Nov 29, 2020 at 18:35 | comment | added | Roman |
Again, Quantity[0, "Meters"] is not the mathematical zero but represents an interval of unknown (but probably small) size around zero. Mathematica treats it as such, which is sensible.
|
|
Nov 29, 2020 at 17:19 | comment | added | Francis Bush | Please ;-) I appreciate the technical cuteness, but you are missing the key point about simple mathematical behavior. The kind of basic mathematical example, as one might work on a piece of paper. You have to admit that the dog/cat example is a contradiction in basic behavior with the integral example. As a CS guy, I consider this a fundamental flaw in the overall design of Matheamtica. It is inconsistent. And the dog/car behavior is the only sensible one. | |
Nov 29, 2020 at 16:22 | history | answered | Roman | CC BY-SA 4.0 |