I'm using greyest() to find the correct parameter values of a transfer function. I have the input signal and the response of a Grey-Box dynamic system. Follows the code:
tsample = in.t(2)-in.t(1);
data = iddata(out.v,in.v,tsample);
Rf = 600e6;
Cf = 0.6e-9;
Rin = 0.56e3;
parameters = {'Rin',Rin;'Rf',Rf;'Cf',Cf};
sys = idgrey('amplif',parameters,'d',{},tsample);
opt = greyestOptions;
opt.InitialState = 'auto';
opt.SearchOptions.MaxIterations = 200;
opt.SearchOptions.Tolerance = 1e-200;
opt.Display = 'on';
opt.SearchMethod = 'grad';
Model = greyest(data,sys,opt)
Folllows the function "amplif.m":
function [A,B,C,D] = amplif(Rf, Cf, Rin, Ts)
% ODE function for computing state-space matrices as functions of parameters
Ac =[-(Cf*Rf + 2218.8e-12*Rin)/(Cf*2218.8e-12*Rf*Rin) -1/(Cf*2218.8e-12*Rf*Rin); 1 0];
Bc = [1; 0]; Cc = [-1/(Cf*Rin) 0];
Dc = 0;
% Discretize sysc = ss(Ac,Bc,Cc,Dc);
sysd = c2d(sysc,Ts,'least-squares');
[A,B,C,D] = ssdata(sysd);
I haven't found any problems with my code, although the output is always being the same values as initial parameters (Rf, Cf and Rin).
How to solve this problem!?
I tried to change some optinos of greyest function em to change the initial values of the three parameters.
Nothing is working.
I hope to find the correct values of the three parameters, depending on input and output of the dynamic system.