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.

Running Mathematica 8.0.4 and 10.0.0 on a Windows 8.1 machine. Processed the same code with both kernels:

k = .2; NSolve[Rationalize[2 r^2 - .2 r^(k + 2) - 1 == 0], r, Reals]

The version 8 kernel returns two values as expected:

{{r -> 0.742979}, {r -> 100000.}}

The version 10 kernel returns only the first value by default. The second value doesn't appear as a solution until setting WorkingPrecision to at least 28.

The same behavior occurs for other values of k: the version 10 kernel needs massaging to return values the version 8 kernel finds by default. What would cause this?

share|improve this question
    
Win7,10.0.0,give two solutions,0.742979 and 100000. –  Chenminqi Jul 20 at 6:01
    
100000 is not a solution. You are experiencing numerical issues. –  Mike Z. Jul 20 at 12:20
    
This is closely related: Issue with NSolve –  Artes Jul 20 at 15:44
    
When using VerifySolutions -> False, it gives three, one wrong. –  Szabolcs Jul 20 at 16:56
    
@Chenminqi did you get this result with a default installation or have you made configuration changes that would affect precision? –  Paul Masson Jul 21 at 19:10

2 Answers 2

The equation is numerically unstable. The second root is not valid at machine precision so is rejected. Higher precision is required to arrive at a valid second root. Use Solve to see exact solutions as root objects. Then use higher precision when converting root objects to numbers.

k = .2;
eqn = Rationalize[2 r^2 - .2 r^(k + 2) - 1 == 0];
sol = Solve[eqn, r, Reals]

{{r -> Root[5 - 10 #1^10 + #1^11 &, 2]^5}, {r -> Root[5 - 10 #1^10 + #1^11 &, 3]^5}}

eqn /. sol // FullSimplify

{True, True}

soln = sol // N[#, 30] &

{{r -> 0.742978680869997548585535979527}, {r -> 99999.9999749999999899999999927}}

eqn /. soln

{True, True}

eqn[[1]] /. soln

{0.*10^-30, 0.*10^-20}

share|improve this answer
    
$MachinePrecision has the same default value for both versions. If it is a matter of rejecting a solution at machine precision, then why doesn't that occur in version 8? I've also verified that the current version 9 CDF Player does not reject the second solution at default machine precision. The question remains as to why version 10 is behaving differently. –  Paul Masson Jul 21 at 19:14
    
I don't know but in both V8 and V10 the VerifySolutuons option for Solve default is Automatic (presumably neither always True nor always False). Perhaps the "automatic" setting for V10 checked whereas V8 didn't. –  Bob Hanlon Jul 21 at 20:06
1  
Correction to above since you used NSolve. In V8 NSolve does not have a VerifySolutions option whereas in V10 it does. In V10 VerifySolutuons option for NSolve default is Automatic. Presumably it decided to check. –  Bob Hanlon Jul 21 at 20:17
up vote 2 down vote accepted

Wolfram support has confirmed to me that there is a known problem with NSolve in version 10. Hopefully it will be fixed soon.

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.