Given the Second Order Differential Equation:

$$ m\ddot{x}+c\dot{x}+kx = \mathrm{F}_{external}^{} $$

where $ m, c, k $ are constants and $\mathrm{F}_{external}^{}$ is buffer of external force taken at 48Hz.

Numeric solution is needed for $x$ in a form of a similar buffer.


EDIT: I posted this question in the wrong StackExchange. It was meant for the Math one not Mathematica. Its a c++ project. Sorry for everything and thanks for answers.

  • $\begingroup$ may be you can try to fit the data collected to a function using Fourier analysis? Once you have the analytical model of the force this way, you can use DSolve. For multiple harmonics as input, you can solve the ODE solve for each one, and then add the solutions since the ode is linear. $\endgroup$
    – Nasser
    Nov 22 '21 at 11:14
  • $\begingroup$ One easier possibility is to just use an Interpolation for the force $\endgroup$ Nov 22 '21 at 11:58
  • 1
    $\begingroup$ Including code for a computable example would make it more likely that you would get help. $\endgroup$
    – Michael E2
    Nov 22 '21 at 12:58
  • 1
    $\begingroup$ You need to add some code to your post. What have you tried to far? $\endgroup$
    – yarchik
    Nov 22 '21 at 13:38

With DSolve:

eq1 = m x''[t] + c x'[t] + k x[t] == Fex*Cos[t]
DSolve[eq1, x[t], t]

With NDSolve you need to define the parameters first:

m = 1;
c = 0.01;
k = 1;
Fex = 1;
eq1 = m x''[t] + c x'[t] + k x[t] == Fex*Cos[t]
s = NDSolve[{eq1, x[0] == 1, x'[0] == 1}, x, {t, 0, 5}]
Plot[x[t] /. s, {t, 0, 5}]
  • 3
    $\begingroup$ I recommend that you convert this to a comment. $\endgroup$
    – bbgodfrey
    Nov 22 '21 at 16:50

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.