MATLAB Answers

How to draw a tangent line on a step response diagram

49 views (last 30 days)
Yubin ZHONG
Yubin ZHONG on 27 Nov 2019
Answered: Samatha Aleti on 29 Jan 2020
微信截图_20191128012715.png
When I get the step response by sisotool like pic 1m how can I get the tangent line and the value of L, T in pic 2?

Answers (1)

Samatha Aleti
Samatha Aleti on 29 Jan 2020
You can draw a tangent to a step response curve at a particular point as follows:
sys = tf([8 18 32],[1 6 14 24]); % Transfer function
[y,t] = step(sys); % Step response
plot(t,y);
hold on
slope = diff(y)./diff(t);
k = 100; % To draw tangent at (100)th point
yTangent = (t-t(k))*slope(k)+y(k); % Equation of tangent
plot(t,yTangent);
scatter(t(k),yTangent(k));
hold off

  0 Comments

Sign in to comment.

Sign in to answer this question.