Borrar filtros
Borrar filtros

time domain specifications calculations from graph

11 visualizaciones (últimos 30 días)
Pranav Illinda
Pranav Illinda el 23 de En. de 2023
Editada: vikash el 22 de Ag. de 2024 a las 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.

Respuestas (1)

vikash
vikash el 22 de Ag. de 2024 a las 9:09
Editada: vikash el 22 de Ag. de 2024 a las 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;

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by