Calculate spring constant - Euler's Method
Can anyone solve this?
A physical system composed of a mass connected by a spring to a fixed point and moving without friction on a horizontal line can be described by the following differential equation:
This equation was integrated numerically by Euler's method, using the following values:
t0 m c dx/dt (initial)
0 20 1 1
The results are presented in the graph of position (x) versus time (t), where each point is the result of an iteration.
http://img23.imageshack.us/i/imgrk.jpg/Any help is greatly appreciated. I can tell you that the answer is K = 40, but I don't know how to get there...
My failed attempt at this:
> 20*'diff('diff(x, t), t) + 'diff(x, t) + K*x;
> ode2(%, x, t);
> ic2(res, t=0, x=1, 'diff(x,t)=1);
> solve(%, K);
But this yields something that doen't make sense...