Skip to main content
Max Coplan's user avatar
Max Coplan's user avatar
Max Coplan's user avatar
Max Coplan
  • Member for 8 years, 8 months
  • Last seen more than a month ago
  • Baltimore, MD, USA
Loading…
asked
Loading…
comment
Specify set of base units to use in UnitConvert
So imagine we express each basis quantity as a column vector with entries {Length, Time, Mass, Temperature, etc.}, (e.g. c is {1,-1,0,..}) and construct a matrix with each basis quantity as a column vector. Then multiply that matrix by the column vector {?,?,?,...}, and set it equal to the user's input quantity (e.g. distance {1,0,...}), then solve for the {?,?,?,..}. This will return the user's quantity in terms of ANY quantity they choose (given they provide a linearly independent basis).
comment
Specify set of base units to use in UnitConvert
Well, I know of maybe not the most elegant solution. But what we're trying to do is express one quantity as a linear combination of other quantities. Which means we WILL have a unique solution when the basis we choose is linearly independent.
revised
Merge pairs in a list that have the same 1st element by averaging the the 2nd elements
It's easier to read posts when code (or code-like, in this case) is [formatted properly](https://mathematica.stackexchange.com/help/formatting)
Loading…
comment
awarded
comment
Specify set of base units to use in UnitConvert
Your answer has inspired me to pursue a generalization of this. Instead of only going between systems with 1→1 equivalences, what about a more general system of any quantity? For example, expressing energy in h/s, or lengths in c*t. In a theoretical application, the ability to use your unitConvert with unitConvert[q, {c,G,h, Kb, etc.}] Thanks again for your excellent response!
comment
Specify set of base units to use in UnitConvert
Good answer. Does precisely what I need. Wish I could select this as a runner-up (even though there's only two responses 😝)
accepted
comment
Specify set of base units to use in UnitConvert
Wow! Excellent answer. I'm blown away by how sophisticated this code is. Thank you so much! It is very well done.
comment
How to copy a string to the clipboard from a script?
Trying to copy "$PATH", or "hey; sudo ls /" will have undesirable results. We should have used literal strings
revised
Loading…
revised
How to copy a string to the clipboard from a script?
Giving credit where credit is due
Loading…
comment
Specify set of base units to use in UnitConvert
Probably it should throw a Quantity::compat Message. But either of your suggestions work too; probably that latter one.
revised
Loading…
revised
Loading…