Physics 230 - Exam 1 - Winter 2014

The Rules:

• This exam covers material from Labs 1 - 5. It is due at midnight of Feb 10 (for the Friday section), or midnight of Feb 13 (for the Monday section).

• The exam is completely open notes/books. You may use your old labs, Mathematica's help files, internet websites, etc.

• You may not consult with any person about the exam. That includes classmates, TAs, friends, relatives, other professors, Facebook, internet message boards or chat rooms, etc. If anything on the exam is unclear, please ask me directly.

• Do not speak to any of your fellow students about the exam until after the SECOND due date (i.e. midnight Feb 13).

• There is no partial credit, except in extraordinary circumstances. All problems are pass/fail, 1 pt each. Be sure to read each problem very carefully so that you are doing what is requested, and that you are doing EVERYTHING that is requested.

• The problems are listed roughly in order of difficulty--but only roughly, because what's hard for one student might not be hard for another.

• Enter your solutions directly in this notebook after each problem. Rename the notebook to be “exam1 - [your name].nb”, and email it to me when completed. My email address is john_colton@byu.edu.

• To grade your exam I will:
(1) quit the kernel (so the previous student’s exam won’t affect you).
(1) select Delete All Output under the Cell menu,
(2) select Evaluate Notebook under the Evaluation menu, 
(3) and then grade the output. 
Therefore, all solutions must be generated by Mathematica commands in your notebook. I will not Clear variables or Quit/Start the kernel between your problems. Choose your variable names carefully so that there are no conflicts, and be very careful with %.

Problem 1

Find the numerical value of this integral, to 10 decimal places: (∫_0^∞)(((e^(-x))(sinc(x)))^2)dx

Integrate[Exp[-x]Sinc[x]^2,{x,0,Infinity}]
N[%,10]

Problem 2

Solve the equation 5(x^5)-2(x^4)-5(x^3)+7(x^2)-6x+1=0 for its five roots (possibly complex). Give the answers in decimal form.

Solve[5 x^5 - 2 x^4 - 5 x^3 + 7 x^2 - 6 x +1 ==0,x]//N

Problem 3

(a) Make a plot of the Riemann zeta function, Zeta[x], with x going from -4 to 4. Exclude the point x=1 from your graph so the singularity there doesn't show up as a vertical line. 
(b) If you zoom in, you can see that this function oscillates about the x-axis for negative values of x. (Incidentally, these oscillations get more and more extreme the further negative you go.) Find the point closest to the origin where the function crosses the x-axis.

Plot[Zeta[x],{x,-4,4}, Exclusions->{x,1}]
Plot[Zeta[x],{x,-4,4}, Exclusions->{x,1}, PlotRange->{-.2,.2}]
FindRoot[Zeta[x],{x,-2}]

Problem 4

Use Mathematica to solve problem 1 at projecteuler.net, https://projecteuler.net/problems. Hints: I recommend you create two lists, one for the multiples of 3 and one for the multiples of 5. Avoid double counting numbers such as 15 that are multiples of both. The Union function is helpful for this. And remember that "below 1000" means only up to 999. If you want, you can check your result by creating an account on that website and entering in your answer.

list1=Range[3,999,3];
list2=Range[5,999,5];
list3=Union[list1,list2];
Total[list3]

Problem 5

Create a list of {x,y,z} triplets where x = t cos(5t), y = t sin(5t), and z = t. Do this for t ranging from 0 to 10 in steps of 0.01. That should give you 1001 triplets, with your list of triplets being of the form {{0,0,0},{0,1,2},{3,5,7},...}, with different numbers of course. Then make a plot of the triplets using ListPointPlot3D, using Rainbow for the ColorFunction. Look at your plot from various angles to fully appreciate its beauty. :-)

points=Table[{t Cos[ 5 t],t Sin[5 t],t},{t,0,10,.01}];
Length[%]
ListPointPlot3D[points,ColorFunction->"Rainbow"]

Problem 6

Suppose the height of a moving particle is given by the function y(t) = (e^(-1.1 t)) (-((πt)^4)+e (t^3)+1/4 t+3), for times between 0 and 10 seconds. All numbers and terms have units such that time is in seconds and position in meters. 
(a) Find the time when the particle experiences the greatest acceleration.
(b) Find the height of the particle at that time.

y[t_]=Exp[- 1.1t](-Pi t^4 +  E t^3 + 1/4 t + 3)
Plot[y[t],{t,0,10}, PlotRange->All]
Plot[y''[t],{t,0,10}, PlotRange->All]
FindMaximum[y''[t],{t,.25}]
timemax=t /.  %[[2]] [[1]]
y[timemax]

Problem 7

If you stretch out one oscillation of a sine wave (plotted as sin(x) from x = 0 to 2π) so that it is completely straight, how long will it be? I.e. what is the length of that section of the sine curve? Give your answer to 10 sig figs. Hint: You can check your result by noticing it should be just a bit longer than 4× the length of a straight line connecting (0,0) to (π/2,1). (Plot a sine function from 0 to 2π and think about it, if that’s not obvious to you.)

f[x_] = Sin[x];
Plot[f[x],{x,0,2 Pi}]
g[x] = f'[x];
Integrate[Sqrt[1 + g[x]^2],{x,0,2 Pi}]
N[%,10]
(* check--should be a bit longer than three diagonal sections *)
4* Sqrt[(Pi/2)^2 + 1^2] //N  (* the length of the three diagonal sections *)

Problem 8

(a) Define a function of two variables using the delayed function notation  :=   to be f(x,a)=(e^( a (x^2))). 
(b) Create a list of values of a from 0 to 1 in steps of 0.1 and use your list together with Map (or its shortcut) to create 11 different functions of x, one for each of the values of a. 
(c) Plot those 11 functions with x going from -1 to 1, all together on the same plot. Adjust the y-axis range of your plot so none of the functions are cut off.

f[a_,x_]:=Exp[a x^2]
alist=Range[0,1,.1];
functionlist = f[#,x]& /@ alist
Plot[functionlist,{x,-1,1},PlotRange->All]

Problem 9

Consider an electric dipole with the positive charge q = +1 located at (3,6) and the negative charge q = -1 at (-2,-1). For simplification set the constant 1/4(Subscript[πϵ, 0]) equal to 1.  Create a StreamPlot of the electric field and a ContourPlot of the electric potential (with 20 contours, and shading turned off).  Use a range of -10<x<10 and -10<y<10 for each plot and show both plots together.

v[x_,y_]=1/Sqrt[(x-3)^2 + (y-6)^2]  + -1/Sqrt[(x+2)^2 + (y+1)^2] 
ex = -D[v[x,y],x]
ey = -D[v[x,y],y]
plot1=StreamPlot[{ex,ey},{x,-10,10},{y,-10,10}];
plot2=ContourPlot[v[x,y],{x,-10,10},{y,-10,10},Contours->20,ContourShading->None];
Show[plot1,plot2]

Problem 10

Which of the labs from 1-5 took you the longest? If you could get rid of one section or one assignment from that lab, what would it be and why? Put your answer in a cell that uses the Text format style. As long as you give a reasonable explanation for your choice (and it’s properly formatted) you will get credit for this.

To get a Text format style, select the cell then choose Format-> Style -> Text.  Or copy & paste a text cell that already exists, to use as a starting point.