Do Units Matter?

Discussion in 'Off-Topic' started by DGElder, Aug 25, 2016.

  1. DGElder

    Thread Starter Member

    Apr 3, 2016
    345
    85
    This thread is a bit of a puzzle, not a request for philosophy.

    In the course of learning about buffer solutions I stumbled across this Khan University lecture which ended up revealing an interesting and dangerous trap for young and old players alike that are involved in technical fields - including electronics.

    While this is a chemistry lecture you don't need to know chemistry to figure out the trap. You do need to know some basic algebra - including logarithms.

    After the professor has derived his text book equation (H-H), he shows that the formula identifies an "amazing" relationship between the moles of an acid and base and the ph of the buffer solution. He later realizes his conclusion was wrong and to his credit posts his mistake in the video. He uses a thought experiment to show that his conclusion made no sense, but he never identified his fundamental mistake.

    Can you figure it out?

    Watch the video, "Buffers", starting at time 9:45 - it is about 8 minutes long.


    Don't look at my next post if you want to solve the puzzle yourself.
     
    Last edited: Aug 25, 2016
  2. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    Yes I can. Now what?
     
  3. Tonyr1084

    Active Member

    Sep 24, 2015
    535
    86
    It's only 7:00 AM where I am, so I can't see the video for another two hours 45 minutes.
     
    AnalogKid likes this.
  4. DGElder

    Thread Starter Member

    Apr 3, 2016
    345
    85
    I confess I am a little disappointed no one took up the challenge and rooted this out.
    To not leave this dangling: this is where I think he went wrong......

    The log of a dimensional quantity is undefined.
    This was overlooked, leading the professor to the fallacious "amazing" physical interpretation at the end of the video. He was so compelled by the math that he rationalized away his own chemistry common sense.

    The text book H-H formula is mathematically sound - it has no dimensional quantities in the log argument.

    pKa + log( [A]/[HA] ) = pH

    or

    pKa + log(A m/L / HA m/L) = pH

    [..] is shorthand for Molar concentration or moles/Liter which is not dimensional because liters, in this context, are just a scaled version of moles.

    But when he divides out the Liters near the end of the video he then has a dimensional quantity (moles) in the numerator and denominator. This is undefined - even though the two dimensions could divide out leaving a dimensionless argument.

    pKa + log(A moles / HA moles) = pH

    Why? log (x/y) = logx - logy
    so if either the numerator or denominator are dimensional it is undefined - even if they are the same dimension!

    And he uses that undefined ratio to draw his incorrect conclusion that ph is dependent on the ratio of moles of the base to moles of the acid and is independent of volume or dilution. To get the correct physical interpretation he should not have divided out any units - giving the correct intepretation as the ratio of molar concentration of base to acid. But if he was going to divide out the Liters he was obligated to divide out the moles as well to restore the dimensionless argument in the log function, but then the physical interpretation would have been lost. This shows how this subtle distinction leads to wildly different physical interpretations!

    This is something to beware of in EE where e^x and ln(x) are so often encountered. I don't recall ever stumbling into this trap or being particularly cognizant of it for that matter, but I could see me making this mistake where the physical interpretation might be less obviously unrealistic.
     
    Last edited: Sep 2, 2016
  5. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    As I have stated time and time and time again on this site and elsewhere, units matter. In this case he ignores the fact that transcendental functions, such as trig functions and exponential/logarithmic functions are only defined for arguments that are pure numbers and only produce results that are pure numbers. If your arguments have dimensions then your work is wrong. If you HAPPEN to get a numerically correct result -- and almost always required that you tacked some unit onto the answer without any valid reason for doing so -- it is because you got lucky.

    Breaking up log(A/B) to log(A) - log(B) when A and B have dimensions is technically undefined. But, IF you are VERY careful to restrict yourself so that you enter this undefined world and then operate within it so that you can come back out of it properly, you are okay. Tracking units is key to doing this correctly, but it is definitely tricky.

    People get lucky a lot because they usually fall into this trap using well-established formulas (such as dB and pH formulas) and are really just being monkeys using formulas that someone else developed. So the formulas they are regurgitating reflect a valid entry/exit from this undefined world that the user of them is completely ignorant of.
     
  6. BR-549

    Well-Known Member

    Sep 22, 2013
    1,997
    389
    "I confess I am a little disappointed no one took up the challenge and rooted this out."

    Me too. I'm trying to figure out what you are talkin about.

    Are you trying to say that a mistake in chemical math can carry over to a mistake in electronic math.

    How bout that.

    Isn't that what units are for?
     
  7. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    There's no such thing as "chemical math" or "electronic math".

    The mistake is in the math. The problem is that math education at all levels fails to consider the impact of dimensioned quantities. That's because math educators, at all levels, seldom have any experience in the "real world".

    Consider one of the possible definitions of the exponential function.

    <br />
