0
votes

I am having a problem with simulink. Basically if I have the following system:

A = [-1 5; 0 -3]
B = [0; 1]
C = [1 0]
D = 0

And I do sys = ss(A,B,C,D) and get stepinfo(sys) this is the result:

ans =

    RiseTime: 2.3911
SettlingTime: 4.3175
 SettlingMin: 1.5042
 SettlingMax: 1.6658
   Overshoot: 0
  Undershoot: 0
        Peak: 1.6658
    PeakTime: 7.9516

When I grab simulink and do the following model:

http://i.imgur.com/KYkx1wv.png

With A , B , C , D values in the state-space block, and then export the model as follows:

Double click the scope, Paramesters->History->Save data to workspace->Format:Array

And do, from matlab, stepinfo(ScopeData(:,2)) this is what it comes up with:

ans =

    RiseTime: 11.6058
SettlingTime: 28.3085
 SettlingMin: 1.2181
 SettlingMax: 1.3331
   Overshoot: 0
  Undershoot: 0
        Peak: 1.3331
    PeakTime: 54

Why are the parameters different? What am I doing wrong?

1

1 Answers

1
votes

You're missing that

stepinfo(ScopeData(:,2))

assumes that t = 1:size(ScopeData,1).

What you want is

stepinfo(ScopeData(:,2),ScopeData(:,1))