tahayassen said:
Well, I wasn't asking for an easier one necessarily. I was just wondering if there was any alternative to the sine function.
I'm still confused to why gravity doesn't affect dynamic motion. I've uploaded a diagram.
The first question is answered by the theory of linear ordinary differential equations. For your case it reads
[tex]m \ddot{x}=-k x[/tex]
or
[tex]\ddot{x}=-\omega^2 x \quad \text{with} \quad \omega=\sqrt{k/m}.[/tex]
This means you look for all functions that reproduce themselves up to a factor [itex]-\omega^2<0[/itex].
There are two functions, which come immediately to mind:
[tex]x_1(t)=A \cos(\omega t), \quad x_2(t)=B \sin(\omega t).[/tex]
Since the differential equation is linear, also any superposition of the two solutions is another solution. Thus we have
[tex]x(t)=A \cos(\omega t)+B \sin(\omega t).[/tex]
One can strictly prove that this is the complete set of solutions. The two constants [itex]A[/itex] and [itex]B[/itex] must be determined from the initial conditions. Since the differential equation is of 2nd order, you must give both the initial position [itex]x_0=x(0)[/itex] at [itex]t=0[/itex] and also the initial velocity [itex]v(0)=\dot{x}(0)=v_0[/itex]. Now
[tex]v(t)=\dot{x}(t)=-A \omega \sin(\omega t) + B \omega \cos(\omega t).[/tex]
Thus we find
[tex]x(0)=A=x_0, \quad v(0)=B \omega=v_0 \; \Rightarrow B=\frac{v_0}{\omega}.[/tex]
Thus the solution, fulfilling the initial conditions, is uniquely determined to be
[tex]x(t)=x_0 \cos(\omega t)+\frac{v_0}{\omega} \sin(\omega t).[/tex]
One can also rewrite this solution into the form given on your lab sheet:
[tex]x(t)=A \sin(\omega t+\phi).[/tex]
Due to the addition theorem this is
[tex]x(t)=A [\sin(\omega t) \cos \phi+\cos(\omega t) \sin \phi].[/tex]
Thus you just have to choose [itex]A[/itex] and [itex]\phi[/itex] such that
[tex]A \cos \phi=\frac{v_0}{\omega}, \quad x_0=A \sin \phi.[/tex]
This gives
[tex]A^2 (\cos^2 \phi+\sin^2 \phi)=A^2= \left (\frac{v_0}{\omega} \right)^2 + x_0^2,[/tex]
leading to
[tex]A=\sqrt{ \left (\frac{v_0}{\omega} \right)^2 + x_0^2}.[/tex]
Further, with this value of [itex]A[/itex] the phase is given by
[tex]\phi=\mathrm{sign}(x_0) \arccos\left (\frac{v_0}{\omega x_0} \right).[/tex]
To your second question. Let [itex]x'[/itex] the coordinate of the point mass defined such that for [itex]x'=0[/itex] the spring is unstretched. Then the total force acting on the mass is the sum of the gravitational force and the force from the spring:
[tex]F=m g-k x'.[/tex]
The point, were [itex]F=0[/itex], i.e., where the force of the spring is exactly compensating the gravitational force, is given by
[tex]m g-k x_0=0 \; \Rightarrow x_0=\frac{m g}{k}.[/tex]
Thus you can write for the force
[tex]F=k(x_0-x').[/tex]
Now setting [itex]x=x'-x_0[/itex] you find the equation of motion
[tex]m \ddot{x}'=m\ddot{x}=F=k(x_0-x')=-k x,[/tex]
which is the equation of motion for a harmonic oscillator. So, as the other posters have already explained, the reason that the gravitational force drops out is due to the counting of the [itex]x[/itex] coordinate from the equilibrium point [itex]x_0[/itex].