CS 350 Numerical Methods, Spring'16


  • Syllabus 
  • Course Policies
  • Classroom practice (click here)
    • Spring'14 (click here)
    • Spring'12 (click here)
  • Assignments Requirement: For the computing projects - type both the questions and your answers into a document named as CS350_assignment#_firstname_lastname.doc. Highlight your final answers with yellow colors. For programming projects - proper comments and format for the code and its detailed I/O examples; BOTH of the code and the I/O document copied to a document . Email the document as attachment to the instructor (usvwccs@gmail.com)*. The email subject is the same as the file name. A hard copy of the document should be handed-in on the due date. 
    • Assignment 1 (Due: Mon. 2/1) (i) Show the equation, x cos x - 2x2 + 3x - 1 = 0, has at least one solution in [1.1, 1.4]. (ii) Test an equation if it has a solution or not, in given intervals.The given equation is: (x-2)2 - lnx = 0; the intervals are [2, 4]. (iii) Let f(x) = x3+ x. find the second Taylor polynomial P2(x) about x0 = 0. 
      • Answer key - Laura's answer.  
    • Assignment 2 (Due: Mon. 2/8) (i) Write a Java program to assign 3.1416 to p* and actual value of π (MATH.PI) to p, and then display the absolute error (AE) and relative error (RE) in approximations of p by p*. The rest questions are no-programming ones; just type the questions and answers that are highlighted. (ii) Using 3-digit chopping arithmetic for 133+0.921, compute the AE and RE. (iii) Using 4-digit chopping arithmetic to find the most accurate approximations of the solutions (roots) with appropriate formula (1.1) - (1.3) in p.23-p.24, for the equation 1.002x2-11.01x+0.01265 = 0.  Hint: since b<0 and |b|~sqrt(b2-4ac), use (1.1a) to calculate x1, and (1.3) to calculate x2. (iv) Using 4-digit chopping arithmetic to evaluate f(2.279) for f(x) = 1.013x5-5.262x3-0.01732x2+0.8389x - 1.912 by first calculating the power terms using 4-digit chopping arithmetic. (v) Find the rates of convergence. Exercise Set 1.4, #10(d), #11(d). 
    • Assignment 3 (Due: Mon. 2/15) (i) Evaluate textbook P.24 Example 1 function, f(x) = x3 -6.1x2 + 3.2x +1.5 at x=4.71 using 4-digit chopping. (ii) Write a Java program to use the Secant Method to find the solution accurate to within 10-4 (TOL) for the following equation: x3 - 2x2 -5 = 0, on [1, 4]. (iii) Use Bisection method to find p3 for f (x)= 3(x+1)(x-1/2)(x-1) on [-2, 1.5]. (iv) Use the Newton's Method to find the solution accurate to within 10-4 for the following equation: x3 - 2x2 -5 = 0, on [1, 4]. 
    • Assignment 4 (Due: Mon. 2/22) For the function f(x) = (x-1)1/2, let x1=1, x2=1.6, x3=1.9. (i) Construct the Lagrange interpolating polynomial of degree 2, P2, and simply to a general form. (ii) find the approximation of f(1.45) with P2.  
    • Assignment 5 (Due: Mon. 3/07) (a) P.81, #1a. For degree 2, use the first three data. (b) Show the details of the Midpoint, Trapezoidal, and Simpson's rules applied to the integration of x4 over [0.5, 1]. 
    • Assignment 6 (Due: Wed. 4/06) take-home projects that will be posted on Blackboard (Content) after Test 1B.
    • Assignment 7 (Due: Wed. 4/13)  Numerical differentiation, P.170 Exercise Set 4.9, #1b, #2b (compute absolute errors and relative errors), #3b, #4b  (compute absolute errors and relative errors). Show the solving processes. 
    • Assignment 8 (Due: Wed. 4/20)  i) Solve IVP with the Euler's method. P. 182 Exercise Set 5.2, #1 c. Show the solving processes. ii) re-do the last question with the Modified Euler Method - P.189 Set 5.3 #1 c. iii) re-do the Midpoint method. Compare all the results to the actual values (P.189, y = t*lnt +2t). 
    • Assignment 9 (Due: Mon. 4/25) Write a Java program to implement the RK4 and solve the same question in Assignment 8. To compare the result, display the exact solution also. 
    •  

    * The email (usvwccs@gmail.com) is just for collecting the assignments/tests; for the purpose of communications, please use the VWC email (zwang@vwc.edu)

  • Topics covered
    • 1/25: Syllabus, and class policy. Review of Java (Click here to download the note).
    • 1/27: intermediate value theorem (IVT), Taylor polynomials.   
    • 2/01 Finite digit arithmetic/computing; absolute/relative error. 
    • 2/03 More on FDA/FDC; convergence rate.
    • 2/08 Bisection method.
    • 2/10 Java code for Bisection, secant method, Newton's method.   
    • 2/15 Lagrange's interpolation method. 
    • 2/17 Newton's divided difference method for interpolation (same result as with Lagrange's).
    • 2/22 Review for convergence rate
    • 2/24 Test 1A 
    • 2/29 Basic quadrature rules: midpoint, trapezoidal, and Simpson's rules, p.107-114.
    • 3/02 Composite quadrature rules. Java for comp. trap. rule.
    • 3/07 Monte Carlo integration (click here).
    • 3/09 More on numerical methods on integration.
    • 3/14 Online review with worksheet. NO classroom meeting, but do the worksheet on Blackboard (Content) during the class time.
    • 3/16 Test 1B (covering class materials taught until 2/29, including interpolation methods and basic quadrature rules), 2:30pm-3:45pm, online test ONLY, NO classroom meeting, but do the test on Blackboard (Content) during the class time. You may use books, notes, and online materials. But you cannot talk to others during the test.
    • (3/21-3/25 Spring break).
    • 3/28 Easter Monday (school close).   
    • 3/30 Take-home projects for assignment 6. NO classroom meeting, but use the class time to do the projects on Blackboard (Content) that would be due April 6. 
    • 4/04 On test 1B and project.
    • 4/06 Assignment 6 due at 1pm. Numerical methods on derivative.
    • 4/11 IVP - Euler's method (click here for notes) and its Java implementation (click here).
    • 4/13 Midpoint methods (p.185).
    • 4/18 Modified Euler (for java code, click here).
    • 4/20 Runge-Kutta method of order 4 (RK4).
    • 4/25 More on IVP.
    • 4/27 Test 2. For calculations, display the results to 5 decimal places.
    • 5/02 Linear systems - Gaussian elimination method with backward substitution (Click here for note)  
    • 5/04 Exam
     

     

 


  • Monte Carlo Integration (click here)

 


 

Since 2000, Dr. John Wang, Virginia Wesleyan College, 1584 Wesleyan Drive, Norfolk/Virginia Beach, VA 23502 
Updated on Wednesday, April 27, 2016by
zwang@vwc.edu
 
http://zwang.vwc.edu/~jwang/ThreeFifty