How and what is the time period of following function

5 次查看(过去 30 天)
Hi, I am a little bit struggling to find a time period for the folowing code and it's graph.
It is a step response of a RCL circuit and I need to find a time period of it.
R = 1;%Given values
C = 0.01;
L = 0.01;
RC = R*C;
LC = L*C;
sys = tf([1/LC],[1 R/L 1/LC])%upper part and denominator part
subplot(2,1,1)
step(sys)
grid;
subplot(2,1,2)
impulse(sys)
grid;

回答(2 个)

Jon
Jon 2021-12-2
编辑:Jon 2021-12-2
I think you are looking for a characteristic time duration for your circuit. One common criteria is the settling time following a step command. Here is some code that would calculate that
R = 1;%Given values
C = 0.01;
L = 0.01;
RC = R*C;
LC = L*C;
sys = tf([1/LC],[1 R/L 1/LC])%upper part and denominator part
% get response data
[yStep,tStep] = step(sys)
% find settling time to step input
% which we define here as the last time it leaves band of +/-3% of final value
settlingThreshold = 0.03; % could use other value here, depends on you criteria
finalValue = 1;
idx = find(abs(yStep - finalValue)/finalValue > settlingThreshold,1,'last');
tSettle = tStep(idx)

Star Strider
Star Strider 2021-12-2
The stepinfo function will give essentially all the relevant information —
R = 1;%Given values
C = 0.01;
L = 0.01;
RC = R*C;
LC = L*C;
sys = tf([1/LC],[1 R/L 1/LC])%upper part and denominator part
sys = 10000 ------------------- s^2 + 100 s + 10000 Continuous-time transfer function.
SI = stepinfo(sys)
SI = struct with fields:
RiseTime: 0.0164 TransientTime: 0.0808 SettlingTime: 0.0808 SettlingMin: 0.9315 SettlingMax: 1.1629 Overshoot: 16.2929 Undershoot: 0 Peak: 1.1629 PeakTime: 0.0359
figure
step(sys)
grid
.
  1 个评论
Jon
Jon 2021-12-2
编辑:Jon 2021-12-2
Thanks, I didn't know about the stepinfo function, very nice!
I see now that I can find that command immediately by Googling the terms: matlab step response settling, also it is on the list searching with these same terms on the internal documentation.
I'll have to remember to search more before writing code!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Pole and Zero Locations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by