Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Why does NSolve not work for this type of equation?

2.01224 == (0.954875 - 0.0084496 a) Log[
    9 (0.954875 - 0.0084496 a)] + (0.0113946 - 0.00295146 a) Log[
    9/4 (0.0113946 - 0.00295146 a)]

Here is my full script, where I solve got a, it just hangs there:

NSolve[2.01224 == (0.954875 - 0.0084496 a) Log[
    9 (0.954875 - 0.0084496 a)] + (0.0113946 - 0.00295146 a) Log[
    9/4 (0.0113946 - 0.00295146 a), ], a]
share|improve this question

1 Answer 1

up vote 3 down vote accepted

By restricting the domain to Reals, I got an answer quite quickly.

NSolve[
  2.01224 == 
    (0.954875 - 0.0084496 a) Log[9 (0.954875 - 0.0084496 a)] + (0.0113946 - 0.00295146 a) 
    Log[9/4 (0.0113946 - 0.00295146 a)],
  a, Reals]

Solve::ratnz: Solve was unable to solve the system with inexact coefficients. The answer was obtained by solving a corresponding exact system and numericizing the result. >>

{{a -> -0.000139109}}

Checking the result

(0.954875 - 0.0084496 a) Log[9 (0.954875 - 0.0084496 a)] + 
  (0.0113946 - 0.00295146 a) Log[9/4 (0.0113946 - 0.00295146 a)] /. 
  a -> -0.00013910870308745475`
2.01224
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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