e^x \; = \; \sum_{n=0}^{\infty} \frac{x^n}{n!}<br />

    If x is dimensioned, then each term has different units and therefore can't be summed up. And even if we pretend that they could, what is the dimension of the result?

    Let's say that x = 10 inches. What is e^x? What are the dimensions?
    Let's say that y = 25.4 cm. What is e^y? What are the dimensions?

    You better be able to show that these two results are exactly equivalent since x and y are exactly equivalent.

    If you claim that the results are both dimensionless, then there is no way you can show that they are exactly equivalent because you are equating two pure numbers.
     
  8. DGElder

    Thread Starter Member

    Apr 3, 2016
    345
    85
    If he had been more meticulous with units at the beginning his derivation might have made
    clear the trap. Note the units on each side don't balance.

    Ka = ( [H] *[ A]) / [HA]

    if instead he had started with this equation where they do balance.

    [Ka] = ([H][A])/[HA]

    after several algebra steps he would have come to this equation.

    pKa - log([HA]/[A]) + log(m/L) = -log(H) + log(m/L) = -log[H]

    From here we only get the desired H-H equation:

    pKa + log( [A]/[HA] ) = pH

    if log(m/L) = 0 making clear that m/L is not dimensional and if it were how could it have a value? What is the log of pigs divided by cows?
     
  9. DGElder

    Thread Starter Member

    Apr 3, 2016
    345
    85

    As Bahn said there is no such thing as chemical math - just math, the same tool used in all the sciences.

    After I figured out what this prof did wrong I googled on intepretation of dimensions in log functions and found there have been papers written about it and is associated with some controversy. The prof is a victim of the short hand experts often use when using formula that they routinely employ.
     
  10. Tonyr1084

    Active Member

    Sep 24, 2015
    535
    86
    I watched this thread for that? OK, this is WAY over my head. Certainly would take more grey matter than I care to give it.

    Do units matter? I suppose so. Otherwise if they didn't then "What is - isn't what it isn't. Because if it was what it wasn't then it wouldn't be what it is". NO?

    STELLA! I'M SO CONFUSED!
     
  11. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    I'm sure if the unit less math had units ... One could make a very interesting YouTube tutorial. Kama sutra units certainly would grab one's attention, mainlining the math to the permanent part of the brain. :)
     
  12. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    "What is - isn't what it isn't. Because if it was what it wasn't then it wouldn't be what it is" -- that's just meaningless prattle.

    If I tell you that I am 72 tall and that my cousin is 30 tall, can you tell me which one of us is taller than the other?

    Units matter.

    If the Evil Overlord gave you the option of getting zapped by a potential difference across your chest of 0.05 or 50,000, which would you choose?

    Units matter.
     
    atferrari and nsaspook like this.
  13. DGElder

    Thread Starter Member

    Apr 3, 2016
    345
    85
    I assumed it would be clear that "Do Units Matter?" is a rhetorical question - and a teaser. Of course units matter.

    Moderator,
    By the way I would not consider this Off-Topic. This not about Donald Trump's hair color. This math trap has relevance to electronics. I had debated whether to put it in the Math section or General Science, but its really an example on how we use math to describe physical systems and how we can trick ourselves.
     
    Last edited: Sep 2, 2016
  14. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    Or here's an even better one.

    If someone makes calculations for a shear pin doing all the math in inches but the final result has to be in centimeters, then will just multiplying the work by 2.54 take care of things? If you say yes, then you will have just made the same mistake that got the someone referred to killed (and almost got me killed, too).

    The accident investigation revealed that the point at which he multiplied by 2.54 the number on that line was proportional to the area of the shear pin, not the diameter. So he needed to multiply by 2.54². The design had a safety factor of 2. So when the system was pressurized it failed before reaching proof pressure and a piece of the pin shot through the enclosure and right through his chest killing him in short order as he choked to death on his own blood. I was staking less than an arm's length away from him at the time.

    Had he simply tracked his units through his work, he would have caught that. He didn't, so he died (leaving behind two small kids and a pregnant wife, IIRC).

    UNITS MATTER!!!
     
    cmartinez likes this.
  15. WBahn

    Moderator

    Mar 31, 2012
    17,748
    4,796
    I agree that, when all is said and done, it is not Off Topic. Whether it belongs in Math (or possibly General Science) instead of General Electronics chat, it debatable. I think it is perfectly in line with the topics that are fair game for general electronics conversations. But I also freely admit that I have a very strongly biased perspective on the issue of units. So I'm staying quiet on that score as far as moderator actions are concerned on this thread.
     
  16. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    WTF?! I told you in #2 that I knew the answer. Not that it was any great mystery, since you gave it away in the title.
     
    nsaspook likes this.
  17. JohnInTX

    Moderator

    Jun 26, 2012
    2,347
    1,029
    I suppose you could make that case. In general though, we try to reserve the forums up there for 'question/ask for help and get the answer' sorts of posts. General interest topics such as this usually find their way to Off Topic, even though they may involve Math, Physics and the like. This particular post was reported with the suggestion that it move to OT and I agreed. So here it is and now you know.
    Regards.
     
  18. Tonyr1084

    Active Member

    Sep 24, 2015
    535
    86
    Do units matter? OK, I admit it - yes, they do. My biggest problem in the math with electronics is often what I call "Orders of magnitude". What catches me time and time again is the difference between 0.001 amps, 1 mA and 1000 µA's (for example).

    Yesterday I answered a question that when I did the math (in my answer) it didn't seem right. I spent an hour solving my error. Gladly, I finally came up with the right answer and was able to give an intelligent answer to the question posed. And yes, for anyone so inclined to say I suck at math - yes, I do. Los Angeles School District in the 60's and 70's. No child left behind meant we all graduated, even if we could hardly do math and hardly read. Which MANY of us fell under. I've had to tutor myself to be able to do basic algebra and trig. Forget logs or calculus. RC circuits scare me to death when it comes to figuring out the timing.

    Yes, units matter. They mattered on Apollo 13 when they changed the oxygen tank heater from whatever voltage it was to - I believe it was changed to 64 volts. A lower voltage than what was originally used. That was one mistake that added to problems (if memory serves) that resulted in the side of the space craft being blown off. Luckily they got home. But "Units matter" could have ended their lives.

    Yes, we can probably come up with many examples of where an error occurred in math that caused (or nearly caused) catastrophe. As for my non-sensicle comment about "What is isn't what it isn't" - that was about as close to a no-brainer that I could come up with in response to "Do units matter".
     
  19. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    There ... we now know why WBahn is the way he is with units. He had a significant emotional event that impressed on him the reason to use units. I'm glad WBahn told the story. Keep up the good work WBahn.
     
  20. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    I share @WBahn 's zeal for attention to units, although I've thankfully never had such a seminal event to bring it home.

    Over many years I've watched people – students and coworkers alike, from dull to brilliant – struggle to complete basic science and engineering calculations. Yes, most cannot do calculus. That's sad but I've come to accept it. But by far the single biggest hurdle they all run into is carrying the units and doing a dimensional analysis from beginning to end. I know how to do it right, and still have to check and double-check my units. It's a built-in check that you have the principles and formula right. If you want an answer in miles per hour but end up with miles squared, something's very wrong and you need to work it again.

    If you ever encounter someone that does it right, hire them, promote them, do whatever you can do to put that rare skill to good use. They're one of the rare people that get it.
     
    cmartinez likes this.
Loading...