How Many Points for Trapezium Rule to Compute exp(-x^2) with Specific Error?

  • Thread starter Thread starter retupmoc
  • Start date Start date
  • Tags Tags
    Error
AI Thread Summary
To compute the integral of exp(-x^2) over the interval [0,1] with an error of at most 5x10^-5 using the Trapezium Rule, the maximum second derivative needs to be determined, likely at x=0. The error formula provided suggests a relationship between the number of subintervals and the second derivative, which is 4x^2exp(-x^2). A binary-cut technique is recommended for efficiently finding the optimal number of intervals, adjusting based on whether the error is too large or acceptable. Additionally, a similar approach can be applied for Simpson's Rule, with careful consideration of the error in each subinterval. Understanding and applying these methods will help achieve the desired accuracy in numerical integration.
retupmoc
Messages
47
Reaction score
0
Hi, in my numerical methods i missed my lecture and i am currently unable to obtain the solution of a problem from my lecturer. How many points should be used to compute the integral exp(-x^2) over the interval [0,1] with an error at most 5x10^-5? At the end of the previous lecture we where given a formula for the the error over the interval [b,a] I-T=-1/12(b-a)h^2f''(w) + O(h^2). Where f''(w) is the maximum second order derivative at a point w in the range. Any help would be appreciated.

Also how would i do the same calculation for Simpsons Rule?

Thanks
 
Physics news on Phys.org
retupmoc said:
Hi, in my numerical methods i missed my lecture and i am currently unable to obtain the solution of a problem from my lecturer. How many points should be used to compute the integral exp(-x^2) over the interval [0,1] with an error at most 5x10^-5? At the end of the previous lecture we where given a formula for the the error over the interval [b,a] I-T=-1/12(b-a)h^2f''(w) + O(h^2). Where f''(w) is the maximum second order derivative at a point w in the range. Any help would be appreciated.

Also how would i do the same calculation for Simpsons Rule?

Thanks

This looks like a decent set of notes for both cases.

http://math.fullerton.edu/mathews/n2003/TrapezoidalRuleMod.html

http://math.fullerton.edu/mathews/n2003/SimpsonsRuleMod.html

I doubt the O(h^2) is correct. I suspect it should be higher order, or maybe the + is supposed to be =
 
Last edited by a moderator:
so id need to work out where 4x^2exp(-x^2) (i.e. the second derivitive) is maximum? Which would be x=0(?) and exp(-x^2)=1 and put this into the equation above to get the number of subintervals required?
 
retupmoc said:
so id need to work out where 4x^2exp(-x^2) (i.e. the second derivitive) is maximum? Which would be x=0(?) and exp(-x^2)=1 and put this into the equation above to get the number of subintervals required?

My guess is you need to look at the whole interval and see if the error is too big. If it is, you need to break it into sub-intervals and find the errors for each sub-interval and combine them. You need to do that until the number of intervals is large enough to reduce the error within limts.

Rather than a sequential approach, you might try a binary-cut technique. For example, if 20 is more than enough try 10, if that is too few go half way between and try 15, then move half way toward the previous numbers depending on if 15 is too few at least enough.

I have not looked carefully for an analytical approach to finding the number, but I think the formula you have applies interval by interval.
 
Thread 'Voltmeter readings for this circuit with switches'
TL;DR Summary: I would like to know the voltmeter readings on the two resistors separately in the picture in the following cases , When one of the keys is closed When both of them are opened (Knowing that the battery has negligible internal resistance) My thoughts for the first case , one of them must be 12 volt while the other is 0 The second case we'll I think both voltmeter readings should be 12 volt since they are both parallel to the battery and they involve the key within what the...
Thread 'Correct statement about a reservoir with an outlet pipe'
The answer to this question is statements (ii) and (iv) are correct. (i) This is FALSE because the speed of water in the tap is greater than speed at the water surface (ii) I don't even understand this statement. What does the "seal" part have to do with water flowing out? Won't the water still flow out through the tap until the tank is empty whether the reservoir is sealed or not? (iii) In my opinion, this statement would be correct. Increasing the gravitational potential energy of the...
Back
Top