Can I analytically solve a logarithmic equation using the symbolic toolbox?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Anik Faisal
am 19 Mär. 2019
Beantwortet: John D'Errico
am 20 Mär. 2019
I have an equation :
where A is a constant. I have tried to solve this equation for 'u' with the symbolic toolbox. I am getting the following error:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/209283/image.png)
Warning: Unable to find explicit solution. For options, see help.
In solve (line 317) . Any suggestions how the equation can be solved?
syms u A
eqn=u/(log(u)+1)-A==0;
solve(eqn,u)
0 Kommentare
Akzeptierte Antwort
John D'Errico
am 20 Mär. 2019
Sigh. Sorry. I typed too fast there, and I answered incorrectly. Not sure why solve does not get this.
Multiply by log(u) + 1. Valid as long as u is not 1/e.
u = A*(log(u) + 1)
Transform this using x = log(u) + 1. Then u = exp(x - 1) = exp(x)/exp(1). Our problem is now:
exp(x)/exp(1) = A*x
or
exp(x) = exp(1)*A*x
Solve seems to see how to do that.
syms x A
xsol = solve(exp(x) == exp(1)*A*x,x)
xsol =
-lambertw(0, -1125899906842624/(3060513257434037*A))
usol = exp(xsol - 1)
usol =
exp(- lambertw(0, -1125899906842624/(3060513257434037*A)) - 1)
Verify this satisfies the original problem.
vpa(simplify(subs(u/(log(u)+1)-A,u,usol)))
ans =
0.00000000000000011018891328384950189261640307115*A
It looks like solve used a floating point approximation for exp(1) in there, so we still got zero, plus some floating point trash.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!