To determine whether the system is stable.
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
William
am 21 Sep. 2021
Beantwortet: Star Strider
am 21 Sep. 2021
I have writen the code to determine the stability of a system. However, the result keeps saying that 'System is not stable' even if I checked the value of pm in workspace and it shows that pm equals to 1, which means that the system is marginally stable. What's wrong with it?
b = [1 0 0 -1 0];
a = [1 0 0 0 -1];
zplane(b,a)
p = roots(a);
pm = abs(p);
if max(pm) <= 1
disp('System is stable');
else
disp('System is not stable');
end
end
0 Kommentare
Akzeptierte Antwort
Star Strider
am 21 Sep. 2021
Welcome to the wonderful world of floating-point approximation error!
See ‘Check’ and ‘Check_max’ for an illustration of the probllem:
format long % View Full Precision Results
b = [1 0 0 -1 0];
a = [1 0 0 0 -1];
zplane(b,a)
p = roots(a)
pm = abs(p)
Check = pm-1
Check_max = max(pm)-1
if max(pm) <= 1
disp('System is stable');
else
disp('System is not stable');
end
% end
.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Filter Analysis 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!