|
Software: |
Suppose we want to find x4 Many different numerical methods exist to approximate such an integral. Here we use a 4-point Newton-Cotes formula. We can approximate f(x) in the interval [x0,x4] by a polynomial, then analytically integrate the polynomial term by term. The higher the degree of the polynomial, the greater the accuracy of the resulting approximation to the integral. Here we use the fourth degree polynomial f(x)=a x4+b x3+c x2+d x+e, and use the method of Undetermined Coefficients to find a, b, c, d and e. If we then analytically integrate this polynomial term by term, the result is an approximation to the integral of f(x) from x0 to x4, and it is: x4 where h=(x4-x0)/4 and the selected points are equally spaced. If we have n subintervals, with n being a multiple of 4, we have the following extended formula, xn in which h=(xn-x0)/n: The integration is performed once and the result stored. It is then performed again with twice as many subintervals and the result compared with the previous one. The process is continued until two conditions are met: a) The result differs from the previous one by less than the specified error. b) The number of subintervals is at least the number specified by the user. MULTIPLE INTEGRATION Suppose what we want is a Multiple Integral. OK, then suppose f(x) above is in turn an integral, for example, over the variable y, with limits that may be functions of x. We would then have a double integral
d b(x) If we group it like this:
d b(x) we see that the part inside the brackets is something like f(x). We would first perform the integration over y. For such integration over y we would in turn use the method previously described. Again, y itself may be an integral over another variable, say z, and so on. Each integration is performed once and the result stored. It is then performed again with twice as many subintervals and the result compared with the previous one. The process is continued until two conditions are met: a) The result differs from the previous one by less than the specified error. b) The number of subintervals is at least the number specified by the user. DIFFERENTIATION Some central difference formulas to find derivates: First derivative:
f(x-2h)-8f(x-h)+8f(x+h)-f(x+2h) Second derivative:
-f(x-2h)+16f(x-h)-30f(x)+16f(x+h)-f(x+2h) Higher derivatives:
1
n
n! In all cases h is a small quantity. PARTIAL DIFFERENTIATION Here we use the convention
¶F
¶²F
¶²F and similarly for all other combinations. Suppose we have a function of 4 variables F(x,y,z,t). If h is a small quantity, then the first and second order partial derivatives of F(x,y,z,t) can be approximated by the following expressions. Here we assume that the function and all of its 1st and 2nd order partial derivatives are continuous at the point we’re interested in.
F(x-2h,y,z,t)-8*F(x-h,y,z,t)+8*F(x+h,y,z,t)-F(x+2h,y,z,t)
|
|
Copyright © 2001-2010 Numerical Mathematics. All rights reserved.
|