(*^ ::[ frontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.1"; macintoshStandardFontEncoding; paletteColors = 256; currentKernel; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, cellOutline, groupLikeTitle, center, M18, O486, R65535, e8, 24, "CalcMath"; ; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M18, O486, bold, R21845, G21845, B21845, e6, 12, "CalcMath"; ; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M18, O486, R21845, G21845, B21845, e6, 12, "CalcMath"; ; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M18, O486, bold, R21845, G21845, B21845, a10, 12, "CalcMath"; ; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M18, O486, bold, R21845, G21845, B21845, a10, 12, "CalcMath"; ; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, O486, bold, R21845, G21845, B21845, a10, 12, "CalcMath"; ; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "CalcMath"; ; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, B65535, 12, "CalcMath"; ; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M36, N23, O486, bold, L-5, 12, "Courier"; ; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M36, N23, O486, L-5, 12, "Courier"; ; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, O486, R65535, L-5, 12, "Courier"; ; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, O486, L-5, 12, "Courier"; ; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, O486, B65535, L-5, 12, "Courier"; ; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M18, O486, l34, w351, h314, 12, "Courier"; ; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, italic, 10, "Geneva"; ; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times"; ; fontset = leftheader, inactive, M18, O486, L2, 12, "Times"; ; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M18, O486, 12, "Times"; ; fontset = leftfooter, inactive, M18, O486, L2, 12, "Times"; ; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 10, "Times"; ; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times"; ; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times"; ; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, whiteBox, M18, O486, bold, R21845, G21845, B21845, 12, "CalcMath"; ; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M18, O486, R21845, G21845, B21845, 12, "CalcMath"; ; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 12, "Times"; ; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, center, M18, O486, 10, "Courier"; ; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, O486, 10, "Courier"; ; ] :[font = title; inactive; preserveAspect; ] An Introduction to Second Order Linear Homogeneous Differential Equations and Harmonic Motion :[font = subsubtitle; inactive; preserveAspect; ] By Debra Woods :[font = section; inactive; Cclosed; preserveAspect; startGroup; ] Introduction :[font = smalltext; inactive; preserveAspect; ] In this lesson, we will discuss one application of the use of second order linear differential equations with constant coefficients. a y'' + b y' + c y = f(x) The application of interest in this case is harmonic motion. We will limit our discussion to free vibrations, that is, when f(x) = 0. :[font = smalltext; inactive; preserveAspect; endGroup; ] We will begin by solving for the general case of a y'' + b y' + c y = 0. To do this, we first form the characteristic equation, a rÛ + b r + c = 0 , which can be solved by using the quadratic formula. It is possible for Mathematica to solve this for us, but the form of the equation is not necessarily user friendly, that is, it may involve complex exponents. ;[s] 3:0,0;225,1;236,0;366,-1; 2:2,24,16,CalcMath,0,12,0,0,65535;1,24,16,CalcMath,2,12,0,0,65535; :[font = section; inactive; preserveAspect; startGroup; ] Examples of General Solutions :[font = smalltext; inactive; preserveAspect; ] Consider the following example, y'' + 4 y' + 3 y = 0. :[font = input; preserveAspect; ] a = 1; b = 4; c = 3; :[font = input; preserveAspect; ] Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]], disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]] ,disc < 0, y[x_] = Exp[Re[sol[[1]]]] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]])]; Print["y[x] =",y[x]]; :[font = smalltext; inactive; preserveAspect; ] The above characteristic equation delivered two distinct real roots (rÁ , rª ) thus producing a solution to the corresponding differential equation of the form y = kÁ eåÚ ô + k eåÛ ô. :[font = smalltext; inactive; preserveAspect; ] Next, we will consider the case involving only one distinct real root. In this case, y'' + 2 y' + y = 0. :[font = input; preserveAspect; ] a = 1; b = 2; c = 1; :[font = input; preserveAspect; ] Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]], disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]] ,disc < 0, y[x_] = Exp[Re[sol[[1]]] x] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]])]; Print["y[x] =",y[x]]; :[font = smalltext; inactive; preserveAspect; ] Notice that because only one solution is obtained, it had to be multiplied by x in order to obtain two linearly independent solutions in the fundamental solution set. To convince yourself of this, review the section on reduction of order in your textbook. Equations yielding only one solution will always produce solutions of the form y = kÁ eåÚ ô + kª xeåÚÊ ô. :[font = smalltext; inactive; preserveAspect; ] The last case is the case where the discriminant is negative. This of course produces complex solutions, and is the case where Mathematica gives us solutions involving complex exponents, that is, E(iq). ;[s] 5:0,0;128,1;139,0;200,2;201,0;206,-1; 3:3,24,16,CalcMath,0,12,0,0,65535;1,24,16,CalcMath,2,12,0,0,65535;1,18,13,Symbol,0,12,0,0,65535; :[font = input; preserveAspect; ] Clear[y,x,a] :[font = smalltext; inactive; preserveAspect; ] By the use of Eulers formula E(iq) = cos q + i sin q , we can change the form of the solution to y = e¸ô(kÁ cos(qx) + kª sin(qx)), where the complex roots to the characteristic equation are p б qi. The equation of the next example is y'' + y' + y = 0. ;[s] 7:0,0;32,1;33,0;41,1;42,0;51,1;52,0;268,-1; 2:4,24,16,CalcMath,0,12,0,0,65535;3,18,13,Symbol,0,12,0,0,65535; :[font = input; preserveAspect; ] a = 1; b = 1; c = 1; :[font = input; preserveAspect; endGroup; ] Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]], disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]] ,disc < 0, y[x_] = Exp[Re[sol[[1]]] x] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]])]; Print["y[x] =",y[x]]; :[font = section; inactive; preserveAspect; startGroup; ] Harmonic Motion :[font = smalltext; inactive; preserveAspect; ] Now we will divert our attention to the application in question, harmonic motion. The differential equation of the free motion for a vibrating spring is of the form a y'' + b y' + c y = 0. Physically, the coefficients, a, b, and c correspond to mass,damping constant, and the spring constant respectively. First, we will consider the case where b = 0. This is the case of undamped motion. When solving a y'' + c y = 0, if we divide by a, we get y'' + ’Œ‚ y = 0, which we can rewrite as y'' + wÛy = 0. The equation will clearly yield a solution of the form y = kÁ cos(wx) + kª sin(wx). Let's test this with Mathematica. and see what the equation of motion looks like. ;[s] 9:0,0;497,1;498,0;573,1;574,0;586,1;587,0;613,2;624,0;674,-1; 3:5,24,16,CalcMath,0,12,0,0,65535;3,18,13,Symbol,0,12,0,0,65535;1,24,16,CalcMath,2,12,0,0,65535; :[font = subsection; inactive; preserveAspect; startGroup; ] Example of Harmonic Motion :[font = subsubsection; inactive; preserveAspect; ] The Case of Undamped Motion :[font = smalltext; inactive; preserveAspect; ] Example: A 5 kg mass is attached to a spring of length .3 m, stretching the spring to a length of .7 m. The mass is then pulled downward and additional .3 m and released. Find the equation of motion for the mass. ;[s] 3:0,1;8,0;10,2;217,-1; 3:1,24,16,CalcMath,0,12,0,0,65535;1,24,16,CalcMath,0,12,0,0,0;1,24,16,CalcMath,0,12,0,65535,0; :[font = smalltext; inactive; preserveAspect; ] To find the differential equation of motion, we must first find a, b, and c. The mass a is given in the problem and is 5, b = 0 for undamped motion, and to find c, the spring constant, we need to used the given information and Hooke's Law F = c x. ;[s] 3:0,0;87,1;88,0;252,-1; 2:2,24,16,CalcMath,0,12,0,0,65535;1,24,16,CalcMath,1,12,0,0,65535; :[font = input; preserveAspect; ] Clear[a,b,c,y,x] c = 5 * 9.8 / .4 :[font = smalltext; inactive; preserveAspect; ] The displacement of the spring due to attaching the mass is .4 m, so c = F/x = (5)(9.8)/.4 = 122.5 kg/secÛ. :[font = input; preserveAspect; ] a = 5; b = 0; Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]], disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]] ,disc < 0, y[x_] = Exp[Re[sol[[1]]] x] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]])]; Print["y[x] =",y[x]]; :[font = smalltext; inactive; preserveAspect; ] Now, we will solve the IVP using the initial conditions, y(0) = .4,(initial position) , and y'(0) = 0 (initial velocity). :[font = input; preserveAspect; ] y0 = .4; y1 = 0; ksols = Solve[{y[0]==y0,y'[0]==y1},{k[1],k[2]}]; ysolved[x_] = y[x] /. ksols[[1]] :[font = smalltext; inactive; preserveAspect; ] The graph of the equation of motion is :[font = input; preserveAspect; ] Plot[ysolved[x],{x,0,2 Pi},PlotStyle->{RGBColor[0,0,1]}]; :[font = smalltext; inactive; preserveAspect; ] This graph is a good example of undamped motion. Now, let's consider damped motion. For this, there are three cases. We will first consider the case of overdamped motion, when the discriminant of the characteristic equation is positive. In the initial work above, we saw that this lead to two distinct roots. Let's change the above example to include a damping constant, b = 70. :[font = input; preserveAspect; ] Clear[a,b,c,y,x] c = 5 * 9.8 / .4 a = 5; b = 70; :[font = input; preserveAspect; ] Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]], disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]] ,disc < 0, y[x_] = Exp[Re[sol[[1]]] x] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]])]; Print["y[x] =",y[x]]; :[font = input; preserveAspect; ] y0 = .4; y1 = 0; ksols = Solve[{y[0]==y0,y'[0]==y1},{k[1],k[2]}]; ysolved[x_] = y[x] /. ksols[[1]] :[font = smalltext; inactive; preserveAspect; ] The graph of the equation of motion is :[font = input; preserveAspect; ] Plot[ysolved[x],{x,0,Pi},PlotStyle->{RGBColor[0,0,1]}]; :[font = smalltext; inactive; preserveAspect; ] Notice that the motion is no longer oscillatory. :[font = smalltext; inactive; preserveAspect; ] The next case is the case where the discriminant equals 0. This is called critically damped motion. Let's set the damping constant b equal to 4 * a * c, forcing the discriminant to 0. :[font = input; preserveAspect; ] Clear[a,b,c,y,x] c = 5 * 9.8 / .4; a = 5; b = Sqrt[4 * a * c]; :[font = input; preserveAspect; ] Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]], disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]] ,disc < 0, y[x_] = Exp[Re[sol[[1]]] x] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]])]; Print["y[x] =",y[x]]; :[font = input; preserveAspect; ] y0 = .4; y1 = 0; ksols = Solve[{y[0]==y0,y'[0]==y1},{k[1],k[2]}]; ysolved[x_] = y[x] /. ksols[[1]] :[font = smalltext; inactive; preserveAspect; ] The graph of the equation of motion is :[font = input; preserveAspect; ] Plot[ysolved[x],{x,0, Pi},PlotStyle->{RGBColor[0,0,1]}]; :[font = smalltext; inactive; preserveAspect; ] The last case is that of under damped motion, that is, when the discriminant is less than zero. Let's give our equation a small damping constant, say b = 30. :[font = input; preserveAspect; ] Clear[a,b,c,y,x,sol] c = 5 * 9.8 / .4; a = 5; b = 30; :[font = input; preserveAspect; ] Clear[y,x] sol = x/.Solve[a x^2 + b x + c == 0, x]; disc = b^2 - 4 a c; Which[disc > 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] Exp[x sol[[2]]];, disc == 0, y[x_] = k[1] Exp[x sol[[1]]] + k[2] x Exp[x sol[[1]]]; ,disc < 0, {resol = Re[sol[[1]]];, y[x_] = Exp[resol x] (k[1] Sin[x Im[sol[[1]]]] + k[2] Cos[x Im[sol[[1]]]]);}]; :[font = input; preserveAspect; ] Print["y[x] = ",y[x]] :[font = input; preserveAspect; ] y0 = .4; y1 = 0; ksols = Solve[{y[0]==y0,y'[0]==y1},{k[1],k[2]}]; ysolved[x_] = y[x] /. ksols[[1]] :[font = smalltext; inactive; preserveAspect; ] The graph of the equation of motion is :[font = input; preserveAspect; ] Plot[ysolved[x],{x,0, 6},PlotRange->All ,PlotStyle->{RGBColor[0,0,1]}]; :[font = smalltext; inactive; preserveAspect; ] It is difficult on this graph to see the oscillatory motion. Let's zoom in and view the graph. :[font = input; preserveAspect; ] Plot[ysolved[x],{x,0, 6},PlotStyle->{RGBColor[0,0,1]}]; :[font = smalltext; inactive; preserveAspect; endGroup; endGroup; ] Here we can see that the under damping has caused a few oscillations. The larger the damping constant, the fewer oscillations, and the closer the damping constant gets to zero, the closer the equation of motion gets to undamped motion. :[font = input; preserveAspect; ] ^*)