To determine the stability of a LTI system with a two-sided impulse response has the difference equation model
5 次查看(过去 30 天)
显示 更早的评论
I am trying to determine the stability of the following system:. The following is my code:
My question is: In my code, I can only enter a single value for λ. Is there a way to express λ as a vector which contains multiple values and thus, I can prove the stability of the system with different λ simultaneously?
function stable(k)
b = [0 0 k 0 0];
a = [1 -4 k+6 -4 1];
zplane(b,a);
p = roots(a);
pm = roundn(abs(p),-4);
if max(pm)>1 %double-sided
disp('System is stable');
else
disp('System is not stable');
end
2 个评论
Mathieu NOE
2021-9-21
hello
why not simply use the already available function isstable ?
help isstable
回答(1 个)
Harikrishnan Balachandran Nair
2021-9-24
Hi,
I understand that you are trying to check the stability of the given system for different values of lamda.
You can obtain the same by having an input vector containing the values of lamda. You may use a for loop to call the function you have written , for each value in the input vector lamda.
If you do not want to have a function call for each value in the input vector, you can vectorize the whole function. The following code might help for the given system, assuming that the number of lamda values used are 6.
l=[1,2,3,4,5,6]'; %l is containing the lamda values and the number of lamda values used here are 6.
b=zeros(6,5);
b(:,3)=-1*l;
a=[1,-4,6,-4,1];
a=repmat(a,6,1);
a(:,3)=a(:,3)+l(:);
for i = 1:6
p(i,:)=roots(a(i,:));
p(i,:)=roundn(abs(p(i,:)),-4);
end
output=max(p,[],2)>1;
Alternatively, you can directly use the 'isstable' function in matlab to get the stability of all transfer functions simultaneously , by passing a model array to the function. You may refer to the documentation to get a better idea on it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Measurements and Spatial Audio 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!