Curve fitting a complex function using cftool
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm using the cftool toolbox to find fits for a complex valued transfer function. The toolbox clearly can't handle a complex numbers, so I have separated the data into its real and imaginary components and I now have two curve fits.
By way of background, my data is an Accelerance Frequency Response Function obtained from an impact hammer test of a structure and ought to look something like this:
H = (-w^2) / (k-(w^2)m+iwc)
where w is frequency in rad/s, k is stiffness, m is mass and c is damping.
My question is this: is there a simple way that the cftool can find the best fit for both data sets without giving me two separate values for mass, stiffness and damping? Put another way, is it possible to force the coefficients from two curve fits to be co-dependant and thereby find the best fit for the complex valued data?
0 comentarios
Respuesta aceptada
Matt J
el 31 de En. de 2013
I don't think so, but LSQCURVEFIT can fit vector-valued functions, if you've got it.
Más respuestas (2)
Craig Cowled
el 3 de Mayo de 2013
4 comentarios
Matt J
el 24 de Mayo de 2013
Editada: Matt J
el 24 de Mayo de 2013
y1 = abs(window'.*y)
I'm sure you'll be skeptical, since you've already reached results that you like. However, the above part isn't the best idea because the use of ABS() makes your residuals non-differentiable in regions where window'.*y are close to zero. The algorithms used by LSQNONLIN, however, assume differentiability. One way to avoid this is to use abs().^2 instead.
However, it's probably even better just to split up into real/imaginary parts as Zhang proposed. This really doesn't involve code any more complicated than what you're doing now. There is no real advantage trying to avoid it:
delt = window' .* (y-z);
deltaH = [real(delt(:)); imag(delt(:))];
That's it. Only simple changes to your last 2 lines of code required.
Finally, note that this same technique could have been applied in LSQCURVEFIT as well, and with the same ease.
Craig Cowled
el 25 de Mayo de 2013
1 comentario
Matt J
el 25 de Mayo de 2013
Editada: Matt J
el 25 de Mayo de 2013
The 7% difference is interesting, though. You might experiment by trying to solve with simulated data where you know the ground truth k,m,c. Then you can know which approach is really more accurate. Similar to what you say in (1), my intuition is also that the real/imag approach should do better, since it uses a larger number of directly observable data.
Ver también
Categorías
Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!