2.4 Modeling: Free Oscillations
(Mass–Spring System)

Solve the Equation: my’’ + ky = 0

m=.;k=.;

eqn=m y''[t]+k y[t]==0

DSolve[eqn,y[t],t]

k=90; m=10;

DSolve[eqn,y,t]

freq=Sqrt[k/m]/(2Pi)

N[%]

%*60

sol=DSolve[{eqn,y[0]==0.16,y'[0]==0},y,t]

pos[t_]:= y[t] /. sol

Plot[pos[t],{t,0,10},PlotRange->{{0,10},{-0.5,0.5}}]

Solve the Equation: my'' + cy'+ky = 0

m=.; k=.;

eqn=m y''[t]+c y'[t]+k y[t]==0

DSolve[eqn,y[t],t]

m=10; k=90; c=100;

DSolve[eqn,y,t]

DSolve[{eqn,y[0]==0.16,y'[0]==0},y[t],t]

Expand[%]

sol=DSolve[{eqn,y[0]==0.16,y'[0]==0},y,t]

y1[t_]=y[t] /. sol

Plot[y1[t],{t,0,10},PlotRange->{{0,10},{-0.2,0.2}}]

c=60;

sol=DSolve[{eqn,y[0]==0.16,y'[0]==0},y,t]

y2[t_]=y[t] /. sol

c=10;

sol=DSolve[{eqn,y[0]==0.16,y'[0]==0},y,t]

y3[t_]=y[t] /. sol

Plot[{y1[t],y2[t], y3[t]},{t,0,10},PlotRange->{{0,10},{-0.2,0.2}},PlotLegends->"Expressions"]