In class, we'll look at the damped-driven pendulum demonstration. Using the parameters we figure out, prepare a mathematical model for the system. It should lead to a plot which roughly shows the observed motion of the system. (We'll talk more about this on Monday, 9/20)

The task is to essentially use the analytical solutions for the damped-driven oscillator to model the mass on a spring spring system we looked looked at in class.

The equation of motion we found in class is: \begin{equation} x(t) = A e^{-\beta t} \cos \left(\omega_1 t + \phi_0 \right) + C \sin \left(\omega t - \delta \right) \label{eq:dampeddrivensolution} \end{equation} where $C$ is given by: \begin{equation} C = \frac{f_0}{\sqrt{\left(\omega_0^2 - \omega^2 \right)^2 + 4 \beta^2 \omega^2}} \end{equation} $\delta$ is: \begin{equation} \tan \delta = \frac{2 \beta \omega}{\omega_0^2-\omega^2} \end{equation} and $\omega_1$ $$\omega_1 = \sqrt{\omega_0^2 - \beta^2}$$ However, it will be easier in this case to use the $\cos$ plus $\sin$ version: \begin{equation} e^{-\beta t}\left[A_1 \cos \left(\omega_1 t \right)+ A_2 \sin \left(\omega_1 t \right) \right] + C \sin \left(\omega t - \delta \right) \label{eq:dampeddrivesincos} \end{equation} To figure out the constants $A_1$ and $A_2$, you'll need to solve \eqref{eq:dampeddrivesincos} for time $t = 0$ and then use the initial conditions $x_0 = 0$ and $v_0 = 0$. For example, if we set $x(0) = x_0$, $A_1$ can be found to be: $$A_1 = x_0 + C \sin \delta$$ (you do $A_2$ by setting $\dot{x}(0) = v_0$)

Some parameters I measured:

- Mass of ball: 0.05 kg
- When I pull the spring to 10 cm extension, the force pulling back is equal to 0.6 N. This would suggest a spring constant of about 6 N/m, but this isn't a great estimate due to the non-linearity of a real spring (i.e. $F_\textrm{sp} = kx^{\textrm{something close to 1}}$) However, one can also just measure the $\omega_1$ value by looking at the small oscillations in the data before we start driving it. The time between peaks is 0.780 seconds.
- The drive frequency, $\omega$, was 1.25 Hz
- You'll want to play around with $\beta$ and $f_0$ to find values that work. (I didn't measure those, but $\beta$ should be small)

Here is the csv file recorded on Monday: hw2-spring-mass-data.csv We can take a quick look at it in Mathematica:

```
(* load full dataset from a url (I put it on Github) *)
originalData = Import["https://raw.githubusercontent.com/hedbergj/CCNY-PHYS35100-F2021/main/data/hw2-spring-mass-data.csv"];
(* select the 1st and 3rd columns (time and position) and make a selection that starts on the second line, since there is header information on the first line: *)
data = originalData[[2 ;;, {1, 3}]];
(* Make a ListLinePlot of the data *)
ListLinePlot[data, Frame -> True, FrameLabel -> {"Time [s]", "Position [m]"}]
```