Fit Damping Coefficient from Acceleration Samples

I am trying to find the best damping coefficient to be used in my mass - spring - damper differential equation: I only have (noisy) acceleration measurements, and integrating them in order to find velocity and position does not look very formal. Here below is the code. Someone has some methods to suggest and how to implement them? Thank you.
m = 3; k = 100; bGuess = 3; x0 = 0.2; omegaf = 5;
x = @(t) x0 .* exp(- 10 .* t) .* cos(omegaf .* t);
dydt = @(t, y) [y(2); ((- b / m) * y(2) - (k / m) * (y(1) - x(t)))];
[t, y] = ode45(dydt, [0 10], [0; 0]);
samples = importdata('samples.txt');

 採用された回答

Star Strider
Star Strider 2020 年 11 月 7 日

0 投票

It depends on how you want to approach this.
If you have the data and want to fit it to an equation to estimate the parameters, the approach in How to filter noise from time-frequency data and find natural frequency of a cantilever? would likely be appropriate.
If you want to fit a differential equation to it, the approach in Parameter Estimation for a System of Differential Equations would be the way I would do it.

4 件のコメント

Antonio d'Aniello
Antonio d'Aniello 2020 年 11 月 8 日
I do not understand how the second method works actually. I only have to estimate one parameter of the differental equation
Star Strider
Star Strider 2020 年 11 月 8 日
If you want to estimate the decay rate of the waveform, ptobably the easiest way is to use the ifndpeaks funciton, then do a nonlinear regression through the peaks it identifies.
Example —
t = linspace(0,10, 250); % Time Vector
s = exp(-0.5*t).*sin(2*pi*t) + randn(size(t))/10; % Signal With Noise
[pks,locs] = findpeaks(s); % Return Peaks & Indices
objfcn = @(b,t) sin(2*pi*t).*exp(b.*t);
B = fminsearch(@(b) norm(s(locs) - objfcn(b,t(locs))), 1); % Estimate Exponential Decay
figure
plot(t, s)
hold on
plot(t, objfcn(B,t), '-r')
hold off
grid
This uses the integrated differential equation, then fits it to the data. That is the most straightforward way to do what you want.
Fitting the differential equation to the data requires the procedure described in the link I posted. The objective function uses the independent variable and parameter vector and sends it to the differential equation that is integrated (using ode45 or ode15s, as appropriate) within the objective function, and uses the integrated result with the optimisation function of your choice to estimate the parameters. This is the method-of-choice to fit the parameters of nonlinear differential equations that do not have analytic solutions.
If your differential equation has an analytic solution, it is easiest to integrate it as such, and then fit it to your data, as this example illustrates.
Antonio d'Aniello
Antonio d'Aniello 2020 年 11 月 14 日
thank you, it was very helpful!
Star Strider
Star Strider 2020 年 11 月 14 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by