Different results between Step and Stepinfo
조회 수: 13 (최근 30일)
이전 댓글 표시
Hi,
I'm running R2020b update 5.
This is my code:
s = tf('s');
G3 = (25/5.05)/(s^3+(101/5.05)*s^2+(505.2/5.05)*s+100/5.05);
roots_3 = roots([1 101/5.05 505.2/5.05 100/5.05]);
G3_c = 500.789*((s-roots_3(2))*(s+.0273103))/((s+29.356)*(s+0.01));
G3_final = G3*G3_c;
TS_3 = feedback(G3_final,1);
[y3,t3_2] = step(TS_3);
si = stepinfo(y3,t3_2);
step(TS_3)
This gives me this graph:
However, my stepinfo gives:
RiseTime: 0.1871
SettlingTime: 1.0105
SettlingMin: 0.9213
SettlingMax: 1.1644
Overshoot: 18.5698
Undershoot: 0
Peak: 1.1644
PeakTime: 0.4386
These are very different. Any help?
댓글 수: 0
답변 (2개)
Vidhi Agarwal
2024년 2월 22일
Hi Gerard,
I understand you encountering discrepancy between the values of percentage overshoot in step-response graph and stepinfo() data.
This is occurring because the response has not fully settled here due to the near cancellation of the slow pole/zero pair at s=-0.027, using the (y,t) data out of STEP to compute the characteristics will be inaccuracies. To fix this, you can either use:
si = stepinfo(sys)
or specify a large enough final time for STEP:
[y,t] = step(TS_3,200);
si = stepinfo(y,t)
I hope this solves your problem.
댓글 수: 0
Sam Chak
2024년 2월 22일
The main reason behind the difference in the step-response characteristics between Approach 1 (from Transfer function) and Approach 2 (from Response data) is that you didn't compare them in a consistent manner. Additionally, it's worth noting that the computation of response characteristics has changed since R2021b.
To ensure accurate comparison, here's the correct procedure:
%% Transfer function
s = tf('s');
G3 = (25/5.05)/(s^3+(101/5.05)*s^2+(505.2/5.05)*s+100/5.05);
roots_3 = roots([1 101/5.05 505.2/5.05 100/5.05]);
G3_c = 500.789*((s-roots_3(2))*(s+.0273103))/((s+29.356)*(s+0.01));
G3_final = G3*G3_c;
TS_3 = feedback(G3_final, 1)
%% Steady-state response (need this in Approach #2)
ssr = dcgain(TS_3)
%% Approach 1: Obtain step-response characteristics from transfer function
si_1 = stepinfo(TS_3);
%% Approach 2: Obtain step-response characteristics from the response data
[y3, t3_2] = step(TS_3);
si_2 = stepinfo(y3, t3_2, ssr);
%% Comparing the characteristics between both approaches
stepInfoTable = struct2table([si_1, si_2]);
stepInfoTable = removevars(stepInfoTable, {...
'SettlingMin', 'SettlingMax', 'Undershoot', 'PeakTime'});
stepInfoTable.Properties.RowNames = {'Approach 1', 'Approach 2'};
stepInfoTable
%% Plot results
step(TS_3), hold on
plot(t3_2, y3), grid on
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Time and Frequency Domain Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!