solve logarithmic equation

sherlockh

New member
Joined
May 18, 2022
Messages
10
Hi
I wonder if someone can help me.

Is it possible solve this equation for x.

y = ln(1-x)/ln(x)

If so how?

Thanks
 
Except for specific values of y there is no closed form solution. (There is the Lambert W function if you want to give it a try, but that's just a way to bury the numbers.)

Let's recast this as [imath]a = \dfrac{ln(1 - x)}{ln(x)}[/imath]. If you have a specific a value in mind I'd graph it. Find out where the graphs of y = a ln(x) and y = ln(1 - x) intersect.

Again, if you have a specific value of a in mind there are other methods to approximate x. If you know a little Calculus Newton's method would be another.

-Dan
 
y = ln(1-x)/ln(x)
ylnx = ln(1-x)
ln(x)^y=ln(1-x)
x^y = 1-x.
Can you continue to solve for x?
 
Except for specific values of y there is no closed form solution. (There is the Lambert W function if you want to give it a try, but that's just a way to bury the numbers.)

Let's recast this as [imath]a = \dfrac{ln(1 - x)}{ln(x)}[/imath]. If you have a specific a value in mind I'd graph it. Find out where the graphs of y = a ln(x) and y = ln(1 - x) intersect.

Again, if you have a specific value of a in mind there are other methods to approximate x. If you know a little Calculus Newton's method would be another.

-Dan
thanks I will check out your suggestions. looking for values between 0 >x <1.
 
Hi
I wonder if someone can help me.

Is it possible solve this equation for x.

y = ln(1-x)/ln(x)

If so how?

Thanks
Please explain the context of this equation. Where did come from - class-room, physics research - what?
 
I work in electronics. just an idea I had, prob silly. i derived it (simplied) It from the capacitor charge and discharge equations.
vo = vin (1 - exp(-tcharge/cr))
vo = vin (exp(-tdischarge/cr))
The idea was, if I know the voltage Vo is same, (both charging and discharging,) and I know the points in time charging and discharge, could I elimate CR from the equation. Y was a ratio of tdis/tcharge. X was = Vo/Vin
 
thanks I will check out your suggestions. looking for values between 0 >x <1.
Hi Dan,
I've never come across the Lambert W function you mentioned. Looks interesting, so I had a look at the wiki pages and some examples. I had a go at trying to get the formula's x^y = 1-x and y = ln(1-x)/ln(x) into the correct format to use the Lambert W function y.e^y = x
It's probably my algebra skills, but I could not see a way. It requires a lot tricks that maybe I don't know.
How would you go about this?

Cheers
Steve
 
Hi Dan,
I've never come across the Lambert W function you mentioned. Looks interesting, so I had a look at the wiki pages and some examples. I had a go at trying to get the formula's x^y = 1-x and y = ln(1-x)/ln(x) into the correct format to use the Lambert W function y.e^y = x
It's probably my algebra skills, but I could not see a way. It requires a lot tricks that maybe I don't know.
How would you go about this?

Cheers
Steve
I took a closer look at this. It seems that I'm wrong in bringing it up. The issue is that your equation reduces to [imath]x^y = 1 - x[/imath]. This is not an exponential equation in x. For it to be that we'd have to have something like [imath]y^x = 1 - x[/imath], which can be solved with the W function (x = 0 is one solution.) Your equation [imath]x^y = 1 - x[/imath] is more like a polynomial equation and so the W function will not work here.

Sorry for the red herring!

-Dan
 
I took a closer look at this. It seems that I'm wrong in bringing it up. The issue is that your equation reduces to [imath]x^y = 1 - x[/imath]. This is not an exponential equation in x. For it to be that we'd have to have something like [imath]y^x = 1 - x[/imath], which can be solved with the W function (x = 0 is one solution.) Your equation [imath]x^y = 1 - x[/imath] is more like a polynomial equation and so the W function will not work here.

Sorry for the red herring!

-Dan
That's ok, no worries. I've learned about new function :)
 
To confirm, you're trying to determine the ratio vo/vin when ratio tdischrg/tchrg is known. Is that correct?

[imath]\;[/imath]
Yes that's it. The equation comes from these two equations. If CR is unknown and Vo/Vin is the same in both equations.
Vo = Vin (1 - exp(-Tch/CR))
vo = vin (exp(-Tdis/CR))
I changed the equations around like this

Ln(1 -Vo/Vin) = Tch / CR
Ln(Vo/Vin) = Tdis / CR

To remove CR, I divided one by the other.
[imath]\frac{Tch} {Tdis} = \frac{ln(1-Vout/Vin)}{ln(Vout/Vin)}[/imath]
 

Attachments

  • Capacitor charge-discharge.png
    Capacitor charge-discharge.png
    21.2 KB · Views: 2
Last edited:
Yes that's it. The equation comes from these two equations. If CR is unknown and Vo/Vin is the same in both equations.
Vo = Vin (1 - exp(-Tch/CR))
vo = vin (exp(-Tdis/CR))
I changed the equations around like this

Ln(1 -Vo/Vin) = Tch / CR
Ln(Vo/Vin) = Tdis / CR
You're missing two minus signs...

ln(1 - Vo/Vin) = -Tch/CR
ln(Vo/Vin) = -Tdis/CR

However, once you divide they cancel each other out so that your final result is correct...
[imath]\frac{Tch} {Tdis} = \frac{ln(1-Vout/Vin)}{ln(Vout/Vin)}[/imath]

--

Note that the following post is wrong...
Y was a ratio of tdis/tcharge. X was = Vo/Vin
Lowercase "y" in the original post is actually Tch/Tdis (the reciprocal of the above)

--

Sorry, the above points don't help with your bigger problem. I agree with posts 2 and 8. You can't write an equation that starts with "x=<something in terms of y>" unless you manage to find an obscure mathematical function that few people will have heard about. Or you could define your own mathematical function (and perhaps investigate its properties).

Also, you could find approximate solutions with different degrees of accuracy - you can get VERY accurate if you like. Methods include producing a:- lookup table; graph; spreadsheet (that can perform a goal-seek for you); series expansion or write a quick (computer) algorithm. Would any of these ideas be useful?
 
You're missing two minus signs...

ln(1 - Vo/Vin) = -Tch/CR
ln(Vo/Vin) = -Tdis/CR

However, once you divide they cancel each other out so that your final result is correct...


--

Note that the following post is wrong...

Lowercase "y" in the original post is actually Tch/Tdis (the reciprocal of the above)

--

Sorry, the above points don't help with your bigger problem. I agree with posts 2 and 8. You can't write an equation that starts with "x=<something in terms of y>" unless you manage to find an obscure mathematical function that few people will have heard about. Or you could define your own mathematical function (and perhaps investigate its properties).

Also, you could find approximate solutions with different degrees of accuracy - you can get VERY accurate if you like. Methods include producing a:- lookup table; graph; spreadsheet (that can perform a goal-seek for you); series expansion or write a quick (computer) algorithm. Would any of these ideas be useful?
oops.. Yeah, you are correct, forgot the minus signs.
I have tried the spreadsheet goal-seek which worked. For the application I am thinking about, a program inside a micro, my thought was to use a lookup table. I'm not sure how I would use a series expansion or write an algorithm.
 
I have tried the spreadsheet goal-seek which worked. For the application I am thinking about, a program inside a micro, my thought was to use a lookup table. I'm not sure how I would use a series expansion or write an algorithm.
Note that if you're implementing a lookup table, then you only need to store half of the full table (for y values between 0 and 1). Let the lookup function be called f(y). If y≤1 then x = f(y) else x = 1 - f(1/y)

If you need extra help then let us know the capability of your micro (does it handle floating point arithmetic and are functions like the natural logarithm available). Also let us know the desired accuracy.
 
Top