Question: Having a problem with part A, I have no clue how to write the integrand in python. I keep getting different errors no matter the



Having a problem with part A, I have no clue how to write the integrand in python. I keep getting different errors no matter the way I write it.
JupyterLab Home 18 localnost:8888otebooks/Assignment 6-F18.ipynb ::: Apps lead Berserk Manga I he Most 1 Oortant O NVIDIA eForce RIX cel VBA torPost-B Jupyter ab D undergraduate Studi Academic acvsors Michelson Intertero How do l calculate t File Edil View nsert Cl K Widgels Help Trusterd Pythorn 3 O Due Thursday, November 8th, by the end of the day (note the announcement about late penalties and failed submissions). (Based on Newman question 5.7/5.8- see Chapter 5 of the text for details) a) (based on Newman 5.7a) Consider the integral We are golng to try evaluating this integral, but first, plot the integrand over the interval [0,1] to see how it behaves, b) Now write a user-defined function to calculate I using the trapezoid rule, given a number N slices to use. (Your function can also take the upper and lower limits of the integral as arguments, if you like.]) Then, using your functicn: -start with N = 1 slice, then use N = 2. then N = 4 etc doubling the number of slices used until the estimated relative accuracy is approximately e' = 10-6 or less, l.e the answer is correct to slx digits after the decimal point -print out, for each step, the number of slices N, the estimate of 1. and the estimate or the accuracy . You should find a final value for 1 dose to 0.45. c) (based on Newman 7.8) Repeat part b using Simpson's rule (starting with two slices, since this is the minimum required in this case.) d Pot log(1/lel) verss log N) for the two methods, together on a single plot. What do you conclude-which is the fastest way of reaching the required Also comment on the rate at which the error varies with N in the two cases. Is it what you exper? In O Type here to search 12:07 PM 116/2018 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
