The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
Is there a mathematician in the house? [Exam help]
I've got a repeat exam on Numerical Methods coming up soon for college. I've got most of the course covered, but I have some questions about stuff I couldn't figure out from the first time, and my lecturer for some reason refuses to answer questions from students. Could anyone here help me out?
Firstly, there's this question:
Determine the number of intervals needed to approximate the integral
I(f) = e^x^2 dx where a=1 and b=2
to an accuracy of 1X10-3 using the Trapezoidal Rule. Assume the error for this method is given by:
I can't type the notation here so hopefully you got all that.
I'm assuming that f''(eta) is the second derivative of the function (something like 20e^4) and h is (b-a)/n. Is that correct, or am I missing something? I've been doing these sorts of problems from textbooks but they all use different error equations.
Secondly, a bit later on the same question asks me to evaluate an integral with the Trapezoidal Rule and Simpson's Rule (no problem) and then compare the two answers, stating which is more accurate. Can I just evaluate the integral normally and then compare the values I got from the two methods to see which is closer, or is there some better way to do it?
I've got a repeat exam on Numerical Methods coming up soon for college. I've got most of the course covered, but I have some questions about stuff I couldn't figure out from the first time, and my lecturer for some reason refuses to answer questions from students. Could anyone here help me out?
Firstly, there's this question:
Determine the number of intervals needed to approximate the integral
I(f) = e^x^2 dx where a=1 and b=2
to an accuracy of 1X10-3 using the Trapezoidal Rule. Assume the error for this method is given by:
I can't type the notation here so hopefully you got all that.
I'm assuming that f''(eta) is the second derivative of the function (something like 20e^4) and h is (b-a)/n. Is that correct, or am I missing something? I've been doing these sorts of problems from textbooks but they all use different error equations.
Secondly, a bit later on the same question asks me to evaluate an integral with the Trapezoidal Rule and Simpson's Rule (no problem) and then compare the two answers, stating which is more accurate. Can I just evaluate the integral normally and then compare the values I got from the two methods to see which is closer, or is there some better way to do it?
Unfortunately for the first part, I really can't help you there. I'm a bit rusty on the approximation of errors and whatnot for different methods. For the second part, yeah you would need to compare your numerical results to the exact solution (if there is one). If there is no exact solution to the integral, I would suggest finding a higher order method to approximate the integral and compare your numerical results to that one. Also, in general you will want to make a comparison as a % difference from the higher order or exact solution, as to make a meaningful comparison between the two methods.
I've got a repeat exam on Numerical Methods coming up soon for college. I've got most of the course covered, but I have some questions about stuff I couldn't figure out from the first time, and my lecturer for some reason refuses to answer questions from students. Could anyone here help me out?
Firstly, there's this question:
Determine the number of intervals needed to approximate the integral
I(f) = e^x^2 dx where a=1 and b=2
to an accuracy of 1X10-3 using the Trapezoidal Rule. Assume the error for this method is given by:
I can't type the notation here so hopefully you got all that.
I'm assuming that f''(eta) is the second derivative of the function (something like 20e^4) and h is (b-a)/n. Is that correct, or am I missing something? I've been doing these sorts of problems from textbooks but they all use different error equations.
Secondly, a bit later on the same question asks me to evaluate an integral with the Trapezoidal Rule and Simpson's Rule (no problem) and then compare the two answers, stating which is more accurate. Can I just evaluate the integral normally and then compare the values I got from the two methods to see which is closer, or is there some better way to do it?
Qualifier: I have a math degree and have worked in mathematics but am not a mathematician by trade and haven't needed to do numerical integration in roughly forever.
I believe that in you are correct regarding the h in your error function, though that seems like a weird choice of variables. The f'' part is indeed the second derivative of the function under the integral, but evaluated for some value a < eta < b. I think the challenge is to do error analysis to get a useful form of the error equation and then solve for N. Wikipedia says that the estimate for N->inf is that f''(eta) ~= (f'(b) - f'(a)) + O(N^-3). So my assumption would be that you'd plug in your values, set the error equal to 10^-3, and solve for N to get the number of iterations.
For the second part I'm guessing (based on the part of the question being about error analysis) that you're meant to calculate the error for the two algorithms based on the number of iterations you used to perform the estimate. Simpson's and the Trapezoidal rules have different error functions, so if you plug in your integrals and the number of iterations you should get different errors. The one with lower error is more accurate.
Posts
Unfortunately for the first part, I really can't help you there. I'm a bit rusty on the approximation of errors and whatnot for different methods. For the second part, yeah you would need to compare your numerical results to the exact solution (if there is one). If there is no exact solution to the integral, I would suggest finding a higher order method to approximate the integral and compare your numerical results to that one. Also, in general you will want to make a comparison as a % difference from the higher order or exact solution, as to make a meaningful comparison between the two methods.
Qualifier: I have a math degree and have worked in mathematics but am not a mathematician by trade and haven't needed to do numerical integration in roughly forever.
I believe that in you are correct regarding the h in your error function, though that seems like a weird choice of variables. The f'' part is indeed the second derivative of the function under the integral, but evaluated for some value a < eta < b. I think the challenge is to do error analysis to get a useful form of the error equation and then solve for N. Wikipedia says that the estimate for N->inf is that f''(eta) ~= (f'(b) - f'(a)) + O(N^-3). So my assumption would be that you'd plug in your values, set the error equal to 10^-3, and solve for N to get the number of iterations.
For the second part I'm guessing (based on the part of the question being about error analysis) that you're meant to calculate the error for the two algorithms based on the number of iterations you used to perform the estimate. Simpson's and the Trapezoidal rules have different error functions, so if you plug in your integrals and the number of iterations you should get different errors. The one with lower error is more accurate.