Physics 238
Damped Oscillations

Clear["Global`*"]

x[t_, γ_] := B Exp[p[γ] t]

p[γ_] := (-γ/2) + Sqrt[(γ^2)/4 - ((ω0)^2)]

ω0 =1.0; (* For convenience in plotting *)

Initial Conditions -- set B = 10.0.

B = 10.0;

x[t, γ]

x[t, 0.2]

smartlabel[γ_] := StringForm["γ = ``   Q = ``", NumberForm[γ, {3, 2}], NumberForm[ω0/γ, {4, 3}]] // Quiet

Manipulate[Plot[Re[x[t, γ]], {t, 0, 40}, PlotRange->{-10, 10},LabelStyle->Larger, Frame->True,PlotLabel ->smartlabel[γ],  FrameLabel -> {"t", "x"}, ImageSize->Scaled[0.9], AspectRatio->1/2],
{γ, 0, 4, 0.02, Appearance -> "Open"}]

Plot[{Re[x[t, 0.5]], Re[x[t, 2.0]], Re[x[t, 8.0]]}, {t, 0, 40}, PlotRange->{-10, 10}, ImageSize->Scaled[0.7], AspectRatio->1/2, PlotStyle->{Red, Green, Blue}, PlotLegends -> {"γ = 0.5", "γ = 2.0","γ = 8.0"}, LabelStyle->Larger ]