0
$\begingroup$

I have an equation I need to solve for t. I have tried the code below:

Solve[
  51684.2/342077 * 0.048 / 0.148 * 26.09/22.19 == 
    Exp[t/26.09] - Exp[(22.19 t - 26.09 t) / 22.19 * 26.09], 
  t]

Wolfram Mathematica keeps calculating forever and never finishes. I have asked for help on the general stack exchange before (not the Mathematica section). They recommended two lines, both of which give a result, but neither is correct. When I manually substitute the value produced by the coded below, they do not satisfy the equation:

a = 51684.2/342077 * 0.048/0.148 * 26.09/22.19;
b = Exp[(22.19 t - 26.09 t)/22.19 * 26.09];
FindRoot[a == Exp[t/26.09] - b, {t, 0}]
{t -> 0.0128273}

OR

NSolve[a == Exp[t/26.09] - b, t, Reals]

I believe the answer should be in the the region of 10 – 100, absolutely not below 3.35.

$\endgroup$
  • 1
    $\begingroup$ The value you found with FindRoot does satisfy the equation. eq = 51684.2/342077*0.048/0.148*26.09/22.19 == Exp[t/26.09] - Exp[(22.19 t - 26.09 t)/22.19*26.09]; sol = FindRoot[eq, {t, 0}]; eq /. sol yields True $\endgroup$ – MelaGo May 17 at 4:10
  • 1
    $\begingroup$ Plot the equation Plot[Exp[t/26.09] - Exp[(22.19 t - 26.09 t)/22.19*26.09] - 51684.2/342077*0.048/0.148*26.09/22.19, {t, 0, 100}] to check your belief. $\endgroup$ – JimB May 17 at 4:13
3
$\begingroup$

You can change this to a minimization problem and the answer returns in seconds:

NMinimize[( (51684.2/342077*0.048/0.148*26.09/22.19) - 
            (Exp[t/26.09] - Exp[(22.19 t - 26.09 t)/22.19*26.09]) )^2, t]
{4.93038*10^-32, {t -> 0.0128273}}
$\endgroup$
2
$\begingroup$

If you are looking for a real solution you have to tell it NSolve:

NSolve[51684.2/342077*0.048/0.148*26.09/22.19 ==(Exp[t/26.09] -Exp[(22.19 t - 26.09 t)/22.19*26.09]), t, Reals]
(*{{t -> 0.0128273}}*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.