Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write a python program for the following problem Consider the integral 1= sinV100x dx Write a program that uses the adaptive simpson's rule method
Please write a python program for the following problem
Consider the integral 1= "sinV100x dx Write a program that uses the adaptive simpson's rule method of Section 5.3 and Eas. (5.35) to (5.39) to calculate the value of this integral to an approximate accuracy of = 10 i.e., correct to six digits after the decimal point). Start with two single integration slice and work up from there to four, eight, and so forth. Have your program print out the results at each step until the required accuracy is reached E = (1-1-1). (5.35) The equivalent of Eq. (5.34) is a little more complicated. We define $=${s(a) + f(b) +2 f(a+kh)]. (5.36) 2-N -2 and T = = $(a + kh). (5.37) f(a +kh ). kedd L.N;-1 Then we can show that Si = Si-1 +T-11 (5.38) and I;=h;(S: +27). (5.39) Thus, for Simpson's rule the complete process is: 1. Choose an initial number of steps and a target accuracy and calculate the sums S1 and T1 from Eas. (5.36) and (5.37) and the initial value 11 of the integral from Eq. (5.39). 2. Double the number of steps then use E95: (5.37), (5.38), and (5.39) to calculate the new values of Si and Ti and the new estimate of the integral. 3. Also calculate the error on that estimate from Eq. (5.35). If the absolute magnitude of the error is less than the target accuracy for the integral, stop. Otherwise repeat from step 2. Consider the integral 1= "sinV100x dx Write a program that uses the adaptive simpson's rule method of Section 5.3 and Eas. (5.35) to (5.39) to calculate the value of this integral to an approximate accuracy of = 10 i.e., correct to six digits after the decimal point). Start with two single integration slice and work up from there to four, eight, and so forth. Have your program print out the results at each step until the required accuracy is reached E = (1-1-1). (5.35) The equivalent of Eq. (5.34) is a little more complicated. We define $=${s(a) + f(b) +2 f(a+kh)]. (5.36) 2-N -2 and T = = $(a + kh). (5.37) f(a +kh ). kedd L.N;-1 Then we can show that Si = Si-1 +T-11 (5.38) and I;=h;(S: +27). (5.39) Thus, for Simpson's rule the complete process is: 1. Choose an initial number of steps and a target accuracy and calculate the sums S1 and T1 from Eas. (5.36) and (5.37) and the initial value 11 of the integral from Eq. (5.39). 2. Double the number of steps then use E95: (5.37), (5.38), and (5.39) to calculate the new values of Si and Ti and the new estimate of the integral. 3. Also calculate the error on that estimate from Eq. (5.35). If the absolute magnitude of the error is less than the target accuracy for the integral, stop. Otherwise repeat from step 2Step 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