Problem: Oscillations

SHO (β=0, q0=0)

Clear["Global`*"]

(* To start, we'll zero gravity  *)
eq1= x''[t] + 2 β x'[t] + (w0^2)x[t] ==q0 Exp[I wD t]  /.{β->0, q0->0}

DSolve[eq1,x[t],t][[1]]

% //TrigToExp //Expand

bc={x[0]==x0 , x'[0]==v0} (* Boundary Conditions *)

dsol1=DSolve[Join[{eq1},bc] ,x[t],t][[1]] //FullSimplify

values={x0->1, v0->1, β->0.1,w0->1,q0->15.1,wD->3};
Plot[ x[t] /.dsol1  /.values //Re,{t,0,50}]

x1[t_,β_,w0_,wD_,q0_,x0_:1,v0_:1]=x[t] /.dsol1

x1[0.1,1,2,3,4,5,6]

Manipulate[
Plot[ x1[t,β,w0,wD,q0] //Re,{t,0,30}],
{{β,0.1},0.01,5},
{{w0,1},0.1,5},
{{wD,3},0,5,1},
{{q0,1},0.1,10}
]

SHO (β≠0, q0=0)

Clear["Global`*"]

(* To start, we'll zero gravity  *)
eq1= x''[t] + 2 β x'[t] + (w0^2)x[t] ==q0 Exp[I wD t]  /.{q0->0}

bc={x[0]==x0 , x'[0]==v0} (* Boundary Conditions *)

dsol1=DSolve[Join[{eq1},bc] ,x[t],t][[1]] //FullSimplify

x[t] /.dsol1  /.{(β^2)->0} //PowerExpand //Simplify

x[t] /.dsol1  //TrigToExp

values={x0->1, v0->0, β->0.1,w0->1,q0->15.1,wD->3};
Plot[ {Exp[-β t],-Exp[-β t],x[t]} /.dsol1  /.values //Re //Evaluate,{t,0,50},PlotRange->All]

x1[t_,β_,w0_,wD_,q0_,x0_:1,v0_:1]=x[t] /.dsol1

x1[0.1,1,2,3,4,5,6]

Manipulate[
Plot[ x1[t,β,w0,wD,q0] //Re,{t,0,30},PlotRange->All],
{{β,0.1},0.01,5},
{{w0,1},0.1,5},
{{wD,3},0,5,1},
{{q0,1},0.1,10}
]

SHO (β=0, q0≠0)

Clear["Global`*"]

(* To start, we'll zero gravity  *)
eq1= x''[t] + 2 β x'[t] + (w0^2)x[t] ==q0 Exp[I wD t]  /.{β->0}

bc={x[0]==x0 , x'[0]==v0} (* Boundary Conditions *)

dsol1=DSolve[Join[{eq1},bc] ,x[t],t][[1]] //FullSimplify

values={x0->1, v0->1, β->0.1,w0->1,q0->15.1,wD->3};
Plot[ x[t] /.dsol1  /.values //Re,{t,0,50}]

x1[t_,β_,w0_,wD_,q0_,x0_:1,v0_:1]=x[t] /.dsol1

x1[0.1,1,2,3,4,5,6]

Manipulate[
Plot[ x1[t,β,w0,wD,q0] //Re,{t,0,50}],
{{β,0.1},0.01,5},
{{w0,1},0.1,5},
{{wD,3},0,5,1},
{{q0,1},0.1,10}
]

SHO (β≠0, q0≠0)

Clear["Global`*"]

(* To start, we'll zero gravity  *)
eq1= x''[t] + 2 β x'[t] + (w0^2)x[t] ==q0 Exp[I wD t]

bc={x[0]==x0 , x'[0]==v0} (* Boundary Conditions *)

dsol1=DSolve[Join[{eq1},bc] ,x[t],t][[1]] //FullSimplify

values={x0->1, v0->1, β->0.1,w0->1,q0->15.1,wD->3};
Plot[ x[t] /.dsol1  /.values //Re,{t,0,50}]

x1[t_,β_,w0_,wD_,q0_,x0_:1,v0_:1]=x[t] /.dsol1

x1[0.1,1,2,3,4,5,6]

x1[t,β,w0,wD,q0,x0,v0]

Manipulate[
Plot[ x1[t,β,w0,wD,q0] //Re,{t,0,50},
PlotRange->All],
{{β,0.1},0.01,5},
{{w0,1},0.1,5},
{{wD,3},0,5,1},
{{q0,1},0.1,10}
]

Plot[ x1[t,0.1,1,1,0] //Re,{t,0,50},PlotRange->All]

Plot[ Exp[I w t] /.w->1 //Re,{t,0,50}]

Plot[ x1[t,.1,1,3,3,0,0] //Re,{t,0,60},PlotRange->All,PlotPoints->200]

Plot[ x1[t,.1,1,3,0,1,0] //Re,{t,0,60},PlotRange->All,PlotPoints->200]

Plot[ x1[t,.1,1,3,3,1,0] //Re,{t,0,60},PlotRange->All,PlotPoints->200]