grey box parameter estimation with discrete time and force data .
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Rajiv Singh
2011-8-22
The model suggests it has 2 outputs and 1 input. So I guess "y" should be matrix with 2 columns.
2 个评论
Rajiv Singh
2011-8-22
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Model Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!