Question: Use python 3. Make sure to pass the test case. Please post the image of your code will appropriate spacing. For this problem you'll be

Use python 3. Make sure to pass the test case. Please postthe image of your code will appropriate spacing. For this problem you'llUse python 3. Make sure to pass the test case. Please post the image of your code will appropriate spacing.

For this problem you'll be evaluating some integrals numerically, using the np.trapz function. Choosing the number of points for your discrete grid is up to you-but your answers should be accurate to within 0.1% of the exact result. Check that your answer is accurate, and use more points in your grid if it's not, or you will lose points!! (Hint: how can you check your answer? Remember, a simple test is just to increase the number of points on your grid, and see if the answer changes or not This generally works even for cases where you don't know the right answer.) (Another hint: the first integral is easy to work out by hand, so you know the right answer...the second integral also has an analytic answer, although it's harder to get.) Evaluate the integral 0 Save your numerical answer to the variable integral_I. The visible testing cell will do a simple check that your integral is positive, it's up to you to verify the answer... integral-1 = 0. ## YOUR CODE HERE # Basic sanity check - not a thorough test! print (integral_I) assert integral_I # Hidden testing cell - do not delete! import numpy.testing as npt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!