MATLAB: Curve-fitting by Levenberg–Marquardt method?

planar rigid body model

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!!

Best Answer

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.