Need some help with an odd output with solve
Show older comments
Hello, first time asking a question here. I am having a bizarre output when I try to use solve, and would like some help.
Here is the code:
syms x
eqn = (1315.2/(8.22-x))+(895.4/(2.42-x))+(240/(1-x))+(9.45/(0.378-x))+(0.75/(0.15-x))==800;
solx=solve(eqn,x)
And here is the output:
solx =
0
root(z^4 - (2273*z^3)/250 + (63332491*z^2)/4000000 - (1367320551*z)/200000000 + 721613169/1000000000, z, 1)
root(z^4 - (2273*z^3)/250 + (63332491*z^2)/4000000 - (1367320551*z)/200000000 + 721613169/1000000000, z, 2)
root(z^4 - (2273*z^3)/250 + (63332491*z^2)/4000000 - (1367320551*z)/200000000 + 721613169/1000000000, z, 3)
root(z^4 - (2273*z^3)/250 + (63332491*z^2)/4000000 - (1367320551*z)/200000000 + 721613169/1000000000, z, 4)
I don't know if it's a problem with the code, or with my computer, but I'm unsure of what the z's in the solution correlate to. I'm also wondering if I can output the solution as just numbers, rather than these roots.
Thank you for answering, in advance.
Accepted Answer
More Answers (2)
Walter Roberson
on 8 May 2016
double(solx)
Or,
solx = solve(eqn, x, 'MaxDegree', 4)
but be warned this is going to give you quite long solx.
Shashwat Singh
on 3 Sep 2021
0 votes
(((80000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^2)/160801 - (800000000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^4)/2605105001601 + 8000)*((40000000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^4)/2605105001601 - (4000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^2)/160801 + 40401/100))/(((40000000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^4)/2605105001601 - (4000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^2)/160801 + 40401/100)^2 - (40401*((1000000000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^4)/2605105001601 - (100000*root(z^6 - (16200801*z^4)/10000 + 16924119873732035442801/40000000000000000, z, 1)^2)/160801 + 10)^2)/25)^(1/2)
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!