# Math Help - Calculate spring constant - Euler's Method

1. ## 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:

$m\,\frac{d^2x}{dt^2} + c\, \frac{dx}{dt} + k\, x = 0$

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.

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:

Using maxima:
> 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...

2. You have simple harmonic motion. The damping term (proportional to dx/dt) only affects the amplitude.

Look at the period. The peak is roughly at 0.5, and again at 5, leading to a period of 5-0.5=4.5.

The period of simple harmonic motion is 2*pi*sqrt(m/k). You know m=20 from the given. So:

4.5 = 2*pi * sqrt(m/k), solve for k gives close to 40.

3. Originally Posted by qmech
You have simple harmonic motion. The damping term (proportional to dx/dt) only affects the amplitude.

Look at the period. The peak is roughly at 0.5, and again at 5, leading to a period of 5-0.5=4.5.

The period of simple harmonic motion is 2*pi*sqrt(m/k). You know m=20 from the given. So:

4.5 = 2*pi * sqrt(m/k), solve for k gives close to 40.
gmech thanks a lot for your answer. I really appreciate it . That certainly does work. However, this problem is from a Numerical Methods subject so, even though your thought process doesn't require fancy physics knowledge, I am pretty sure that's not how it's suppose to go about it.
Therefore, if someone could come up with a solution 'more numerical methods way', that would great.

Thanks.

4. Just some thoughts ... I don't know maxima, I'm assuming the x and t points were taken from the graph, how about the derivatives though? How does it compute those values? Is it built-in? Or do you need to define it?

Ofcourse, if you want to make it simpler, you could take advantage of the information given by qmech, by getting the t values when dx/dt = 0, getting the average difference between consecutive values. Then divide this value by pie, square it, divide by m, and invert it .... or something similar (maybe you could get the t values when x is maximum/minimum)

5. Originally Posted by Bingk
Just some thoughts ... I don't know maxima, I'm assuming the x and t points were taken from the graph, how about the derivatives though? How does it compute those values? Is it built-in? Or do you need to define it?

Ofcourse, if you want to make it simpler, you could take advantage of the information given by qmech, by getting the t values when dx/dt = 0, getting the average difference between consecutive values. Then divide this value by pie, square it, divide by m, and invert it .... or something similar (maybe you could get the t values when x is maximum/minimum)
Thanks for your reply Bingk, but I am afraid I didn't understand what you meant.

As I mentioned in my previous post, qmech is a very valid and intelligent way to solve the problem, but I am pretty sure there's a more "numerical methods" way to do it, and that's what I am asking if anyone knows how?

I am not sure if you did or did not present another way to solve the problem (sorry, I am not a native speaker and my english is not that good...), by all means, if you did, please explain it in a different way, perhaps I will understand it.

This might be a approach to the problem: sometimes when a 2nd order ODE is given it makes sense to reduce it two 1st order ODE, but I am not sure how to do that and if this is the case.

Anyone with more thoughts on this?

Btw, any moderator reading this: I noticed the thread was moved to "differential equations" section. Even though the problem consists of a ODE I still think the appropriate section would be Number Theory or Advanced Applied Math, since it regards a non-analytical way to solve the problem, but more using a CAS.

6. Definitely not Number theory ... number theory deals more on integers, not numerical methods

I was asking how you defined "'diff(x,t)" ... I know it's supposed to be the derivative at (x,t), but does maxima calculate it for you automatically? If so, how? If not, then how did you define the function?

As for the other way, what you can do is find the points when diff(x,t)=0, those will be your maximum/minimum points. Then use those values to calculate an average value for the period. Once you have that period, use the formula presented by qmech ... and to be clear, I mean write the code to do this ... don't do it "by hand"

7. Originally Posted by Bingk
Definitely not Number theory ... number theory deals more on integers, not numerical methods

I was asking how you defined "'diff(x,t)" ... I know it's supposed to be the derivative at (x,t), but does maxima calculate it for you automatically? If so, how? If not, then how did you define the function?

As for the other way, what you can do is find the points when diff(x,t)=0, those will be your maximum/minimum points. Then use those values to calculate an average value for the period. Once you have that period, use the formula presented by qmech ... and to be clear, I mean write the code to do this ... don't do it "by hand"
Thanks for another reply Bingk. That does make sense, but the "foundation" for that would still be knowing that "formula" qmech mentioned. As I mentioned before, that's a pretty valid thought process, but I am sure, even though that's not that hard to know that, that there is another way around it.

Sorry if I seem to be very "picky". Still looking for another solution...

8. Anyone?