How do I get the coefficients of a 9th order symbolic polynom without root on them?

3 views (last 30 days)
Hello,
I am using the symbolic toolbox to get the roots of a polynom order 9th. The symbolic solution that I am gettting from solve is the one below
(root(z^9 + (2*z^8*(a1*b3 + a2*b4 - a5*b2))/(a2*b3) + (z^7*(a1^2*b3^2 + a2^2*b4^2 + a5^2*b2^2 + 4*a1*a2*b3*b4 - 2*a1*a5*b2*b3 - 2*a2*a4*b2*b3 - 2*a2*a5*b1*b3 - 2*a2*a5*b2*b4))/(a2^2*b3^2) - (2*z^6*(- a1*a2*b4^2 - a4*a5*b2^2 - a1^2*b3*b4 - a5^2*b1*b2 - a2^2*b3*b5 + a1*a4*b2*b3 + a1*a5*b1*b3 + a2*a4*b1*b3 + a1*a5*b2*b4 + a2*a4*b2*b4 + a2*a5*b1*b4))/(a2^2*b3^2) + (z^5*(a1^2*b4^2 + a4^2*b2^2 + a5^2*b1^2 + 2*a2^2*b4*b5 - 2*a1*a4*b1*b3 + 4*a1*a2*b3*b5 - 2*a1*a4*b2*b4 - 2*a1*a5*b1*b4 - 2*a2*a4*b1*b4 + 4*a4*a5*b1*b2 - 2*a2*a5*b2*b5))/(a2^2*b3^2) + (z^4*(2*a4*a5*b1^2 + 2*a4^2*b1*b2 + a3^2*b2*b3 + 2*a1^2*b3*b5 - 2*a1*a4*b1*b4 + 4*a1*a2*b4*b5 - 2*a1*a5*b2*b5 - 2*a2*a4*b2*b5 - 2*a2*a5*b1*b5))/(a2^2*b3^2) + (z^3*(a4^2*b1^2 + a2^2*b5^2 + a3^2*b1*b3 + a3^2*b2*b4 + 2*a1^2*b4*b5 - 2*a1*a4*b2*b5 - 2*a1*a5*b1*b5 - 2*a2*a4*b1*b5))/(a2^2*b3^2) + (z^2*(2*a1*a2*b5^2 + a3^2*b1*b4 - 2*a1*a4*b1*b5))/(a2^2*b3^2) + (z*(a1^2*b5^2 + a3^2*b2*b5))/(a2^2*b3^2) + (a3^2*b1*b5)/(a2^2*b3^2), z, 2)*(- b3*a1^2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a3*b1*(a2*b1^4*b3 + a1*b2^4*b5 - a1*b1^3*b2*b3 - a2*b1^3*b2*b4 - a2*b1*b2^3*b5 + a1*b1^2*b2^2*b4))
I was wondering how I can just get the coefficients of this polynom without the word root, meaning a solution such as
[ 1, (2*(a1*b3 + a2*b4 - a5*b2))/(a2*b3), (a1^2*b3^2 + 4*a1*a2*b3*b4 - 2*a1*a5*b2*b3 + a2^2*b4^2 - 2*a2*a5*b2*b4 - 2*b1*a2*a5*b3 - 2*a4*a2*b2*b3 + a5^2*b2^2)/(a2^2*b3^2),...]
I have been using coeffs, but I have to remove manually the word root for each solution of my polynom and I would like to automatize this. Any hint of how I can get these coefficients?
Thanks in advance

Answers (1)

Walter Roberson
Walter Roberson on 16 Sep 2019
children()
  7 Comments
Walter Roberson
Walter Roberson on 18 Sep 2019
syms a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 z
expr = (root(z^9 + (2*z^8*(a1*b3 + a2*b4 - a5*b2))/(a2*b3) + (z^7*(a1^2*b3^2 + a2^2*b4^2 + a5^2*b2^2 + 4*a1*a2*b3*b4 - 2*a1*a5*b2*b3 - 2*a2*a4*b2*b3 - 2*a2*a5*b1*b3 - 2*a2*a5*b2*b4))/(a2^2*b3^2) - (2*z^6*(- a1*a2*b4^2 - a4*a5*b2^2 - a1^2*b3*b4 - a5^2*b1*b2 - a2^2*b3*b5 + a1*a4*b2*b3 + a1*a5*b1*b3 + a2*a4*b1*b3 + a1*a5*b2*b4 + a2*a4*b2*b4 + a2*a5*b1*b4))/(a2^2*b3^2) + (z^5*(a1^2*b4^2 + a4^2*b2^2 + a5^2*b1^2 + 2*a2^2*b4*b5 - 2*a1*a4*b1*b3 + 4*a1*a2*b3*b5 - 2*a1*a4*b2*b4 - 2*a1*a5*b1*b4 - 2*a2*a4*b1*b4 + 4*a4*a5*b1*b2 - 2*a2*a5*b2*b5))/(a2^2*b3^2) + (z^4*(2*a4*a5*b1^2 + 2*a4^2*b1*b2 + a3^2*b2*b3 + 2*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 - 2*a1*a5*b2*b5 - 2*a2*a4*b2*b5 - 2*a2*a5*b1*b5))/(a2^2*b3^2) + (z^3*(a4^2*b1^2 + a2^2*b5^2 + a3^2*b1*b3 + a3^2*b2*b4 + 2*a1^2*b4*b5 - 2*a1*a4*b2*b5 - 2*a1*a5*b1*b5 - 2*a2*a4*b1*b5))/(a2^2*b3^2) + (z^2*(2*a1*a2*b5^2 + a3^2*b1*b4 - 2*a1*a4*b1*b5))/(a2^2*b3^2) + (z*(a1^2*b5^2 + a3^2*b2*b5))/(a2^2*b3^2) + (a3^2*b1*b5)/(a2^2*b3^2), z, 2)^7*(2*a5*b2^2 - 2*a1*b2*b3 + a2*b1*b3 - 2*a2*b2*b4))/(a3*b1*(a2*b1^4*b3 + a1*b2^4*b5 - a1*b1^3*b2*b3 - a2*b1^3*b2*b4 - a2*b1*b2^3*b5 + a1*b1^2*b2^2*b4));
ch = children(expr);
ch2 = children(ch(2));
ch23 = children(ch2(3));
root_expr = ch23(1);
syms R9
newexpr = subs(expr, root_expr, R9);
[R9coeffs, R9vars] = coeffs(newexpr, R9, 'all');
R9coeffs = simplify(R9coeffs); %does not make a big difference
Javier
Javier on 18 Sep 2019
Edited: Javier on 18 Sep 2019
HI Walter, thanks again for investing your time in this issue.
I am afraid that I am getting totally confused with how the results of the sybolic solution are being given. I will briefly explain what I am tying to achieve.
I have the follwing equation system that I know the solver can solve
F1 = y^2*x*a1 + y^2*x^2*a2 + x^2*a5 + x*a4 - y*a3 ==0;
F2 = y^2*x*b1 + y^2*x^2*b2 + x^3*b3 + x^2*b4+b5 ==0;
eqns = [F1, F2]
solution = solve(eqns,[y x])
whose coefficients can be taken (for now) as
a1 = 1.8777e-07
a2 = 5.8977e-12
a3 = 1.0067e-04
a4 = 2.6364e-07
a5 = 8.2805e-12
b1 = -7.8209e-08
b2 = 9.4971e-10
b3 = 2.6668e-09
b4 = -1.0981e-07
b5 = 1.1928e-04
From the symbolic solution I get solutions to the system equations like
solution.x(1)
root(z^9 + (2*z^8*(a1*b3 + a2*b4 - a5*b2))/(a2*b3) + (z^7*(a1^2*b3^2 + a2^2*b4^2 + a5^2*b2^2 + 4*a1*a2*b3*b4 - 2*a1*a5*b2*b3 - 2*a2*a4*b2*b3 - 2*a2*a5*b1*b3 - 2*a2*a5*b2*b4))/(a2^2*b3^2) - (2*z^6*(- a1*a2*b4^2 - a4*a5*b2^2 - a1^2*b3*b4 - a5^2*b1*b2 - a2^2*b3*b5 + a1*a4*b2*b3 + a1*a5*b1*b3 + a2*a4*b1*b3 + a1*a5*b2*b4 + a2*a4*b2*b4 + a2*a5*b1*b4))/(a2^2*b3^2) + (z^5*(a1^2*b4^2 + a4^2*b2^2 + a5^2*b1^2 + 2*a2^2*b4*b5 - 2*a1*a4*b1*b3 + 4*a1*a2*b3*b5 - 2*a1*a4*b2*b4 - 2*a1*a5*b1*b4 - 2*a2*a4*b1*b4 + 4*a4*a5*b1*b2 - 2*a2*a5*b2*b5))/(a2^2*b3^2) + (z^4*(2*a4*a5*b1^2 + 2*a4^2*b1*b2 + a3^2*b2*b3 + 2*a1^2*b3*b5 - 2*a1*a4*b1*b4 + 4*a1*a2*b4*b5 - 2*a1*a5*b2*b5 - 2*a2*a4*b2*b5 - 2*a2*a5*b1*b5))/(a2^2*b3^2) + (z^3*(a4^2*b1^2 + a2^2*b5^2 + a3^2*b1*b3 + a3^2*b2*b4 + 2*a1^2*b4*b5 - 2*a1*a4*b2*b5 - 2*a1*a5*b1*b5 - 2*a2*a4*b1*b5))/(a2^2*b3^2) + (z^2*(2*a1*a2*b5^2 + a3^2*b1*b4 - 2*a1*a4*b1*b5))/(a2^2*b3^2) + (z*(a1^2*b5^2 + a3^2*b2*b5))/(a2^2*b3^2) + (a3^2*b1*b5)/(a2^2*b3^2), z, 1)
Since in my problem the coefficies ai and bi are likely to change, I was looking a way to have the solutions for x and y as function of those coefficients. Therefore, I thought I could get from the solutions (like solution.x(1)) the coefficients of them to create a "polynom", where I could apply roots and then get the real solutions for x and y to be processed later on.
Can I still apply the technique you have described above? Or is my whole procedure mistaken?
Thanks

Sign in to comment.

Categories

Find more on Financial Data Analytics 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!