Working With Reciprocal of Polynomials

10 visualizaciones (últimos 30 días)
Daniel
Daniel el 25 de Ag. de 2024
Comentada: Daniel el 26 de Ag. de 2024
Hello, this is my first post in this form and I am new to MatLab. I would like to take the reciprocal of a polynomial in factored form and express the answer in polynomial form. For example, I wish to convert 10/((x+3)^2(x+5)) in regular polynomial form.
  4 comentarios
Daniel
Daniel el 25 de Ag. de 2024
I think maybe I am asking Matlab to perform something that can’t be done. I want to divide a number by an expression that is in factored form and assign the answer to a variable. I thought using the poly command provides the coefficients of a polynomial and also is the expression itself. But results of the poly command simply outputs an array of numbers. I just may be going about this in the wrong way.
Torsten
Torsten el 25 de Ag. de 2024
Editada: Torsten el 25 de Ag. de 2024
syms x
p = (x+3)^2*(x+5)
p = 
expand(p)
ans = 
coeffs(p)
ans = 
What do you want to do next ?

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Ag. de 2024
Movida: Sam Chak el 26 de Ag. de 2024
It is difficult to tell what you want?
syms x
f = 10/((x+3).^2.*(x+5))
f = 
[N, D] = numden(f)
N = 
10
D = 
C = coeffs(D, x)
C = 
poly2sym(C, x)
ans = 
tf(double(N), double(C))
ans = 10 -------------------------- 45 s^3 + 39 s^2 + 11 s + 1 Continuous-time transfer function.
  3 comentarios
Sam Chak
Sam Chak el 26 de Ag. de 2024
Given that you found the suggested solution helpful and your problem has been resolved, please consider clicking "Accept" on the answer to close the issue. This helps provide closure and mark the question as answered for the benefit of the community.
Daniel
Daniel el 26 de Ag. de 2024
Thank you. Will do!

Iniciar sesión para comentar.

Más respuestas (1)

Naga
Naga el 25 de Ag. de 2024
Editada: Walter Roberson el 25 de Ag. de 2024
Hello Daniel,
To convert a polynomial in factored form to regular polynomial form, you can use the poly function in MATLAB. Here's an example:
% Define the factored polynomial
num = 10;
den = conv(conv([1 3], [1 3]), [1 5]);
% Convert to regular polynomial form
coeffs = num * poly(den)
coeffs = 1x5
10 -960 27740 -219840 193050
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
The 'poly' function converts the factored form to regular polynomial form, and then we multiply it by the numerator to get the coefficients of the regular polynomial. Please refer to the following documentation for more information on 'poly' function:
Hope this helps!
  3 comentarios
Sam Chak
Sam Chak el 26 de Ag. de 2024
I'm a little confused. Are you referring to an inverse function or a reciprocal function? If reciprocal function, then the title of your question is misleading and please consider amending it.
Daniel
Daniel el 26 de Ag. de 2024
Sam,
Darn, I meant reciprocal not inverse. I changed the title. Got these mixed up. Sorry for confusion. I did learn a lot from everyone's answers. Thank you.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by