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"


_________________________________________________________________________________________________________









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





After answering the above questions, you must email your answers and attach the files:


inEllipse.m
update.m
velocities.fig
xvprime.m