Filter löschen
Filter löschen

time domain specifications calculations from graph

11 Ansichten (letzte 30 Tage)
Pranav Illinda
Pranav Illinda am 23 Jan. 2023
Bearbeitet: vikash am 22 Aug. 2024 um 9:14
from the step() inbuilt function to plot second order system response, form the graph how to mark various time domain specifications in MATLAB2022b.

Antworten (1)

vikash
vikash am 22 Aug. 2024 um 9:09
Bearbeitet: vikash am 22 Aug. 2024 um 9:14
Hi Pranav,
The step() function can be used to plot the second order system response. Here is a documentation link to Step response plot of dynamic system; step response data - MATLAB step (mathworks.com).
Also the stepinfo() function can be used to compute step-response characteristics which can then be used to update the plot of the step response. Here is a documentation link to Rise time, settling time, and other step-response characteristics - MATLAB stepinfo (mathworks.com).
Here is an attached exemplar code for your reference, hope it helps!
% Define system parameters
wn = 5; % Natural frequency (rad/s)
zeta = 0.5; % Damping ratio
% Define an exemplar transfer function
num = [wn^2]; % Numerator coefficients
den = [1, 2*zeta*wn, wn^2]; % Denominator coefficients
sys = tf(num, den);
% Plot the step response
step(sys);
hold on;
% Calculate time-domain specifications
info = stepinfo(sys);
% Mark Rise Time
plot([info.RiseTime info.RiseTime], [0 1], 'r--', 'DisplayName', 'Rise Time');
% Mark Peak Time
plot([info.PeakTime info.PeakTime], [0 info.Peak], 'g--', 'DisplayName', 'Peak Time');
% Mark Settling Time
plot([info.SettlingTime info.SettlingTime], [0 1], 'b--', 'DisplayName', 'Settling Time');
% Mark Overshoot
plot(info.PeakTime, info.Peak, 'ro', 'DisplayName', 'Overshoot');
% Add labels and legend
xlabel('Time (seconds)');
ylabel('Response');
title('Step Response with Time Domain Specifications');
legend('show');
hold off;

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by