(*^ ::[ 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, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w282, h287, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; currentKernel; ] :[font = title; inactive; noPageBreak; preserveAspect] Homework 6: :[font = input; noPageBreak; preserveAspect] Needs["Algebra`Trigonometry`"] :[font = input; noPageBreak; preserveAspect] conjugate::usage = " A simple method of computing the conjugate of an object which is explicitly Complex"; conjugateRule = {Complex[re_,im_]:>Complex[re,-im]}; conjugate[exp__] := exp /. conjugateRule; :[font = title; inactive; noPageBreak; preserveAspect; cellOutline; backColorRed = 58981; backColorGreen = 58981; backColorBlue = 58981] Not complete: You must fill in missing steps: :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Problem 1: :[font = input; noPageBreak; preserveAspect] Clear["Global`*"]; :[font = subsection; inactive; noPageBreak; preserveAspect] Part a) :[font = input; noPageBreak; preserveAspect] (* Replace: w0^2 = k/m *) mSol= Solve[w0^2 == k/m ,m][[1]] :[font = input; noPageBreak; preserveAspect] eq1= m x''[t] + k x[t] == 0 /.mSol :[font = input; noPageBreak; preserveAspect] dSol= DSolve[eq1,x,t][[1]]; {x[t], x'[t], x''[t]} /.dSol //TableForm :[font = subsection; inactive; noPageBreak; preserveAspect] Part b) I'll do this in general first. :[font = input; noPageBreak; preserveAspect] {position,velocity,acceleration}= {x[t], x'[t], x''[t]} /.dSol //ComplexToTrig //Simplify :[font = input; noPageBreak; preserveAspect] Plot[{position,velocity,acceleration} /.{w0->2} //Evaluate ,{t,0, 2 Pi} ,PlotStyle->{{},{Dashing[{0.020}]},{Thickness[0.008]}} ]; :[font = section; inactive; noPageBreak; preserveAspect] Part c) :[font = input; noPageBreak; preserveAspect] {kinetic, potential, total} = {1/2 m velocity^2 , 1/2 k position^2, 1/2 m velocity^2 + 1/2 k position^2} :[font = input; noPageBreak; preserveAspect] Plot[{kinetic, potential, total} /.{w0->2, k->4} //Evaluate ,{t,0, 2 Pi} ,PlotStyle->{{},{Dashing[{0.020}]},{Thickness[0.008]}} ]; :[font = section; inactive; noPageBreak; preserveAspect] Part d) :[font = input; noPageBreak; preserveAspect; endGroup] ParametricPlot[{position,velocity} /.{w0->2} //Evaluate ,{t,0, 2 Pi}]; :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Problem 4: :[font = input; noPageBreak; preserveAspect] Clear["Global`*"]; :[font = subsection; inactive; noPageBreak; preserveAspect] Part a) :[font = input; noPageBreak; preserveAspect] (* Short cut: Don't put in the "==" yet. *) eq1= L q''[t] + R q'[t] + 1/C q[t] - e0 Exp[I w t] :[font = input; noPageBreak; preserveAspect] eq2= D[eq1,t] :[font = input; noPageBreak; preserveAspect] (* Use c for current: *) qRule= {q-> (Integrate[c[#],#]&) } :[font = input; noPageBreak; preserveAspect] {q[t], q'[t], q''[t], q'''[t]} /.qRule :[font = subsection; inactive; noPageBreak; preserveAspect] Part e) :[font = input; noPageBreak; preserveAspect] values= {L->L0, C -> 300 10^-12, R ->5, w0-> 2 Pi 10^4}; :[font = input; noPageBreak; preserveAspect; endGroup] mag= impedance (impedance //conjugate) //Simplify :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Problem 5: :[font = input; noPageBreak; preserveAspect] Clear["Global`*"]; :[font = subsection; inactive; noPageBreak; preserveAspect] Part a) :[font = input; noPageBreak; preserveAspect; endGroup] Plot[({x1[t],x2[t],x3[t]} //Re) //Evaluate ,{t,0,20} ,PlotStyle->{{},{Dashing[{0.020}]},{Thickness[0.008]}} ]; :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Problem 6: :[font = input; noPageBreak; preserveAspect] Clear["Global`*"]; :[font = subsection; inactive; noPageBreak; preserveAspect] Part a) :[font = input; noPageBreak; preserveAspect] fun[c0_,c1_,c2_,c3_]:= ( c0 + c1 Sin[2 Pi 1 x] + c2 Sin[2 Pi 2 x] + c3 Sin[2 Pi 3 x] ) :[font = input; noPageBreak; preserveAspect] doit[c0_,c1_,c2_,c3_]:= Plot[ fun[c0,c1,c2,c3] //Evaluate ,{x,0,1}]; :[font = input; noPageBreak; preserveAspect; endGroup] doit[1,2,3,4]; :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Problem 7: :[font = input; noPageBreak; preserveAspect] Clear["Global`*"]; :[font = subsection; inactive; noPageBreak; preserveAspect] Part a) :[font = input; noPageBreak; preserveAspect; endGroup] Plot[Ceiling[x+1/2],{x,0,1}]; :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Problem 8: :[font = input; noPageBreak; preserveAspect] Clear["Global`*"]; :[font = subsection; inactive; noPageBreak; preserveAspect] Part a) :[font = input; noPageBreak; preserveAspect; endGroup] Plot[1-Abs[x],{x,-1,1}]; ^*)