To determine the stability of a LTI system with a two-sided impulse response has the difference equation model
8 views (last 30 days)
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?
b = [0 0 k 0 0];
a = [1 -4 k+6 -4 1];
p = roots(a);
pm = roundn(abs(p),-4);
if max(pm)>1 %double-sided
disp('System is stable');
disp('System is not stable');
Harikrishnan Balachandran Nair on 24 Sep 2021
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.
for i = 1:6
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.