(*SIMULATIONS OF A LINEARLY DAMPED MASS-SPRING SYSTEM*)
(*===================================================*)
ClearAll["@"]
yd0=Input["Enter value for y'[0], e.g. +-1,0: "];

(*The initial conditions*)
ic1=y[0]==1;
ic2=y'[0]==yd0;

(*The de*)
de:=y''[t]+c*y'[t] +y[t]==0;

(*The undamped case*)
c=0;
yund=DSolve[{de,ic1,ic2},y[t],t]

(*An underdamped case*)
cunder=Input["Enter value for underdamped c < 2, e.g. 1/4: "];
c=cunder
yunderd=DSolve[{de,ic1,ic2},y[t],t]

(*The critically damped case:*)
c=2;
ycritd=DSolve[{de,ic1,ic2},y[t],t]

(*An overdamped case*)
cover=Input["Enter value for overdamped c > 2, e.g. 5/2: "];
c=cover
yoverd=DSolve[{de,ic1,ic2},y[t],t]

(*Collect the functions to plot in a list*)
flist={y[t]/.yund, y[t]/.yunderd, y[t]/.ycritd, y[t]/.yoverd};

Plot[Evaluate[flist],{t,0,20}]

(*========================================================================*)
