practical10_sol - Practical Session 10 Solutions Exercises...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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.4-0.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 non-zero 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.

Page1 / 4

practical10_sol - Practical Session 10 Solutions Exercises...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online