(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L3, e8, 24, "New York"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L2, e6, 18, "New York"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, L2, e6, 14, "New York"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, L2, a20, 14, "New York"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, L2, a15, 12, "New York"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, L2, a12, 10, "New York"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 10, "New York"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L2, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R32768, L2, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L2, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, L2, 12, "Courier"; fontset = name, inactive, nowordwrap, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, B32768, L2, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, L2, 10, "Times"; fontset = leftheader, inactive, L2, 10, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, L2, 12, "Times"; fontset = leftfooter, inactive, center, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, L2, 10, "Geneva"; fontset = clipboard, inactive, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = completions, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special1, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special2, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, center, M7, L2, 12, "New York"; fontset = special3, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, right, M7, L2, 12, "New York"; fontset = special4, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; fontset = special5, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M7, L2, 12, "New York"; paletteColors = 128; currentKernel; ] :[font = title; inactive; preserveAspect; fontSize = 19; fontName = "Times"; startGroup] Linear Methods of Applied Mathematics A string with variable density and Airy's equation ;[s] 2:0,0;39,1;90,-1; 2:1,22,14,Times,1,19,0,0,0;1,26,17,Times,1,23,0,0,0; :[font = text; inactive; preserveAspect; plain; bold; fontName = "Times"] (c) Copyright 1994-1997 by Evans M. Harrell II and James V. Herod. All rights reserved. :[font = text; inactive; Cclosed; preserveAspect; plain; bold; fontSize = 13; fontName = "Times"; startGroup] Notes for the instructor. :[font = text; inactive; preserveAspect; fontSize = 13; fontName = "Times"; endGroup] This contains calculations and an examplefrom chapter 6 of the WWW text by Harrell and Herod. Students can be encouraged to cut and paste from this notebook to do homework. :[font = subsubsection; inactive; Cclosed; preserveAspect; fontSize = 11; fontName = "Times"; startGroup] Instructions :[font = text; inactive; preserveAspect; fontSize = 13; fontName = "Times"; endGroup] This notebook uses Mathematica to perform calculations for Harrell and Herod's hypertext book, Linear Methods of Applied Mathematics. The student needs only a basic knowledge of Mathematica to use the notebook, which is designed both to show how to work problems in the text and to provide a template for using Mathematica to work other problems of the student's own design. Calculations will be performed when the reader presses enter in a given calculation cell (bold print). It is best to activate the cells in order, so that Mathematica will be able to call on operators and functions defined in earlier cells. Red color coding is used to warn the reader when a given calculation relies on an earlier one. ;[s] 11:0,0;19,1;30,0;96,1;133,0;181,1;192,0;315,1;326,0;538,1;549,0;721,-1; 2:6,15,10,Times,0,13,0,0,0;5,15,10,Times,2,13,0,0,0; :[font = text; inactive; dontPreserveAspect; fontName = "Times"] A realistic string or optical fiber may not be uniform, so some of the simplifying assumptions in our derivation fo the wave equation are not valid. For example, the constant c2 = (spring constant)/(mass density) for the spring may be different at different positions, leading to an equation of the form ¶2 u/¶t2 = (c[x])2 ¶2 u/¶x2 (MWE1) or, as a thorough examination of the derivation of the wave equation reveals, we could more generally have: ¶2 u/¶t2 = p(x) (¶/¶x) s(x) ¶u/¶x (MWE2) for some potentially complicated positive functions p(x) and s(x). How well does the method of separation of variables do for problems like this? Rather well, actually, although we may have to encounter some new functions. ;[s] 17:0,0;179,1;180,0;325,1;326,0;331,1;332,0;341,1;342,0;344,1;345,0;350,1;351,0;519,1;520,0;525,1;526,0;817,-1; 2:9,14,9,Times,0,12,0,0,0;8,22,13,Times,32,12,0,0,0; :[font = text; inactive; dontPreserveAspect; fontName = "Times"] Model Problem VI.3. Suppose that the wave speed depends on position, so that c2 = 1/(1 + x), 0 < x < 1, DBC at 0 and 1. Find the normal modes of vibration. Solution. When we attempt to solve the equation with the ansatz u[t,x] = T[t] X[x], we find the following eigenvalue problem. - X''[x] = (1 + x) mu X[x]. There are actually some special functions, called Airy functions, which solve the ODE y''[x] = x y. Two independent solutions are called Ai(x) and Bi(x), or, according to Mathematica , AiryAi[x] and AiryB[x]. Here is what they look like: ;[s] 4:0,1;18,0;106,2;107,0;600,-1; 3:2,14,9,Times,0,12,0,0,0;1,14,9,Times,1,12,0,0,0;1,22,13,Times,32,12,0,0,0; :[font = input; preserveAspect] Plot[AiryAi[x], {x, -10,10}] :[font = input; preserveAspect; fontName = "Times"] Plot[AiryAi[x], {x, -5,3}]; Plot[AiryBi[x], {x, -5,3}] :[font = text; inactive; preserveAspect; fontName = "Times"] The function Bi explodes exponentially to the right, while Ai decays exponentially. They both oscillate to the left (why?). By changing variables we can get these functions to solve our eigenvalue equation :[font = input; preserveAspect; startGroup] D[AiryAi[-mu^(1/3) (x+1)],{x,2}] :[font = output; output; inactive; preserveAspect; endGroup] -(mu*(1 + x)*AiryAi[-(mu^(1/3)*(1 + x))]) ;[o] 1/3 -(mu (1 + x) AiryAi[-(mu (1 + x))]) :[font = text; inactive; preserveAspect; fontName = "Times"] We need a linear combination AiryAi(- mu^(1/3) (1+x)) + C AiryBi ( - mu^(1/3) (1+x)) which is 0 at x=0 and 0 at x=1. I avoid the cube root at this stage by letting p = mu^1/3: ;[s] 3:0,0;42,1;97,0;206,-1; 2:2,14,9,Times,0,12,0,0,0;1,14,10,Courier,0,12,0,0,0; :[font = input; preserveAspect; startGroup] FindRoot[{AiryAi[- p] + C AiryBi[- p] == 0, \ AiryAi[- 2 p] + C AiryBi[- 2 p] == 0}, \ {p,1.5},{C,2}] :[font = output; output; inactive; preserveAspect; fontName = "Times"; endGroup] {p -> 1.870875823546908, C -> 0.819687577175808} ;[o] {p -> 1.87088, C -> 0.819688} :[font = input; preserveAspect] Plot[AiryAi[-1.87088 (1+x)] +.819688 AiryBi[-1.87088 (1+x)], \ {x,0,1}, PlotRange -> {-1,1}] :[font = text; inactive; preserveAspect; fontName = "Times"] The fact that this function has no nodes between 0 and 1, and therefore resembles sin(¹ x), indicates that this is the spatial part of the fundamental (lowest-frequency) mode. The eigenvalue and normal mode are: :[font = input; preserveAspect; startGroup] Mode0[t_,x_] = (A0 Cos[mu0 t] + B0 Cos[mu0 t]) *\ (AiryAi[-1.87088 (1+x)] +.819688 AiryBi[-1.87088 (1+x)]) :[font = output; output; inactive; preserveAspect; fontName = "Times"; endGroup] (AiryAi[-1.87088*(1 + x)] + 0.819688*AiryBi[-1.87088*(1 + x)])* (A0*Cos[mu0*t] + B0*Cos[mu0*t]) ;[o] (AiryAi[-1.87088 (1 + x)] + 0.819688 AiryBi[-1.87088 (1 + x)]) (A0 Cos[mu0 t] + B0 Cos[mu0 t]) :[font = input; preserveAspect; startGroup] FindRoot[{AiryAi[- p] + C AiryBi[- p] == 0, \ AiryAi[- 2 p] + C AiryBi[- 2 p] == 0}, \ {p,3},{C,-2}] :[font = output; output; inactive; preserveAspect; fontName = "Times"; endGroup] {p -> 2.980050473942766, C -> -1.759127992170103} ;[o] {p -> 2.98005, C -> -1.75913} :[font = input; preserveAspect] Plot[AiryAi[-2.98005 (1+x)] -1.75913 AiryBi[-2.98005 (1+x)], \ {x,0,1}] :[font = text; inactive; preserveAspect; fontName = "Times"] The second eigenvalue and normal mode are :[font = input; preserveAspect; startGroup] Mode1[t_,x_] = (A1 Cos[mu1 t] + B1 Cos[mu1 t]) *\ (AiryAi[-2.98005 (1+x)] -1.75913 AiryBi[-2.98005 (1+x)]) :[font = output; output; inactive; preserveAspect; fontName = "Times"; endGroup; endGroup] (AiryAi[-2.98005*(1 + x)] - 1.75913*AiryBi[-2.98005*(1 + x)])* (A1*Cos[mu1*t] + B1*Cos[mu1*t]) ;[o] (AiryAi[-2.98005 (1 + x)] - 1.75913 AiryBi[-2.98005 (1 + x)]) (A1 Cos[mu1 t] + B1 Cos[mu1 t]) ^*)