I have been confused by this differential equation for several days. I have an equation like this:


Where m,c,n are known parameters. And V(y(t)) is a two dimensional coordinate data set $(y(t1),V1),(y(t2),V2),...,(y(ti),Vi)$ and I don't know the exact analytical expression of $V(t)$. So, is it possible to solve this differential equation? By what kind of method or algorithm?

I know maybe I could solve this equation by fitting the data set $V(y(t))$, and obtain an analytical expression, then substitute it into the equation and solve it. But that maybe inaccurate and sometimes it is difficult to fit the curve. So is it possible to solve this kind of equation that contains a term without analytical expression in other methods?

For example, let m=1, c=0.05, n=0.01, and let $V'(y(t))$:


How to solve this equation use Mathematica?


2 Answers 2


A good way of doing it is by defining an interpolating function. In order to do this you should use the Interpolation function.

Assuming that your data is stored in data (as in your own example data=Table[{t,Sin[t]},{t,0,2,0.02}]),

you can just write :


From now you will be able to use the V function as well as their derivatives.


Yes you can solve your problem using Interpolation and NDSolveValue as follows.

First define V'[...]

 vs = Interpolation[Table[{t, Sin[t]}, {t, 0, 2, 0.02}]]

Second define the initial value problem (You have to define initial conditions!)

m = 1; c = .05; n = .01;
Y = NDSolveValue[{m y''[t] == c vs[y[t]] - n y'[t], y[0] == 0,y'[0] == 1}, y, {t, 0,10}]
Plot[Y[t], {t, 0, 10}, AxesLabel -> {t, y[t]}]

enter image description here

That's it.

  • $\begingroup$ What's the difference between NDSolve and NDSolveValue? May I use NDSolve here? $\endgroup$
    – shelure21
    Jul 20, 2019 at 22:22
  • $\begingroup$ The difference is the way that the output is presented. Using NDSolveValue returns a function (useful since it can be directly plotted). On the other hand, NDSolve returns a list of rules. $\endgroup$
    – M. Veruete
    Jul 21, 2019 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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