6
$\begingroup$

Bug introduced in 10.0.0 and fixed in 11.0.0


When trying to solve 8 equations in 8 unknowns, I get SystemException["MemoryAllocationFailure"]. I am not sure if I am doing something wrong, or is this something that should not really happen. Here is the code:

f={w1 + w2 + w3 + w4 == 2, w1*x1 + w2*x2 + w3*x3 + w4*x4 == 0, 
 w1*x1^2 + w2*x2^2 + w3*x3^2 + w4*x4^2 == 2/3, 
 w1*x1^3 + w2*x2^3 + w3*x3^3 + w4*x4^3 == 0, 
 w1*x1^4 + w2*x2^4 + w3*x3^4 + w4*x4^4 == 2/5, 
 w1*x1^5 + w2*x2^5 + w3*x3^5 + w4*x4^5 == 0, 
 w1*x1^6 + w2*x2^6 + w3*x3^6 + w4*x4^6 == 2/7, 
 w1*x1^7 + w2*x2^7 + w3*x3^7 + w4*x4^7 == 0};

NSolve[f, {w1, w2, w3, w4, x1, x2, x3, x4}]

Mathematica graphics

This is using Mathematica 10.4, on Windows 7, 16 GB RAM, 64 bits.

This happens only with NSolve. Using Solve does not generate this error, which is even more strange.

question is: Should this error be generated? Is this a user error, or a problem in NSolve?

$\endgroup$
2

1 Answer 1

9
$\begingroup$

This is a bug, for a possible workaround switch to a non-default method, for example

 f = {w1 + w2 + w3 + w4 == 2, w1*x1 + w2*x2 + w3*x3 + w4*x4 == 0, 
 w1*x1^2 + w2*x2^2 + w3*x3^2 + w4*x4^2 == 2/3, 
 w1*x1^3 + w2*x2^3 + w3*x3^3 + w4*x4^3 == 0, 
 w1*x1^4 + w2*x2^4 + w3*x3^4 + w4*x4^4 == 2/5, 
 w1*x1^5 + w2*x2^5 + w3*x3^5 + w4*x4^5 == 0, 
 w1*x1^6 + w2*x2^6 + w3*x3^6 + w4*x4^6 == 2/7, 
 w1*x1^7 + w2*x2^7 + w3*x3^7 + w4*x4^7 == 0};

NSolve[f, {w1, w2, w3, w4, x1, x2, x3, x4}, Method -> "EndomorphismMatrix"]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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