Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 nptStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started