Transfer function long format
Afficher commentaires plus anciens
Hi,
So I wrote this function to give me the transfer function of a state space model.
A = [0,1,0;0,-1,2;0,0,-2];
B = [0;0;1];
C = [1,0,0];
D = 0;
[n,d] = ss2tf(A,B,C,D); % gives numerator and denominator of transfer function
partCtf = tf(n,d); % takes numerator and denominator and rearrange them into a proper fraction
display(partCtf);
However, it keeps giving me this transfer function
Transfer function:
2.665e-015 s^2 + 1.332e-015 s + 2
---------------------------------
s^3 + 3 s^2 + 2 s
When i compute the transfer function by hand, i get the same answer except for the two first values in the numerator, they should be zero. Is there anyway so I can make it so the first two values in the numerator are zero?
Réponses (1)
Azzi Abdelmalek
le 9 Déc 2012
Modifié(e) : Azzi Abdelmalek
le 9 Déc 2012
2.665e-015 is almost equal to zero, because of numerical errors. to eliminate the two first elements
n(1:2)=[]
model=tf(n,d)
Catégories
En savoir plus sur Dynamic System Models dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!