Honors MP - Answers

Name: _________________________________ NetID: _____________________ Section#: ______


 


 Part 1: Monte Carlo

1. Write the Matlab command using 'vol' to compute the volume of the ellipse using 1000 points.
 

_________________________________________________________________
 

2. What is the result from above?
 

_________________________________________________________________
 

3. Rerun the command in (1) with 10,000 and then 100,000 points and write down the results.
 

___________________________
 

___________________________

 

4.Compare these results with the actual volume. When we increase the number of points does the accuracy improve in general?
Explain your answer. (Hint: research the expression "The Law of Large Numbers" (look this up in Wikipedia))


_________________________________________________________________________________________________________






Part 2: adaptive integration

1. Write down the two missing lines of code.

area = ___________________________________________________________ ;

area = _____________________________________________________________________________________________________ ;

2. Write the value of the calculation:

       area = ______________________________________________________________________________





Part 3: Harmonic Oscillator

1. Based on the ODE equation stated in the instructions write the ODE as a system of two equations:
    Don't write Matlab code, just write the math form of the equations.


  dx/dt = ____________________________________________________________________




   dv/dt = ____________________________________________________________________



2. Now run your code by typing in the following ( after you have filled in the blanks). See step 3 Refine, Generalize, ... to get the values.


   >> [t , xv ] =   ode45( @xvprime   , _________________________, ____________________________ )

3. Fill in the blank to plot x versus time.


  >> plot(   t , _________________________________ )

4. Fill in this blank ____________________  to indicate which of the cases
       a.    m = 1, k = 100, b = 2
        b.    m = 1, k = 100, b = 20
        c.    m = 1, k = 100, b = 5  
      matches the plot below.


question

Part 4: Ray Tracing

1. Light rays coming in from a star are effectively parallel and should be focused to a single point. Notice that only one of the mirrors does this. Which one of the mirrors reflects the star light to a point? (Circle / Ellipse / Parabola)


  ____________________________________________________________________





Your solution to this MP should include the answering the questions on this Answer webpage ( answer_sheet )and emailing the answers and all of the following files to
(Jiahui Jiang ta8cs101@cs.illinois.edu).

inEllipse.m
adaptive.m
xvprime.m
ray_trace.m

and the three plots you generated from part four,

circle.jpg
ellipse.jpg
parabola.jpg