Harmonično vsiljeno nihanje

Privzemimo, da je točka z maso m pripeta na vzmet s koeficientom k. Njeno gibanje je določeno z diferencialno enačbo drugega reda s konstantnimi koeficienti

                                                                                                      my''+ky = F(t),
                                                                                                      
kjer je F(t) sila s katero vzbujamo nihanje.

Denimo, da nihanje vzbujamo s silo F(t) = Fcos(ωt).

DSolve[{m*y''[t]+c*y'[t]+k*y[t]==F*Cos[w*t],y[0]==0,y'[0]==0},y[t],t]

y[t_,c_,k_,m_,w_,F_]:=-(2 F (m^2) (c (E^(((-c-(Sqrt[(c^2)-4 k m])) t)/(2 m))) k-c (E^(((-c+(Sqrt[(c^2)-4 k m])) t)/(2 m))) k-(E^(((-c-(Sqrt[(c^2)-4 k m])) t)/(2 m))) k (Sqrt[(c^2)-4 k m])-(E^(((-c+(Sqrt[(c^2)-4 k m])) t)/(2 m))) k (Sqrt[(c^2)-4 k m])+c (E^(((-c-(Sqrt[(c^2)-4 k m])) t)/(2 m))) m (w^2)-c (E^(((-c+(Sqrt[(c^2)-4 k m])) t)/(2 m))) m (w^2)+(E^(((-c-(Sqrt[(c^2)-4 k m])) t)/(2 m))) m (Sqrt[(c^2)-4 k m]) (w^2)+(E^(((-c+(Sqrt[(c^2)-4 k m])) t)/(2 m))) m (Sqrt[(c^2)-4 k m]) (w^2)+2 k (Sqrt[(c^2)-4 k m]) Cos[t w]-2 m (Sqrt[(c^2)-4 k m]) (w^2) Cos[t w]+2 c (Sqrt[(c^2)-4 k m]) w Sin[t w]))/((Sqrt[(c^2)-4 k m]) (-(c^2)+2 k m+c (Sqrt[(c^2)-4 k m])-2 (m^2) (w^2)) ((c^2)-2 k m+c (Sqrt[(c^2)-4 k m])+2 (m^2) (w^2)))

Manipulate[a=Plot[y[x,c,k,m,w,F],{x,-0.001,t},PlotStyle->Blue];b=Graphics[{ParametricPlot[{-1+0.3Sin[8x],-5+(x/(2π))(5+y[t,c,k,m,w,F])},{x,0,2π},Axes->None,PlotStyle->Blue,AspectRatio->Automatic][[1]],PointSize[0.02],Black,Point[{-1,y[t,c,k,m,w,F]}],
Blue,Arrow[{{-1,y[t,c,k,m,w,F]},{-1,y[t,c,k,m,w,F]+2*Cos[w*t]}}],
Black,Rectangle[{-1.8,-5.2},{-0.2,-4.8}],
Rectangle[{-1.05,-4.8},{-0.95,-0.15+y[t,c,k,m,w,F]}]}];
Show[a,b,PlotRange->{{-2,50},{-5,5}},ImageSize->{700,450},AxesOrigin->{0,0}],{{w,1.3,"Frekvenca vzbujanja (cm)"},1,5,Appearance->"Labeled",AnimationRunning->False},
{{F,1,"Amplituda vzbujanja (cm)"},1,4,Appearance->"Labeled",AnimationRunning->False},
{{k,1,"Togost vzmeti (N/m)"},1,20,Appearance->"Labeled",AnimationRunning->False},
{{m,1,"Masa (kg)"},1,10,Appearance->"Labeled",AnimationRunning->False},{{c,0,"Koeficient dušenja (kg/s)"},0,1,Appearance->"Labeled",AnimationRunning->False},
{{t,0,"Čas (s)"},0,50,ControlType->Trigger,AnimationRate->1}]