This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Practical Session 10 Solutions Exercises 1. (a) Figure 1 shows the plot. Suitable bracketing values are x 1 = 1 , x 2 = 3 .0.40.2 0.2 0.4 0.6 0.8 1 2 4 6 8 10 g(r) r (units of Bohr radius) Figure 1: See 1. (a). (b) The code find_root_bisec.c requires only the values of x1 and x2 to be changed, and the function in f() needs to be altered to something like the following. float f(float x) { float y; y = 1.0  3.*x/4. + x*x/8.  x*x*x/192.; return y; } Compiling and running the code leads to the estimate of the root r 1 . 87 . A total of 24 iterations were required (the counting of iterations starts at zero). The result is accurate, as the function evaluates to 10 8 at the root. Since r is in units of 5 10 11 m , the electron is about 1 . 87 5 10 11 m 9 . 4 10 11 m from the nucleus. (c) The function f ( r ) has only double roots because it is equal to g ( r ) 2 times a positive function. More precisely, g ( r ) has three roots which we can denote r 1 , r 2 , r 3 . Hence we have g ( r ) ( r r 1 )( r r 2 )( r r 3 ) , and f ( r ) ( r r 1 ) 2 ( r r 2 ) 2 ( r r 3 ) 2 e r/ 2 . (1) Since e r/ 2 is nonzero for finite r , the function f ( r ) has only the roots r 1 , r 2 , r 3 , and they are all double roots. Our code fails to find double roots because they dont meet thethey are all double roots....
View
Full
Document
This note was uploaded on 09/29/2009 for the course COSC 1002 taught by Professor Wheatland during the Three '09 term at University of Sydney.
 Three '09
 wheatland

Click to edit the document details