vpasolve doesn't work with roots for some equations
57 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Benjamin Paik
am 25 Nov. 2024 um 4:03
Beantwortet: Walter Roberson
am 25 Nov. 2024 um 4:33
Notice the example code below. Both instances are essentially solving the same equation using vpasolve except that in the first case there is a square root on the left hand side while in the second case, both sides of the equation have been squared. MATLAB fails to solve the equation when in the when the square root is present, but has no issues when both sides are squared. How can I get vpasolve to solve the first case.
syms x
vpasolve((-1.2068e+21*x - 2.0765e+20)^(1/2)==-2.2185e+10,x)
vpasolve(-1.2068e+21*x - 2.0765e+20==(-2.2185e+10)^2,x)
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Nov. 2024 um 4:33
vpasolve((-1.2068e+21*x - 2.0765e+20)^(1/2)==-2.2185e+10,x)
The left hand side involves a square root. The right hand side involves a negative number. The ^(1/2) operator returns complex numbers for negatives inside the square root, and returns positive values for positive values inside the square root. It is never the case that the ^(1/2) operator returns a negative value (except possibly a negative real component along with a non-zero complex component.)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!