How and what is the time period of following function
5 views (last 30 days)
Show older comments
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;
0 Comments
Answers (2)
Jon
on 2 Dec 2021
Edited: Jon
on 2 Dec 2021
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)
0 Comments
Star Strider
on 2 Dec 2021
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
SI = stepinfo(sys)
figure
step(sys)
grid
.
1 Comment
Jon
on 2 Dec 2021
Edited: Jon
on 2 Dec 2021
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!
See Also
Categories
Find more on Pole and Zero Locations 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!