How to find the exact answer of an exponential equation?
24 次查看(过去 30 天)
显示 更早的评论
syms t
solve(exp(-0.04*t)+exp(-0.12*t)==1,t)
I got the answer for this but I don't understand what it meant? I need a time value for this. Can someone explain me what this happened and how to get the exact value of t?
25*log(root(z^3 - z^2 - 1, z, 1))
Thank you so much!!
0 个评论
回答(2 个)
Rik
2021-4-16
You can use double to extract a numerical value, but if you're looking for a time, something is going wrong here. The numerical approach shows there actually is a solution.
syms t
solve((exp(-0.04*t)+exp(-0.12*t))==1,t), double(ans)
f=@(t) exp(-0.04*t)+exp(-0.12*t);
sol_t=fminsearch(@(t) abs(f(t)-1),10), f(sol_t)
0 个评论
John D'Errico
2021-9-24
编辑:John D'Errico
2021-9-24
syms t real
Eqn = exp(-0.04*t)+exp(-0.12*t) - 1;
Write it like that. I did so because now we can plot it. See that I specified t to be a real variable, since you are not interested in complex valued solutions.
Now, we can plot it. Does a solution exist? Are there multiple solutions? ALWAYS PLOT EVERYTHING. Look at what you see. Think about what you see. Then plot it in a different way if necessary. Where this relationship crosses zero, this is your solution.
fplot(Eqn,[-5,25])
yline(0)
grid on
So a solution does exist, and I would bet there is only one real solution. The one you care about is a little less than 10.
tsol = solve(Eqn,t)
And that may not seem terribly useful, but it is. The result is the third root of a cubic polynomial, You need to push MATLAB to resolve the solution. VPA will do that here.
vpa(tsol)
You could also have gone directly to a numerical solution using vpasolve.
vpasolve(Eqn)
In fact, that polynomial had three roots, but two will yield complex values. If you wish an algebraic solution for the problem, you could do this:
solve(Eqn,t,'maxdegree',3)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!