fitting a transfer function from acquired data with tfest

7 次查看(过去 30 天)
Hi,
I would like to fit a transfer function with data I have acquired. I am using the tfest function for this but the function isn't fitting the kind of transfer function I need. I know that my transfer function has the form:
N = [x 0]
D = [a b c d 1]
with this knowlegde I have detailed in the function that I need 1 zero and 4 poles. But tfest doesn't get my nominator right. It always adds a constant in my nominator wich ruins my fit...
can someone help me with this?
thank you!

回答(1 个)

Rajiv Singh
Rajiv Singh 2012-11-26
What do you mean by "nominator"? N or D? Note that IDTF creates transfer functions that have a monic polynomial for the denominator (D). In general, if you want to fix certain entries to their known values, you have to do a multi-step construction:
N = [NaN 0];
D = [1 NaN(1,3), 1];
% say, you want N(2) and D(end) to be fixed.
model = idtf(N,D);
model.Structure.num.Free(2) = false;
model.Structure.den.Free(end) = false;
model = tfest(data, model);
  2 个评论
Maxim
Maxim 2012-11-27
thank you, I can do the fit in the right form. But the fit itself is very bad.. it does not even come close to my data
Rajiv Singh
Rajiv Singh 2012-11-27
Difficult to say why without looking at the data. But fixing parameters can adversely affect the quality of the fit. You may try a free form estimation, get the model with a good fit and then reduce it or transform it to get it in the form you want. You can then even update the coefficients of the final form to improve fit to data.
model1 = tfest(data, Np, Nz);
model2 = some_reduction_of_model1_to_get_desired_form;
model2refined = tfest(data, model2);
The problem usually is bad initialization of the model coefficients by the estimator in presence of constraints. In the code snippet I gave earlier, you can try replacing NaNs with finite values obtained from your own intuition into what those values ought to be. You can then study the effect of initial guesses on the quality of the final results and perhaps use that as a guide to converge to good results.

请先登录,再进行评论。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by