Matlab solver for natural log equation
Show older comments
Hello,
I thought this was a simple solver equation, I know I am doing something wrong, because the result should be about S=1429.
This is my code:
syms x
eqn = log(0.5) == (-27109/x)-0.95*log(x)+25.18
S = vpasolve(eqn,x)
Matlab gives me a very large S =672919621689.2986708066438355574
What am I doing wrong here?
Accepted Answer
More Answers (1)
Walter Roberson
on 20 Nov 2020
Edited: Walter Roberson
on 20 Nov 2020
Q = @sym; %convert to rational
syms x
eqn = log(Q(0.5)) == (-Q(27109)/x)-Q(0.95)*log(x)+Q(25.18)
S = solve(eqn,x)
vpa(S)
You can see from this that there are two solutions. You could use an initial value in vpasolve to get the other one
Categories
Find more on Assumptions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



