2301-20 April 1

Springs, now including damping

Here is a drawing tool, which we use to Animate:

spring[x_,a_:2,b_:12]:= Graphics[{
ParametricPlot[{(a)+t*(x+8-a),Sin[2 Pi 6 t]},{t,0,1},PlotStyle->Red,Axes->False,PlotRange->{{0,b},{-1,1}}][[1]],
{Brown,Disk[{a,0},.2]},
{Dashed,Green,Line[{{8,-1/2},{8,1/2}}]},{Black,Rectangle[{x+8-1/4,-1/4},{x+8+1/4,1/4}]}},PlotRange->{{0,b},{-1,1}}]
Animate[spring[2 Cos[t]],{t,0,2π}]

Recall how you use DSolve[] to solve a differential equation, e.g. this one:  x''(t)+((ω0)^2) x(t)==0.
The lines below illustrate the steps:  first ask for the generic solution (no boundary conditions specified),
then  with more and more specific boundary conditions until we define a numerical function we can Plot.

ode=x''[t] + ω0^2 x[t] ==0  (* Label a certain ordinary differential equation "ode" *)
DSolve[ode,x[t],t]  (* Ask for the generic solution, with no boundary conditions specified *)
DSolve[{ode,x[0]==x0,x'[0]==v0},x[t],t] (* OK now ask for particular initial conditions *)
x1[t_] =(x[t] /. %[[1]]/.{x0->2,v0->1,ω0->1})  (* And here choose numerical values before plotting *)
Plot[x1[t],{t,0,10}]

TopHat Questions: what is the peak value? what is the phase?  i.e. what are A and ϕ in x(t)=Acos(t+ϕ).

Playtime: modify the differential equation to include damping: x''(t)+ 2γ x'(t) +((ω0)^2) x(t)==0.
Choose numerical parameters and Plot the result. 
Try all three cases (underdamped, overdamped, and critical),
e.g. for the underdamped case the Plot should look something like