Problem using IDSS command

Hi Everyone: I am using the 'idss' command for my project which is "Fault Detection in UAVs" and to add the fault vector in my state space I am using the 'idss' command. But the problem arises when I try to calculate the output of the state space using 'lsim' it does not seem to work with 'idss' and gives the error: For multi-input multi-output (MIMO) models both input and output indices must be given. What is the problem? Also is there any other way by which I can add fault vectors in state space? My Code is: A=[-0.64 1.51 -22.95 9.78 0 -4.19 -20.63 9.93 0 0 0.68 -2.68 -1.04 0 0 0 1.00 0 0 0 0 0 1.00 0 0];
B=[-1.25 3.19 -109.84 1.98 -4.33 -20.17 0 0 0 0]; C=[0.04 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1]; D=zeros(5,2); sys=idss(A,B,C,D,ones(5,5)); [y]=lsim(sys,u,t,zeros(5,1));

3 commentaires

I tried running your code (uses zero inputs since those weren't provided) and it runs fine for me.
A = [-0.64 1.51 -22.95 9.78 0; -4.19 -20.63 9.93 0 0; 0.68 -2.68 -1.04 0 0; 0 1.00 0 0 0; 0 0 1.00 0 0];
B = [-1.25 3.19; -109.84 1.98; -4.33 -20.17; 0 0; 0 0];
C = [0.04 0 0 0 0; 0 1 0 0 0; 0 0 1 0 0; 0 0 0 1 0; 0 0 0 0 1];
D = zeros(5,2);
t = 0:100;
u = zeros(101,2);
sys = idss(A,B,C,D,ones(5,5));
[y,t] = lsim(sys,u,t,zeros(5,1));
plot(t,y)
What exactly is the issue you are running into? I'm guessing you are defining the "u" and "t" vectors in a different way, and that's causing the errors you see.
Qandeel
Qandeel le 29 Mar 2015
Nope. I defined t=0:50; u=ones(length(t),2); but still getting the same error, can it be due to the version of MATLAB I am using, I am using R2009b!!
I see... are you able to convert this to a regular SS (from Control System Toolbox) to do your simulation?
>> sys2 = ss(sys)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur System Identification Toolbox dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by