how can I get overshoot, rise time, settling time... from an output?

8 Ansichten (letzte 30 Tage)
ys fan
ys fan am 6 Sep. 2016
Beantwortet: Balavignesh am 15 Jan. 2024
I use simulink to get an output,and I want to get overshoot,rise time,settling time...like that overshoot=... rise time=xxx second, settling time=xxx second.Then I want to make a function: f=A*overshoot+B*rise time+C*settling time

Antworten (1)

Balavignesh
Balavignesh am 15 Jan. 2024
Hi Ys,
After simulating the system in Simulink and obtaining the output signal, make sure to log the output to the MATLAB workspace for analysis, You could use MATLAB functions like 'stepinfo' to get overshoot, rise time, and settling time. After getting the necessary values, create a MATLAB function to calculate the weighted sum of these characteristics.
The following example code snippet may help you understand this concept:
% Assume 'simOut' is the variable containing the simulation output, with the signal of interest logged as 'yout'
% You can log signals to the workspace by using To Workspace blocks or signal logging
% Extract the output signal and time vector
t = simOut.yout.Time;
y = simOut.yout.Data;
% Extract the characteristics
overshoot = responseInfo.Overshoot;
riseTime = responseInfo.RiseTime;
settlingTime = responseInfo.SettlingTime;
% Display the characteristics
fprintf('Overshoot = %.2f%%\n', overshoot);
fprintf('Rise Time = %.4f second\n', riseTime);
fprintf('Settling Time = %.4f second\n', settlingTime);
% Define the weighted sum function
weightedSumFunction = @(A, B, C) A*overshoot + B*riseTime + C*settlingTime;
% Example usage of the weighted sum function with weights A, B, and C
A = 1; % Example weight for overshoot
B = 1; % Example weight for rise time
C = 1; % Example weight for settling time
weightedSum = weightedSumFunction(A, B, C);
% Display the weighted sum
fprintf('Weighted Sum = %.4f\n', weightedSum);
Kindly have a look at the following documentation link to have more information on:

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by