How can I find the trivial solution to a polynomial equation?

1 visualización (últimos 30 días)
Given is a polynomial of the folllowing form,
pol = c11 + c12*x + c13*x^2 + c14*x^3 - (c21 + c22*x + c23*x^2 + c34*x^3)
How can I have MATLAB find the trivial roots 'c11 = c21', 'c12 = c22', 'c13 = c23' and 'c14 = c34' by means of the Symbolic Math Toolbox?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 24 de Sept. de 2021
Firstly, function 'coeffs' has to be used in order to factorize the latter expression with respect to the unknown variable 'x', namely,
 
syms c11 c12 c13 c14 c21 c22 c23 c34 x
pol = c11 + c12*x + c13*x^2 + c14*x^3 - (c21 + c22*x + c23*x^2 + c34*x^3);
pol_c = coeffs(pol,x)
See the following documentation page for more information accordingly,
This will return a vector of the corresponding factors of the latter polynomial expression with respect to 'x' that has the size of the number of powers of 'x' in the expression, from 0 up to the highest power. Thus, in this case one would obtain a vector 'pol_c' with four symbolic factors, namely,
>> pol_c
pol_c =
[c11 - c21, c12 - c22, c13 - c23, c14 - c34]
Then, please consider using function 'solve' for the symbolic equation that results if you set the latter vector equal to a vector of zeros, namely,
 sol = solve(pol_c == zeros(1, length(pol_c)));
In this way, 'sol' is a struct that contains as field names the names of the unknown variables and as fields the corresponding solution for each of the aforementioned equations. For instance,
>> sol.c11
ans =
c21

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by