{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

practical10_sol - Practical Session 10 Solutions Exercises...

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

View Full Document Right Arrow Icon
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 0.2 0.4 0.6 0.8 1 0 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 don’t meet the
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern