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.

I am using NSolve to solve an equation, as shown here:

T == (0.000250709 E^(0.0269867/(0.0000734429 + 1. T)))/(1.00025 - 
    1. E^(0.0539734/(0.0000734429 + 1. T)))

NSolve[T == (0.000250709 E^(0.0269867/(0.0000734429 + 
          1. T)))/(1.00025 - 
     1. E^(0.0539734/(0.0000734429 + 1. T))), {T}, Reals]

It gives me the warning 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. >>, but still displays the result. Is it wrong to use NSolve for for such a general task, or am I missing a parameter?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

No errors if you work with exact arithmetic instead:

NSolve[Rationalize[
         T == (0.000250709 E^(0.0269867/(0.0000734429 + 1. T)))/
              (1.00025 - 1. E^(0.0539734/(0.0000734429 + 1. T))), 10^-10], {T}, Reals]

(*{{T -> -6.55871*10^-164}, {T -> 216.923}}*)
share|improve this answer
    
It works, thanks.. but I'm not sure why. Does NSolve have an issue working with high precision? –  BillyJean May 1 '13 at 13:35
1  
@niles, it's just that NSolve[] has some trouble if inexact numbers are present in the input. That's where Rationalize[] comes in. –  J. M. May 15 '13 at 11:49
add comment

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.