Mass spring system equation help
显示 更早的评论
I am good at Matlab programming but over here I am stuck in the maths of the problem, I am dealing with the differential equation of spring mass system mx’’+cx’+kx=0 where x’’=dx2/dt2 and x’=dx/dt. I have the values of mass and I also have the array of time and x i.e x is given for a particular value of time so I can find x’’ and x ‘ easily. I am stuck at what method to apply to find the value of c and k. I can program any method but have searched several books but didn’t get how to find c and k. If I get to know the method I can program it easily.
采纳的回答
更多回答(3 个)
Sumit Tandon
2012-8-8
0 个投票
I feel that if you can calculate the values of x' and x'', then you could take a couple of sets of x, x' and x'' and get a system of linear equation of the form Ax - B = 0.
Any other ideas?
In response to Sumit above:
x = 2xn matrix of x' and x, A = 1x2 matrix of c and k, and B = 1xn matrix of mx''. Solve for A.
Example:
x=[v1 v2 v3 v4;x1 x2 x3 x4];
B=[mx1'' mx2'' mx3'' mx4''];
A=x\B;
This should get you the values of c and k (c=A(1), k=A(2)).
6 个评论
Jerry
2012-8-8
Jacob
2012-8-8
That would return a single value for c and k. A is 1x2 ([c k]), and MATLAB would find the "best fit" of c and k using that method.
Jerry
2012-8-8
Greg Heath
2012-8-8
1. Divide the ODE by m and treat the normalized parameters c1 = c/m and k1 = k/m as unknowns
2. Convert the ODE and Initial Conditions to a set of Linear Finite Difference Equations
3. As suggested by previous repliers, rearrange the equations into linear matrix equation form with C = [ c1 ; k1 ] as the unknown.
4. Solve using backslash.
Jerry
2012-8-8
Jerry
2012-8-8
Greg Heath
2012-8-9
There appears to be 2 straightforward approaches:
1. For c1=c/2m, k1=k/m and sufficiently small dt(i) = t(i)-t(i-1)
a. Obtain an inhomogeneous system of linear equations for C = [c1 ; k1] by converting the differential equation to a difference equation in x(i).
b. Obtain the solution to A*C=B via C = A\B.
2. Use NLINFIT or LSQCURVEFIT to estimate c1, k1, A and B from the form of the exact solution
x(i) = exp(-c1*t(i)) * ( A * cos( sqrt(c1^2-k1) * t(i))
+ B * sin( sqrt(c1^2-k1) * (t(i) )
However, since the equation is linear in A and B, a two step estimation of [c1 ; k1 ] and [ A B] might be useful.
Hope this helps.
Greg
类别
在 帮助中心 和 File Exchange 中查找有关 Assembly 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!