Curve-fitting by Levenberg–Marquardt method??

10 ビュー (過去 30 日間)
Dave Yadeta
Dave Yadeta 2013 年 3 月 25 日
I am new to Matlab, but I want to write a matlab code to estimate the values of spring and damper coefficients to fit a function to data curve. I have a simultaneous ode equation for acceleration of a planar rigid body(mass=m) connected to a pair of spring and damper in parallel in x-axis and another pair in y-axis directions as follows.
M*D2X(t)=-Cx*DX(t)-Kx*X(t)+w*DY(t)
M*D2Y(t)=-Cy*DY(t)-Ky*Y(t)+w*DX(t)
where: M=mass C=damper coefficient K=spring coefficient w =yaw rate (constant value) In addition to the functions above, I have x-axis and y-axis direction acceleration data from experimental measurement. So, how can I estimate four parameters Kx ,Cx , Ky and Cy?? I appreciate any hint or help!!

採用された回答

Matt J
Matt J 2013 年 3 月 25 日
編集済み: Matt J 2013 年 3 月 25 日
So X,Y are positions or accelerations? If they are positions and you have acceleration data, D2X and D2Y you can integration that data numerically to obtain X,Y, DX,DY. Then, your equations become linear and you can use total lienar least squares to solve them.
  3 件のコメント
Matt J
Matt J 2013 年 3 月 25 日
編集済み: Matt J 2013 年 3 月 25 日
I'm not sure that anything is wrong, and you haven't mentioned any symptoms. However, I wonder if you need anthing that complicated. Your differential equations are linear, after all, yet you seem to be attempting a very complicated non-linear method of solution. If you have measurements of D2X and D2Y, you can compute DX,DY,X,and Y as follows
DX=trapz(time,DX2);
DY=trapz(time,DY2);
X=trapz(time,DX);
Y=trapz(time,DY);
Now you construct linear equations in your unknown parameters
Ax=[DX(:), X(:)]; %equation Ax*CxKx=bx
bx=[w*DY(:)-M*D2X(:)];
Ay=[DY(:), Y(:)]; %equation Ay*CyKy=by
by=[w*DX(:)-M*D2Y(:)];
If your acceleration data is sufficiently non-noisy it may be enough to do a straight least squares linear solve
CxKx = Ax\bx;
Cx=CxKx(1); Kx=CxKx(2);
CyKy = Ay\by;
Cy=CyKy(1); Ky=CyKy(2);
A more robust solution would probably be to use Total Least Squares
[U,S,V] = svd([Ax,bx],0);
CxKx = -V(1:2,3)/V(3,3);
and similarly for Ky and Cy.
Dave Yadeta
Dave Yadeta 2013 年 3 月 25 日
編集済み: Dave Yadeta 2013 年 3 月 25 日
I have not noticed such a short path before I saw your answer. I get nice estimate now. Thank you very much!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by