ACMS 40390: Fall 2010

Numerical Analysis

Textbook:

Richard L. Burden and J. Douglas Faires, Numerical Analysis, 8th Edition. Student Edition: ISBN-10: 0-534-39200-8

Class time: M, W, F, 8:30am - 9:20am.

Classroom: Edward J. DeBartolo Hall 131

Office hours: M 12:30pm - 2:30pm; Tu 12:30pm - 2:00pm or by appointment

Final exam schedule: Monday, Dec. 13th, 8:00AM-10:00AM in 131 DeBartolo Hall.

Prerequisites:

MATH 20750 or MATH 20860 or MATH 30650 or ACMS 20750 or PHYS 20452

The course requires a moderate amount of programming. C, C++ or Fortran programming languages are preferred. However, you may also use software programs including Matlab, Mathematica.

Syllabus is here.

Tips about programming:

Important Dates
First test review Monday, 09/27 in class
First in class test Wednesday, 09/29 in class
Second test review Monday, 10/25 in class
Second in class test Wednesday, 10/27 in class
Final test review TBA TBA
Final test TBA TBA

Week 1:

  • Wednesday (08/25): Section 1.1; HW: 1(a), 1(c), 2(b), 2(c), 4(a), 4(c).
    Matlab code for Ex1.1.1 Example 1.1.1
  • Friday (08/27): Section 1.1; HW: 9, 17.
    Matlab code for Ex1.1.3 Example 1.1.3
    Computer project: Setup your account for computer projects. Compile and run the C++ code on the machine "darrow" and submit your work following the instruction at Instruction and help on Unix systems . The code for practising is ex0-1.cpp .
    Matlab code for homework problem 17 in Exercise Set 1.1 Solution to problem 17

    Week 2:

    A Short Tutorial on The Binary System

    In the decimal system, we use the digits 0-9 to represent numbers, and things are organized into columns. Take the decimal number 285 for example:

     
        H | T | O
        2 | 8 | 5
    
    such that "H" is the hundreds column, "T" is the tens column, and "O" is the ones column. So the decimal number "285" is 2-hundreds plus 8-tens plus 5-ones.

    The ones column stands 10^0, the tens column stands 10^1, the hundreds column stands 10^2 and so on, so

     
          10^2|10^1|10^0
            2 |  8 |  5 
    
    the number 285 is really {(2*10^2)+(8*10^1)+(5*10^0)}.

    The binary system works under the exact same way as the decimal system, except it operates in the base 2 rather than the base 10. In other words, instead of columns being

     
           10^2|10^1|10^0
    
    they are
     
            2^2|2^1|2^0
    

    Instead of using the digits 0-9, we only use 0-1 digits.

    Examples: What will the binary number 1011 be in the decimal system?

    Answer: By using the columns, we have

            2^3|2^2|2^1|2^0
             1 | 0 | 1 | 1
    
    Therefore
     
      1011=(1*2^3)+(0*2^2)+(1*2^1)+(1*2^0)
          = (1*8) + (0*4) + (1*2) + (1*1)
      = 11 (in decimal system)
    


  • Monday (08/30): Section 1.2;
  • Wednesday (09/01): Section 1.2; HW: 2(a), 2(b), 2(c), 12.
  • Friday (09/03): Section 1.2; 1.3. HW: Exercise Set 1.2: 4(a), 4(b), 4(c), 13(a), 15(a), 15(b).

    Week 3:

  • Monday (09/06): Section 1.3; 2.1. HW: Exercise 1.3: 6(a), 6(c), 7(a), 7(b), 9, 11.
    The sample code for the bisection method is ALG021_bisection.cpp .
  • Wednesday (09/08): Section 2.1. HW: Exercise 2.1: 4(a), 5(a), 5(b), 10.
  • Illustration and algorithm for the bisection method is here.
    Computer project: Do Extercise 2.1.8 and submit the code in acms40390/hw1 with name ex1-1.cpp
  • Friday (09/10): Section 2.2. HW: Exercise 2.2: 2(a)(use function in 1(a)).
  • Illustration and algorithm for the fixed-point iteration method is here.
    The sample code for the fixed-point iteration method is ALG022_fixed_pt_iter.cpp

    Week 4:

  • Monday (09/13): Section 2.2; 2.3. HW: Exercise 2.2: 3(a), 3(b), 7.
    Computer project: Do Extercise 2.2.5 and submit the code in acms40390/hw2 with name ex2-1.cpp. Use the condition |p_n - p_{n_1}|/|p_n| < 10^{-4} to test the convergence instead.
  • Wednesday (09/15): Section 2.3. HW: Exercise 2.3: 2, 6(b), 6(c), 6(d). (Let the two successive approximation < 10^{-5} for 6(b), 6(c), 6(d))
    Computer project: Do Extercise 2.3.6(a) using the Newton;s method and submit the code in acms40390/hw2 with name ex2-2.cpp. Again use the condition "the two successive approximation < 10^{-5}".
     
  • Illustration and algorithm for the Newton's method is here.
    The sample code for the Newton's method is ALG023_Newton.cpp
  • Illustration and algorithm for the Secant method is here.
    The sample code for the Secant method is ALG024_Secant.cpp
  • Friday (09/17): Section 2.6. HW: Exercise 2.3: 3(a), 8(do problems 6(b), 6(c), c(d)).
    Computer project 1: Do Extercise 2.3.6(a) using the secand method and submit the code in acms40390/hw2 with name ex2-3.cpp.
    Computer project 2: Do Extercise 2.6.7(b) using the Newton's method and Horner's method to evaluate the value and derivative of the polynomial and submit the code in acms40390/hw2 with name ex2-4.cpp. Hint: You will need to combine Newton's method code and Horner's method code together.
  • Algorithm for the Horner's method is here.
    The sample code for the Horner's method is ALG027_Horner_2.cpp

    Week 5:

  • Announcement: The office hour on Tuesday (09/21) is canceled. The make-up office hour is W, 12:30pm - 2:00pm.
  • Monday (09/20): Section 3.1. HW: Exercise 3.1: 1(a), 1(b).
    The Matlab code for the Lagrange Interpolating Polynomial is Lagrange Interpolating Polynomial and Lagrange basis Polynomial .
  • To use this sample code to solve Example 3.1.1, do the following:
    Download these two files and in Matlab add paths where we save these two files;
    In the command window, excute the following statement to see the curve of the 2nd degree Lagrange polynomial for interpolating points taken from 1/x:
    xi = [2.0, 2.5, 4.0];
    fi = 1./xi;
    lp = lagrange_2(xi, fi);
    xx = 0.5:0.01:5;
    plot(xx, polyval(lp, xx), xi, fi, 'or', xx, 1./xx, '--g');
  • The practice exam and the solution for the first midterm is here
  • Wednesday (09/22): Section 3.1; 3.2. HW: Exercise 3.1: 5(a), 5(b), 9(a), 9(b). (Note: 9(a) and 9(b) only do n = 1 case).
  • Friday (09/24): Section 3.2; 3.4. HW: Exercise 3.2: 2, 17.
  • The cubic spline Matlab code is here . The input data for Ex3.4.3 is here .

    Week 6:

  • Monday: Review.
  • Wednesday (09/29): Exam 1.
  • Friday (01/10): Section 3.4; 4.1. HW: Exercise 3.4: 4(c), 6(c).

    Week 7:

  • Monday (10/04): Section 4.1 HW: Excercise 4.1: 6(a), 6(b), 8(a), 8(b), 13, 18, 20, 21.
  • Wednesday (10/06) Section 4.3 HW: Excercise 4.3: 2, 4, 6, 8.
  • Friday (10/08) Section 4.3; 4.4. HW: Excercise 4.3: 16.

    Week 8:

  • Monday (10/11): Section 4.4; 4.7 HW: Excercise 4.4: 1(a), 1(b), 1(e), 3(do for problems 1(a), 1(b), 1(e)), 5(do for problems 1(a), 1(b), 1(e)), 12, 14.
  • The Composite Simpson's rule code is here .
    Computer project: Do Extercise 4.4.1(f) by the composite Simpson's rule, composite trapezoidal rule and composite midpoint rule respectively. Submit the code in acms40390/hw3 with name ex3-1.cpp, ex3-2.cpp, ex3-3.cpp respectively.
  • Wednesday (10/13): Section 5.1; 5.2 HW: Excercise 4.7: 1(a, b, c), 2(do for problems 1(a, b, c)). Excercise 5.1: 2(a, b, c), 4(a, b, c), 8(a, b).
  • The practice exam for the second midterm is
  • Friday (10/15): Section 5.2; 5.3 HW: Excercise 5.2: 2(a, b), 4(a, b), 9(bi, c), 10(b, c). Excercise 5.3: 2(a, b), 9(bi).
    Computer project: Do Extercise 5.2.10(a) by the Euler's method. Print out solutions at each time step. Hint: You may use Composite Simpson's rule code as the base code for developing Euler's method code, since in Composite Simpson's rule code, we have set up the mesh points and have implemented a "C" function called "F()" to evaluate the integrand value. "F()" can be turn into a function to evaluate the right hand side of ODEs if two arguments are passed into it (one for t_i, the other for w_i). Submit the code in directory acms40390/hw4 with name ex4-1.cpp.

    Week 9:

    Fall Break

    Week 10:


  • Monday (10/25): Review for the 2nd exam.
  • The soluton key of the practice exam for the second midterm is here
    Announcement: The email server s down today (10/26). If you have questions, pls call me at 631-3423.
  • Wednesday (10/27): 2nd exam.
  • Friday (10/29): 5.4 Runge-Kutta Methods. Read the Section
  • The modified Euler's method code is here .

    Week 11:


  • Monday (11/01): Section 5.4, 5.6. HW: Excercise 5.4: 2(a, b), 10 (do problems 2(a, b)), 14 (do problems 2(a, b)).
    Computer project: Do Extercise 5.4.2(d) by the Modified Euler method, Midpoint method and Runge-Kutta method of order 4 respectively. Print out solutions at each time step. Submit the code in directory acms40390/hw5 with name ex5-1.cpp, ex5-2.cpp, ex5-3.cpp respectively.
  • Wednesday (11/03): 5.6. HW: Excercise 5.6: a) Use two-step and four step Adams-Bashforth explicit methos to solve 2(a, b). b) Problem 4. Use two-step Adams-Moulton implicit method to solve Exercise 1(c) for i = 2.
  • The Adam-Bashforth four step explicit method code is here .
    Computer project: Do Extercise 5.6.2(c) by the two-step Adams-Bashform explicit method. Submit the code in directory acms40390/hw6 with name ex6-1.cpp.
  • Friday (11/05): 5.10; 5.11. HW: Excercise 5.10.8.
  • The stiff eqnation example is here .
    Computer project: Do Extercise 5.6.6 (solve Problem 2(c)). Submit the code in directory acms40390/hw6 with name ex6-2.cpp.

    Week 12:

  • Monday (11/08): 5.11. HW: Excercise 5.11. 2(a,b); 4(do problems 2(a,b)); 10.
  • The Trapezoidal with Newton Iteration code is here .
  • Wednesday (11/10): 5.11, 6.1.
    Computer project: Do Extercise 5.11.14 (solve Problem 2(d)). Submit the code in directory acms40390/hw6 with name ex6-3.cpp.
  • Illustration and algorithm for Gaussian elimination with backward substitution method is here.
  • The Gaussian elimination with backward substitution for solving linear systems of eqns code is here .
  • Friday (11/12): 6.1. HW: Excercise 6.1. 3, 6, 9.
  • The Gaussian elimination with partial pivoting for solving linear systems of eqns code is here .

    Week 13:


  • Monday (11/15): 6.2. HW: Excercise 6.2. 2(a,b), 4(do Problems 2(a,b)), 10(a), 16(do problem 10(a)), 20(do problem 10(a)).
    Computer project: Do Extercise 6.2.10(b) by Gaussian elimination with scaled partial pivoting. Submit the code in directory acms40390/hw7 with name ex7-1.cpp .
  • Wednesday (11/17): 6.5. HW: Excercise 6.5. 2.
  • Matrix LU factorization code is here .
  • Friday (11/19): 6.5. HW: Excercise 6.5: 2, 6(a) (compute LU by hand), 6(c,d) (can use computer code), 7(a), 8(a). (Hint: For problems 7(a) and 8(a), you can either use code or do hand calculation to get LU. Then solve the resulted LUx = b system)

    Week 14:


  • Monday (11/23): 6.5, 6.6. HW: Excercise 6.5. 3(a,b), 9(a, b).

    Week 15:


  • Monday (11/29): 6.6. HW: Excercise 6.6. 2, 6( do problems 4(a, b, c)), 17, 18, 23.
  • Wednesday (12/01): 6.6, 7.1. HW: Excercise 6.6. 11(a,b,c).
  • Friday (12/03): 7.1, 7.3 HW: Excercise 7.1: 1, 3, 4, 5(a, b), 6. Excercise 7.3:1(a, b, c).
  • Jacobi iteration code is here .
  • Gauss Seidel iteration code is here .
  • Gaussian elimination with scaled partial pivoting code is here .

    Week 16:


  • Monday (12/06): 7.3. HW: Excercise 7.3. 2(a,b,c), 4, 17(a,c).
  • The last homework assignment will not be collected.
  • Additional office hours for final exam: Fri, Sat and Sun from 2:00pm - 4:00pm.