I am trying to use invfreqs to get the transferfunction from frequency response data.
I have the frequency response measured at 0.5 Hz, 1Hz, 2HZ, 4Hz and 6Hz. I used a 3rd order for the numerator and 4th order for the denominator. The complex frequency reponse is as follows:
30.56 + i 3.143
33.75 + i 1.916
34.36 + i 1.860
33.69 + i 6.308
35.86 + i 5.768
When I used invfreqs, I got the following transfer function.
Numerator =
1.0e+007 *
-0.0014 -0.0177 -0.7040 -1.9653
Denominator =
1.0e+005 *
0.0000 -0.0038 -0.0504 -1.9995 -6.7095
Looking at the Numerator and Denominator, i feel there is something wrong.
Now when I plot the reposnse using the transfer function, there is not a good match between the desired response and the actual response.
Please suggest if I am doing anything wrong while obtaining the transfer function.
Thanks
Madhu
Rajiv
"Madhu Shurpali" <madhu.s...@cvgrp.com> wrote in message
news:hlikk3$l6a$1...@fred.mathworks.com...
Wayne and Rajiv thanks a lot for the advice.
Wayne: I think the Sampling freq doesnt come into picutre here. The way I got my Complex Freq response is as follows:
I input a displacement of 0.5 Hz freq and 5 mm amplitude sine wave into my specimen and measured the force as the output. Now my specimen has some damping in it so when I plot Disp Vs Force I get a elliptical hysteresis curve. From the Hysteresis curve I get the stiffness and damping. I did this at Freqs of 0.5 Hz, 1Hz, 2HZ, 4Hz and 6Hz keeping the amplitude constant. Thus I got the stiffness and damping at each Freq. From the stiffness and damping at each freq I came up with the Complex Freq response.
Also since I am trying to get the transfer function in the s domain, freq normalisation will not be done.
Thanks for all the help
freq = [0.314159 3.141592654, 6.283185307, 12.56637061, 25.13274123, 37.69911184];
Real = [31.93 32.914 34.25 34.6 33.18 36.57 ];
Img = [3.446 2.941 1.828 1.646 7.213 7.955];
Response = complex(Real, Img);
Respone_model = idfrd(Response, freq, 0);
Tf_model = oe(Respone_model, [3 4]);
With this my Tranfer function model predicted was as follows:
>> Tf_model.b
ans =
1.0e+008 *
0.0023 -0.0253 1.2619
>> Tf_model.f
ans =
1.0e+006 *
0.0000 -0.0000 0.0081 -0.0945 3.8178
These values I feel are very large and I think I doing something wrong.. Can you please comment on the script and the Trasnfer function that 'OE' has predicted.
P.S: I am trying to get the continuous time transfer function model.
Thanks
Madhu
Sorry Madhu, I read invfreqz instead of infreqs, my mistake. Do you obtain the transfer function based on
freq = [0.314159 3.141592654, 6.283185307, 12.56637061, 25.13274123, 37.69911184];
Real = [31.93 32.914 34.25 34.6 33.18 36.57 ];
Imag = [3.446 2.941 1.828 1.646 7.213 7.955];
h = Real+1j*Imag;
[b,a]= invfreqs(h,freq,3,4);
sys = tf(b,a);
% yields
Transfer function:
-1.065e004 s^3 - 1.564e005 s^2 - 6.269e006 s - 7.586e006
--------------------------------------------------------
s^4 - 264.7 s^3 - 4039 s^2 - 1.768e005 s - 2.558e005
Can you say what doesn't seem right about it? You say looking at it, it doesn't seem right.
Sorry again about misreading your post.
Wayne
Ok, heres what I did: To check my model in time domain, I built a simple simulink model consisting of the following:
A sinewave input block, a transfer function block and a scope block. Output of sinewave goes into tansfer function block and output of transfer function goes into scope. I define the transfer function as per the coefficients I got from the invfreqs function. For solving I used a variable step, ode45 solver with other parameters at the default value.
Now when I simulate, with a 10mm, 5Hz sinewave I get unrealistically high values. I expect a sinewave with a gain of about 34. I am able to understand this phenomena.
Thanks for the help.
Madhu
"I am unable to understand the phenomena"
Somebody please help.. I am not able to go forward from here.
Model order selection is a real problem in the scientific community at this point. There are several criterions you can use (such as Akaike's Information Criterion) but it is still complicated.
The divergence you see is because (assuming you are obtaining a denominator similar to the one in your previous post) you have a positive real pole, i.e. your plant is unstable. So again, start with smaller orders and work your way up until you find the best possible fit.
While using the system identification toolbox is good advice, there are some things you need to check before that, for example:
1) Noise levels, if big your estimates will be biased and hence your response won't look alike to your physical plant.
2) Why are you picking such model orders in the first place. If you over or under specify your transfer function structure your estimates will also be wrong. In the same vein, and if the noise levels are small there is no reason why invfreq shouldn't work unless your model structure is incorrect.
I hope this helps
Thanks a lot for the help. My results were much better when I specified both the Numeraor and Denominator of order 4.
Now this brings me to the question, how do we select a proper model or order for the model. Is there any reference that I can look into to get this information.
Thanks
Madhu