Taking away transfer functions

15 visualizaciones (últimos 30 días)
Matthew
Matthew el 9 de Mzo. de 2023
Editada: Walter Roberson el 9 de Mzo. de 2023
Hello.
I am having some issues wonder where i am going wrong. I have 2 transfer functions and one needs to be taken away from the other. When working this out by hand and online maths sites MATLAB is not giving the same answer.
Here is my code
num1 = [-0.2 -5 10];
den1 = [1 0];
tf1 = tf(num1,den1)
num2 = [-0.2 -10 100];
den2 = [1 0];
tf2 = tf(num2,den2)
final = tf2-tf1
It is
((-0.2s^2-5s+10)/s)-((-0.2s^2-10s+100)/s)
by hand this should give me (5s-90)/s but MATLAB is giving me (5s^2-90s)/s^2
Does anyone have any idea where i have gone wrong?
Sorry if it is a simple answer i am still learning.

Respuesta aceptada

Steven Lord
Steven Lord el 9 de Mzo. de 2023
by hand this should give me (5s-90)/s but MATLAB is giving me (5s^2-90s)/s^2
Assuming s isn't 0 (in which case evaluating your transfer functions tf1 and tf2 both result in Inf, 10/0 and 100/0 respectively) it's mathematically valid to multiply the result you computed by hand by 1 in the form s/s. If you do that and expand the numerator you'll see that the two results are equivalent.
If the denominators of the two transfer functions were different, to subtract them you'd need to give them the same denominator. One way to do this is to multiply each transfer function by the denominator of the other transfer function in which case the common denominator is the product of the denominators. I suspect you skipped this step in your hand calculations because you knew from inspection that the denominators of both transfer functions were the same and so you just subtracted the numerators. MATLAB didn't skip that step.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by