Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Stuck understanding part of an equation.

Status
Not open for further replies.

Rogue

New Member
First, apologies for what is probably a simple question but it's just not "clicking" for me.

I'm putting together a spreadsheet that I can use to calculate resistor values for a debounce circuit, as given in the Ganselle Debounce Guide (). For some reason my brain has hit this equation and stopped working, leaving me rather embarrased and grateful for any help!

I've been reading through (amongst other things) the Ganselle guide and a few threads on this board. Everyone mentions the following formula, and discuss/define most of it, but always seems to leave one bit unmentioned.

Taken from this post: https://forum.allaboutcircuits.com/showpost.php?p=182602&postcount=7

R = t / ( C*In(Vcc/Vc) ) = 5s / ( 5uF * In(9/4.5) )= 5/(5uF*0.693)=5/3.465u=1.44MΩ=1.5MΩ

I'm trying to work out what In() is, and what it is doing? My apologies if the answer is in fact in the other thread but I've either missed it or not understood what I was reading :confused:
 
Last edited:
Rogue,

Perhaps you need glasses, or a new pair of glasses. The link references ln, (el-en), not In (eye-en). ln (el-en) is a mathematical abbreviation for the natural logarithm of a number, so that is why it is not defined in the link.

Ratch
 
Hah! Yes, that would certainly explain it. I'd always thought it was written as log() - in fact I'm sure that's what we used at school - so it would never have occured to me.

Thank you for clearing that up. Thank you for being so diplomatic as well!
 
So I've come to find. It appears that some people take shortcuts which leads to ambiguity - though in fairness to my old teacher he probably did clarify the difference, but 20 years later it's my memory (as well as my eyesight, it appears) that is failing me.

The spreadsheet output now tallies with the first Ganssle example for R2, so I'm indebted to Ratchit for putting me back on track. Now I just need to work out why the output for the second example is slightly different :confused:
 
Hi,

The abbreviation used for the natural log (base e) varies depending on the forum and even the context.

In pure math it is usually denoted by "ln(x)" but in computer technology it is usually denoted "log(x)", so you have to know where you got the formula from. Was it a pure mathematical statement, or was it from a computer language file. That will help you decide what to use when you see "log(x)".

Some variations for the natural log are:
ln(x)
LN(x)
log(x)
LOG(x)
lnx
logx
LNX
LOGX
loge(x)
LOGe(x)
[note that all of the above start with the English letter "L" either upper or lower case 12th letter of the alphabet]

I dont ever remember seeing "Ln(x)" or "lN(x)" however, but they would be another possibility.

Due to the computer languages commonly using log(x) to mean the natural log, sometimes the common log (base 10) is written as log10(x) to make sure it is understood correctly.
 
Last edited:
Thanks for the clarification. I've spent a lot of time writing code so I'm more likely to have been exposed to it that way. Having said that, the things I've written have never really needed anything remotely clever mathematically. I can honestly say I don't think I've ever consciously used log(x), ln(x) or any variant thereof - or if I have they've been hidden away in other functions.

Originally, at this point in the post I had typed out in detail the problems that I was having with obtaining R1. I stepped through both calculations in full and showing my results, in the hope of asking for help. In the process, I realised where I had been going wrong! So, by virtue of the fact that I was typing a reply to your post when I solved my second problem, I shall give you credit for that as well!
 
Hi,

Oh ok thanks he he :)

That happens to all of us i think, as i know it happens to me now and then at least. Stuck on a long problem, and writing it out step by step often helps to find the thing that we overlooked. Believe it or not, sometimes it helps even to start a little dialog going like, "Well lets see i put x there, and y there, and when i divided i got z, and then...", etc. I do that sometimes when i have a long list of things to do before i can order parts because if i forget something before i order after i order the parts i cant go back and order more without paying more shipping. By going through the whole list of things to do step by step in a little dialog of sorts it helps to nail down everything that is needed.
 
Is it safe to assume that ln() is always natural log?

On the subject of self dialog, when I had a bug in my code, I would explain the code to anyone/thing that would listen. Even explaining it to an empty coffee cup often resulted in the bug getting solved.

Mike.
 
Hi Mike,

Yeah isnt that amazing? I think it's because when we 'talk' it out we are forced to slow down and clarify and force our conception of what is going on into the real world, and only real things work in the real world so we end up finding the bug :)

I've never seen ln(x) or LN(x) be anything other than the natural log function unless someone was silly enough to redefine it in a program, but that would not be a widespread usage by any means.
 
If in doubt, check: LOG(1) = 0 because 10^0 is 1.

ln(e) = 1; where e = 2.71828183...

Basically the n in LOG(n) or LN(n) is the exponent. With log, the base is 10. With ln, the base is e.
So 10^0, the 0 is the logarithm base 10 of 10^0
and
e^1 = e or 2.71828183...
 
ln() is short for natural logarithm, base e.
lg() is short for base 10 logarithm.
With log() the base should be told, but I think it is correct to assume base 10 if not told otherwise.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top