1
$\begingroup$

Assume that we have the differential equation of a mass-spring-damper model as follows: $$ m\frac{d^2y}{dt^2}+c\frac{dy}{dt}+ky(t)=F(t) $$

How it could be implemented in MATLAB to do the following steps:

First, convert the differential equation to a difference equation.

Second, finding the discrete-time transfer function of it.

Third, finding the regression equation of this system.

Finally deriving Recursive Least Squares (RLS) and Ordinary Least Squares (OLS) to estimate the free parameters of the system ($m$,$c$, and $k$).

More information on this system is available at Mass-Spring-Damper System Excited by Force F(t)

Any help is greatly appreciated

$\endgroup$
2
  • 1
    $\begingroup$ This sounds like homework to me. What have you tried? What are you having trouble with? $\endgroup$
    – Chuck
    Jan 17 '16 at 1:29
  • $\begingroup$ Do you need to follow this approach or can you do it differently? Is it a theoretical question or do you want to identify the parameters with a physical set-up? $\endgroup$
    – Karlo
    Feb 16 '16 at 9:36
1
$\begingroup$

Matlab with some tips

A good method is using the Billinear transform (Tustin's method).

s = tf('s')
Hc = 1/(m*s^2+c*s+k)   % Tf continuous-time

Observation.: First declare your variables: m, c and k.

Matlab provides some functions that help with the transformation. The function c2d().

Ts = 0.1;
Hd = c2d(Hc,Ts,'tustin')
step(Hc,'--',Hd,'-')

where Ts is the sample time.

  • To find the difference equation, apply the inverse Z transform after using tusting method in your equation. Remember that you need to use Laplace transform first!

$\hspace{2.5em}$ $Y(s)\big(ms^{2}+cs+k\big) = \mathcal{L}\{F(t)\}$

  • You can find good info about OLS here.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.