how to apply stepinfo command correctly

32 visualizaciones (últimos 30 días)
Shymaa Nasser
Shymaa Nasser el 18 de En. de 2022
Respondida: Shlok el 16 de Sept. de 2024
i have a curve based on a step input using simulink the step starts at t=1 second and before this time there a intial values
i save the data given from simulink as an array
my question is how to apply stepinfo correctly to measur settling time ,overshoot,rise time or there another accurate method
thanks in advance

Respuestas (1)

Shlok
Shlok el 16 de Sept. de 2024
Hi Shymaa,
To apply the “stepinfo” function correctly using your Simulink array data, you can extract the time and output data from the simulation, then adjust for any initial conditions before the step input (starting at 1 second in your case).
After cropping the data from the point where the step input begins, you can use “stepinfo” to measure key parameters like settling time, overshoot, and rise time. Here’s a small code snippet for the same:
% Assuming out stores Simulink data
time = out.tout; % Time array
output = out.sim_output; % Response array
% Crop the data starting from the step input time
step_start_time = 1;
cropped_time = time(time >= step_start_time);
cropped_output = output(time >= step_start_time);
S = stepinfo(cropped_output, cropped_time);
fprintf('Rise Time: %.2f seconds\n', S.RiseTime);
fprintf('Settling Time: %.2f seconds\n', S.SettlingTime);
fprintf('Overshoot: %.2f%%\n', S.Overshoot);
fprintf('Peak Time: %.2f seconds\n', S.PeakTime);
To know more about “stepinfo” function, you can refer to the following documentation link:

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by