- 'stepinfo' function: https://www.mathworks.com/help/control/ref/dynamicsystem.stepinfo.html
how can I get overshoot, rise time, settling time... from an output?
10 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
Balavignesh
2024-1-15
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:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!