Why does the SOLVE function return the wrong answers for some equations?
Afficher commentaires plus anciens
Why does the SOLVE function return the wrong answers for some equations?
SOLVE returns incorrect symbolic solutions to some symbolic equations. For example, attempting to solve the equation z^6 = i results in incorrect answers:
solve('z^6-i')
ans =
[ (1/4*5^(1/2)-1/4+1/4*i*2^(1/2)*(5+5^(1/2))^(1/2))*(-i)^(1/2)]
[ (-1/4*5^(1/2)-1/4+1/4*i*2^(1/2)*(5-5^(1/2))^(1/2))*(-i)^(1/2)]
[ (-1/4*5^(1/2)-1/4-1/4*i*2^(1/2)*(5-5^(1/2))^(1/2))*(-i)^(1/2)]
[ (1/4*5^(1/2)-1/4-1/4*i*2^(1/2)*(5+5^(1/2))^(1/2))*(-i)^(1/2)]
[ 1/2*2^(1/2)-1/2*i*2^(1/2)]
[ -1/2*2^(1/2)+1/2*i*2^(1/2)]
Checking the accuracy of these values by performing
double(ans.^6)
shows that the first 4 answers are invalid:
ans =
-0.9511 + 0.3090i
-0.5878 - 0.8090i
0.5878 - 0.8090i
0.9511 + 0.3090i
0 + 1.0000i
0 + 1.0000i
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!