I am trying to solve the following simple equation in wxMaxima:
21.3874=0.00202415/(d^3)
When I use solve()
, I get 3 solutions (2 complex and 1 real). I know that d is real and positive (because it's a diameter) so I'm only interested in the third solution. It's given in the following form:
d=((40483)^(1/3))/(10427748^(1/3)) and I tried saving it with map()
function but it saved all 3 solutions and I don't know how to map only the last one so that I can use it for further calculations.
Anyway, after rewriting this solution and using float()
function on it, the result is: 0.1571668
But it's incorrect since the result should be 0.0455717.
Interestingly, to_poly_solve()
gives different solutions with the real one being: 0.2439467
I have 3 questions regarding this problem:
- Why does wxMaxima give two incorrect solutions and how to get the right one ?
- How can I tell the Maxima that I am looking only for real and positive solution of a given equation.
- Is it possible to map selected solution so that it can be referenced in further calculations (for example to use
float()
on it) ?
Hmm, when I try it, I get the expected result (0.0455717).
In order to isolate just the third solution, note that
solve
returns a list, so you can just saymysolutions[3]
(or whatever is the name of the variable to which the result ofsolve
was assigned).If you just want the numerical value, you can say
rhs(mysolutions[3])
whererhs
= "right-hand side". There is alsolhs
= "left-hand side".However, note that it's convenient to just use the equation
d = something
as an argument tosubst
in order to substitute the value into some other expression, e.g.: