need help on computational physics with python
Exercise 5.6 a) Write a program, or modify an earlier one, to once more calculate the value of the integral (%(x+ - 2x + 1) dx from Example (5.28), using the trapezoidal rule with 20 slices, but this time have the program also print an estimate of the error on the result, calculated using the method of Eq. (5.28). To do this you will need to evaluate the integral twice, once with N, = 10 slices and then again with N2 = 20 slices. Then Eq. (5.28) gives the error. How does the error calculated in this manner compare with a direct computation of the error as the difference between your value for the integral and the true value of 4.4? Why do the two not agree perfectly? 1: #Type your code here Type your response here [10pts. b) Also calculate the error using the Euler-Maclaurin formula of Eq. (5.20). How does this compare with your other two estimates of the error? Type your response here [10pts. Total: 720pts. Overall: /100pts.
need help on computational physics with python
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am