# ps7_sol - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT...

This preview shows pages 1–2. Sign up to view the full content.

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING 2.370/2.37 Molecular Mechanics Fall 2007 PROBLEM SET 7 Solution 1. The algorithms for all methods were given in class; this solution will focus mainly on those aspects other than implementation issues. (a) As expected from class, the convergence rate for trapezoidal integration is 1 /N 2 , as shown by the slope of 2 on a log-log plot. Note that if more divisions were used, roundoff error would become significant, so the level of error would saturate. In my experiments, this saturation occured at an error level of about 10 - 12 . (b) A convergence plot for the 4 methods is shown in figures 1 and 2. As many of you noticed while doing this problem set, figure 1 shows very noisy results for Monte Carlo integration. The expected amount of error decreases as 1 / N ( N is the number of samples), but the computed error ﬂuctuates significantly, sometimes even increasing as the number of samples increases. If this figure was redone, the results would be different, oweing to the use of different random numbers. One way to get around this problem is illustrated in figure 2. For this figure, I performed the integration many times for each N (each of these runs is referred to as an ensemble). The average of these ensembles gives a much smoother result, with the correct 1 / N convergence rate. (c) Importance sampling is most effective when the function to be integrated ( f ( x )) is close to a constant multiple of the probability distribution p ( x ) used to generate the points. Thus, a sin distribution would be optimal. However, actually using a sinusoidal distribution is not useful for this problem. Consider a trial p ( x ) = c × sin( x ) for 0 < x < π and 0 otherwise. The constant c is determined from the constraint that p ( x ) is normalized ( p ( x ) dx = 1).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern