Effacer les filtres
Effacer les filtres

grey box parameter estimation with discrete time and force data .

1 vue (au cours des 30 derniers jours)
shravankumar
shravankumar le 21 Août 2011
The dynamic equation of the physical model
m*(xdbldot)+c*(xdot)+k*(x)=m*e*w^2*cos(w*t+beta)
where RHS is the unbalance force in a rotating shaft
I am trying to estimate 'c' and 'e', referring matlab docs http://www.mathworks.com/help/toolbox/ident/ug/bq4npe3.html#bq47gsk, as follows:
function [A,B,C,D,K,x0]=myfunc(par,T,aux)
m=4;w=40;beta=10*pi/180;k=20000;
A=[0 1;-(k/m) -(par(1)/m)];
B=[0;par(2)*w*cos(w*(0:0.01:2)+beta)];
C=eye(2);
D=zeros(2,1);
K=zeros(2,2);
x0=[par(3);0];
and for estimation
par=[10;0.0001;0]
tspan=0:0.01:2;
T=0.01;
aux=1;
y=dlmread('data.txt');
u=dlmread('data1.txt');
data=iddata(y,u,T,'SamplingInstants',tspan);
m=idgrey('myfunc',par,'d',0.01,1)
model=pem(data,m)
y and u are column vectors of size 201. They correspond to experimental data of displacement and force and donot contain any time data.
I get the error :
??? Error using ==> idgrey.idgrey at 134
Error or mismatch in M-file and Parameter or FileArgument size. Evaluation of
the M-file "myfunc" throws the following error:
CAT arguments dimensions are not consistent.
Error in ==> estimate at 10
m=idgrey('myfunc',par,'d',0.01,1)
I am comfortable with the concept of this estimation but somewhere with the syntax and coding i am going wrong.
Thanks in advance,
Shravan.

Réponses (1)

Rajiv Singh
Rajiv Singh le 22 Août 2011
The model suggests it has 2 outputs and 1 input. So I guess "y" should be matrix with 2 columns.
  2 commentaires
shravankumar
shravankumar le 22 Août 2011
Sir, as of now i have only numerically generated(in place of experimental data) 'y' which is a nX2 size matrix containing displacement and velocity data. I have also tried considering only displacement data in y. Eitherway, i am facing the above mentioned error. I suspect my fault in supplying time data (0:0.01:2) as in the line B=[0;par(2)*w*cos(w*(0:0.01:2)+beta)]; and also not sure where to specify sampling rate.
Rajiv Singh
Rajiv Singh le 22 Août 2011
The B is a constant matrix of size 2-by-1 for your example. You are inserting a time vector in it which seems wrong. Does that value of B depend upon time? If so, IDGREY is not going to help since it is meant to represent time invariant linear systems. If instead you meant to use the sampling rate in the formula, you should use:
B = [0;par(2)*w*cos(w*T+beta)];
Note that the second input argument to "myfunc" is the sampling interval T.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Linear Model Identification dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by