# How to find equation of simple harmonic motion from positional information at 3 different times?

Given a particle at three distinct position $$x_1, x_2 \ and \ x_3$$from equilibrium position at different times $$t_1, t_2 \ and \ t_3$$ how can we find the amplitude, frequency and initial phase?

It seems to me that I lack the mathematical knowledge necessary to solve the equations involved. What are such equations called and where can we learn about solving them?

$$x_1 = A \sin(\omega \times t_1) + B \cos(\omega \times t_1)$$

$$x_2 = A \sin(\omega \times t_2) + B \cos(\omega \times t_2)$$

$$x_3 = A \sin(\omega \times t_3) + B \cos(\omega \times t_3)$$

where $$\omega \times t_1 , \ \omega \times t_2, \omega \times t_3$$ is less than $$2\pi$$ but greater than 0.

• This problem doesn't necessarily have a unique solution. Do you have any information about the limits on the frequency? Are t1, t2, and t3 evenly spaced? – The Photon Jan 3 at 16:17
• Yeah, consider $\omega \times t_1 , \ \omega \times t_2, \omega \times t_3$ is less than $2 \times \pi$ but greater than 0. – horaceZettai Jan 3 at 16:27
• Is a unique solution possible if $t_1, t_2 \ and \ t_3$ are evenly spaced? The context of this question is from another question where $t_1 = t, t_2 = 2t \ and \ t_3 = 3t$ and an algebraic solution is possible. – horaceZettai Jan 3 at 16:33
• I have to consider this more, but if the samples are evenly spaced and you don't restrict the frequency range, then it's easy to show the solution is not unique due to aliasing. – The Photon Jan 3 at 17:30

Apologies I am ignorant of the nomenclature and sources. If you were interested in a quick homing in and won't falter at issues of uniqueness and optimization of solutions, here is a direct way to get you where you might like to go.

First rearrange your real coefficients to polar form, $$A\equiv r \cos \phi , \qquad B\equiv r \sin\phi ,\\ r=\sqrt{A^2+B^2} , \qquad \phi=\arctan (B/A).$$

It follows that your three equations are transcribable as $$x_i/r=\sin (\omega t_i+\phi),$$ whence $$y_i\equiv \arcsin (x_i/r)= \omega t_i+\phi ~.$$

One may eliminate the unknowns $$\phi,\omega$$ among these three equations to consider the (transcendental ?) equation $$\frac{t_2-t_1}{t_3-t_1}= \frac{y_2-y_1}{y_3-y_1},$$ where the only unknown is r on the r.h.s. Graphing the implied rhs-lhs equation versus r should yield allowable rs from its zeroes. (I gather there are more efficient ways to do this...)

Given r, you may proceed to determine $$\omega=\frac{y_2-y_1}{t_2-t_1}, \qquad \phi=y_1-\omega t_1,$$ where the actual values of the 6 inputs might suggest better choices of i or pairs thereof for these last two equations. You then plug in your variables to determine A,B.

It is possible you might experiment with toy values such as $$t_i=(\pi/8,3\pi/8,11\pi/8) ~sec, \qquad x_i=(0.71,1,-1)~cm$$ to obtain $$\phi=\pi/8, \qquad r=1 ~cm, \qquad \omega=1~sec^{-1}.$$