MATLAB: How i solve a polynomial equation with exponents that are not integers

polynomial equations

For example: 0,32567*x^(-0,05673)+0,2223*x^(0,7319)+…+0,00863*x^(-0,000657)=0

Best Answer

It is a general nonlinear equation, not a polynomial. Calling it that does not make it so, even though it looks vaguely like one.
You find the root of any such problem using fzero, IF a root exists. Note that when x is negative there will be issues, as a negative number raised to a non-integer power will not yield a real number. So using your example...
fun = @(x) 0.32567*x.^-0.05673 + 0.2223*x.^0.7319 + 0.00863*x.^-0.000657;
fun(-1)
ans =
0.18114 + 0.10812i
As it turns out, this function is a bit boring along the positive real line. Ok, it is VERY boring. With all positive coefficients, there will never be a positive real solution. We need something with both positive and negative coefficients in the mix to make it interesting. (Of course, in context of polynomials, I think Descartes had something to say here.)
fun = @(x) -0.723 + 0.32567*x.^-0.25673 + 0.8223*x.^0.7319 - 0.363*x.^1.657;
ezplot(fun,[0,2])
grid on
It appears this function has three roots on the positive real line. ALWAYS plot your problems when you can. Plots give you a great deal of intuition about what is happening.
format long g
x = fzero(fun,[eps,2])
x =
1.37482509521088
fun(x)
ans =
2.22044604925031e-16
So close enough. Of course, this is only one of the roots. By a careful search for sign changes, we can force fzero to find the other roots. But roots cannot work on problems like this.
Or, we can throw the symbolic TB at it, which in this case, happens to find the second positive real root.
syms x
fsym = -0.723 + 0.32567*x.^-0.25673 + 0.8223*x.^0.7319 - 0.363*x.^1.657;
xs = solve(fsym)
xs =
0.22525988470397199278453292791815