Sei sulla pagina 1di 4

MA405 Numerical Analysis Requirements for Graded Homework Assignments Dr. M.

Leigh Lunsford For each homework problem you turn in to be graded, you should include the following (when applicable): (a) A statement of the problem (including all parts) you are attempting to solve. (b) Any assumptions you make to solve the problem and why you make those assumptions. (c) A description what each variable you use represents. (d) A brief write-up of your approach to solving the problem, including the names or statements of any theorems you may use. The purpose of this write-up is to convince the reader (me) that you understand what you are doing and why you are doing it. (e) Output from any algorithms you may use to solve the problem. DO NOT print out the code. I only need to see what algorithm you ran, what your inputs were to that algorithm, and the output you generated (with those inputs) that supports your answer. (f) A statement (i.e. an English sentence) that gives your answer to the problem. Below is a sample write-up for problem 2.1 #17. Items marked NOTE are not part of the write-up but notes to you on how to structure your write-up. Problem 2.1, #17 A trough of length L has a cross section in the shape of a semicircle with radius r (See the figure below). (NOTE: Either reference the figure in the text or redraw the figure here it is OK to redraw this by hand as I have done below which will not appear on the electronic version). When filled with water to within a distance h of the top, the volume V of water is
V = L 0.5 r 2 r 2 arcsin(h / r ) h(r 2 h 2 )1/ 2

Suppose L = 10 ft. , r = 1 ft. , and V = 12.4 ft 3 . Find the depth of the water in the trough to within 0.01 ft. Also show a determination of the number of iterations of the Bisection method necessary to achieve the desired degree of accuracy for the solution.

Solution: From the picture above, it is clear that L is the length of the trough, r is the radius of the semicircle cross section of the trough, V is the volume of water in the trough, and h is the distance from the water level to the top of the trough. Let d be the depth of the water. We have indicated d on the figure above. Since the radius of the trough is given to be 1 foot, the depth of the water will be given by d = 1 h . Plugging in the values for the length, radius, and volume given above, we have the following equation to solve for h :
12.4 = 10 0.5 arcsin( h) h(1 h 2 )1/ 2

Solving for h is equivalent to find a solution to the equation


10 0.5 arcsin( h) h(1 h 2 )1/ 2 12.4 = 0

which is equivalent to finding a zero of the function


f (h) = 10 0.5 arcsin(h) h(1 h 2 )1/ 2 12.4

Since f (0) = 10 0.5 arcsin(0) 0(1 0 2 )1/ 2 12.4 > 0 and


f (1) = 10 0.5 arcsin(1) 1(1 12 )1/ 2 12.4 < 0 and f is continuous on [0,1] , then by

the Intermediate Value Theorem we know that f has a zero on the interval. Using the Bisection method (Maple output below) with initial interval [0,1] , we get that h = 0.16699219 which is accurate to 103 (hence 102 as requested). (NOTE: Either cut and paste your Maple output below or attach your Maple output that justifies your answer). Lastly solving for d we have that d = 1 0.16699219 = 0.83300781 . Thus the depth of the water is approximately 0.833 feet. Next we show how to determine of the number of iterations of the Bisection method necessary to achieve the desired degree of accuracy for the solution. Since our starting interval was [0,1] and the absolute error of the Bisection method at step n is less than or ba equal to n , we will determine a value of n such that 2 1 < 102 n 2 To solve for n we have 100 < 2 n and taking the natural log of both sides we have ln(100) < ln(2n )

Note that the inequality is preserved since the natural log is an increasing function on the interval (0, ) . Solving for n we have
2 ln10 < n 6.64 < n n = 7 ln 2

In our Maple solution below we have more than seven iterations. This is because we used 103 as an input tolerance. If we solve the above inequality using 103 instead of 102 we get
3ln10 < n 9.966 < n n = 10 ln 2

which is the number of iterations performed by the algorithm.

Maple Output: (NOTE: I have included which algorithm I ran (alg021), the input to the algorithm, and the output. I have NOT included the Maple code for the algorithm). > alg021(); This is the Bisection Method. Input the function F(x) in terms of x For example: cos(x) > 10*(0.5*3.141592654-arcsin(x)-x*(1-x^2)^(1/2))-12.4; Input endpoints A < B separated by blank: > 0 1; Input tolerance: > .001; Input maximum number of iterations - no decimal point! > 20000; Select output destination: 1. Screen 2. Text file Enter 1 or 2: > 1; Select amount of output: 1. Answer only 2. All intermeditate approximations Enter 1 or 2: > 2; Bisection Method: I P F(P) 1 5.00000000e-01 -6.2581515e+00 2 2.50000000e-01 -1.6394539e+00 3 1.25000000e-01 8.1448903e-01 4 1.87500000e-01 -4.1994672e-01

5 6 7 8 9 10

1.56250000e-01 1.71875000e-01 1.64062500e-01 1.67968750e-01 1.66015625e-01 1.66992188e-01

1.9572591e-01 -1.1253639e-01 4.1493243e-02 -3.5547573e-02 2.9664120e-03 -1.6292195e-02

Approximate solution P = .16699219 with F(P) = -.01629220 Number of iterations = 10 Tolerance = 1.00000000e-03

Potrebbero piacerti anche