Step Response of Transfer Function is Different Than Response of State Space

15 views (last 30 days)
Hello everyone,
I am working on linearization of my nonlinear model (6DOF aircraft model) and I used the Linear Analysis Tool to generate the state space model and produce a step response. Which is shown below:
However, when I take my state space model to the MATLAB Workspace, and I find the transfer function by extracting the A, B, C, and D matrices, then I generate a step response of the transfer function, I do not get the same response from the Linear Analysis Tool. See the code and output below:
A= linsys1.A;
B= linsys1.B;
C= linsys1.C;
D= linsys1.D;
[num, den]= ss2tf(A,B,C,D);
G=tf(num,den);
step(G)
step(linsys1)
When I try to use step(linsys1) instead, I get the same plot as in the Linear Analysis Tool. What is the reason that the step response of the Transfer Function not matching the one of the state space?
  2 Comments
Mathieu NOE
Mathieu NOE on 30 Mar 2022
hello
maybe there is an error in this line
[num, den]= ss2tf(A,B,C,D);
because the input number is not defined
doc says :
[NUM,DEN] = ss2tf(A,B,C,D,iu) calculates the transfer function from the iu'th input

Sign in to comment.

Accepted Answer

Paul
Paul on 30 Mar 2022
Is linsys1 a discrete-time or continuous-time, i.e., what is the output of
linsys.Ts
If the result of that command is not zero, then try
G = tf(num,den,linsys.Ts)
Or the simpler
G = tf(linsys);
step(G)
If tf(linsys) doesn't do the trick, then there may be other aspects to investigate. In general, if you already have an ss object, that's what should be used.
  1 Comment
Gee
Gee on 30 Mar 2022
Hi Paul. Thanks for the answer. Yes, Linsys1 is a discrete-time (Ts=1/30 s). I modified the Ts of the transfer function but it still does not give me the correct response. I also tried your last suggestion and it didn't work as well. Looks like I will stick to the ss object and use it to plot step response.

Sign in to comment.

More Answers (0)

Categories

Find more on Linearization 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!