Why does the SOLVE function return the wrong answers for some equations?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Linear Algebra in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!