1 INTRODUCTION, FOUNDATIONS ELM1222 Numerical Analysis Some of the contents are adopted from Laurene V. Fausett, Applied Numerical Analysis using MATLAB. Prentice Hall Inc., 1999
2 Today s lecture Information about the course What is numerical analysis? Applied Problems Numerical Techniques Analysis
3 Information about the course Course Information Instructor: Dr. Muharrem Mercimek Office: A-216 Office Hours: Monday 13:00-16:00 Class Location: C-150 Group: 1-2 Course Materials: http://www.yildiz.edu.tr/~mercimek Email: muharrem.mercimek@gmail.com, mercimek@yildiz.edu.tr
4 Information about the course Textbook and course Materials Main Text Book: Laurene V. Fausett, Applied Numerical Analysis using MATLAB. Prentice Hall Inc., 1999 OR Laurene V. Fausett, Applied Numerical Analysis using MATLAB. 2 nd Ed., Pearson Inc., 2007.
5 Information about the course Grading Assignments: 15% Class Attendance: 10% Exams: 75% Assignments There will be individual programming assignments and these will be listed on the schedule page. Due dates will be specified and the students should submit their material on time. Program submissions should be the outcome of each student s own endeavors. Collaborative study is encouraged, but any code and document you prepare must be your own. Submissions must include source codes as well as the documentations and data files when needed. When submitting your Assignments via e-mail always zip it, and name it like ELM1222_YourName_YourNumber_AssignmentNumber.{zip or rar} When submitting an assignment always put a subject title relevant to why you are sending it. You can use the name of your zip file again.
KOM1042 Discrete Mathematics Dr Muharrem Mercimek 6 Information about the course Week Subjects Preparation 1 Introduction, Foundations Textbook Ch1 2 Solving Equations of one Variable Textbook Ch2 3 Linear Equation System Solution - Direct Methods Textbook Ch3 4 Linear Equation System Solution - iterative Methods Textbook Ch4 5 LU Factorization Textbook Ch6 6 Eigenvalues, Eigenvectors Textbook Ch7 7 Mid-term 1 8 QR factorization Textbook Ch8 9 Interpolation Textbook Ch9 10 Function Approximation I Textbook Ch10 11 Function Approximation II Textbook Ch10 12 Mid-term 2 13 Numerical Differentiation and Integration I Textbook Ch11 14 Numerical Differentiation and Integration II Textbook Ch11 15 Final Exam
7 Information about the course Programming environment MATLAB 2008 or higher with basic toolboxes, when needed. Academic Honesty Any misconduct in this course is considered a serious offense and strong penalties will be the results of such behaviors. It is cheating to copy others code. Fake program outputs and documents is also considered as cheating.
8 FOUNDATIONS Some of the contents are adopted from Laurene V. Fausett, Applied Numerical Analysis using MATLAB. Prentice Hall Inc., 1999
9 Applied Problems Nonlinear Functions To illustrate the types of problems for which a numerical solution may be desired. There are problems we can solve with algebra or calculus On the other hand there closely related problems for which not exact solution can be found The zeros of y = x 2 3 can be found exactly by quadratic formula But there is no such method for most non-linear functions It is proven that no formula exist for 5 th order functions-polynomials. In Numerical Analysis there are many methods to approximate the zeros of nonlinear functions (bisection, newton, etc.)
10 Applied Problems Linear Systems 4x 1 + x 2 = 6 x 1 + 5x 2 = 9 A = 4 1 1 5 x = x 1 x 2 b == 6 9 Ax = b The solution is not straightforward. We can apply some numerical techniques. Gaussian elimination systematically transforms the system to an equivalent system. If the Gaussian elimination could be carried out exactly the main issue would be computational efficiency.
11 Applied Problems Numerical Integrations Fundamental theorem of calculus states that the definite integral of a function can be from the ant-derivative of the function. For many functions it is easier to employ numerical techniques for finding definite integrals. We can approximate the function to be integrated 3 1 1 x 3 dx
12 Some Numerical Techniques- Fixed point Iteration Fixed-point iteration To find the square root of a positive number c Rewrite the equation x 2 = c as an implicit equation Root of 3 Fixed point form x = g x = 1 2 x + c x Starting with initial guess x0 Evaluate the function up to an iteration number or until the update is so small x 1 = 1 2 (x 0 + c x 0 ) x k = 1 2 (x k 1 + c x k 1 )
13 Some Numerical Techniques- Gaussian Elimination 4x 1 + x 2 = 6 x 1 + 5x 2 = 9 A = 4 1 1 5 x = x 1 x 2 b == 6 9 Ax = b r1: r2: 4 1 1 5 6 9 r1 0.25 r1 + r2 4 1 0 5.25 6 10.5 x 2 = 10.5 5.25 = 2, x 1 = 6 2 4 = 1
Some Numerical Techniques- Trapezoid Rule Approximates the definite integral a b f(x) dx b f(x) a dx h (f a + f b ) 2 Approximation of 3 1 dx 1 x 3 14 Accuracy depends on the length of the interval over which the approximation is imposed (i.e., on the value of h) Influenced by the characteristics of the function f
15 Analysis-Convergence For iterative methods Does the process converge? When do we stop? x = g x = cos x x 0 = 0.5 x = g x = 1 x 3 x 0 = 0.5
16 Analysis-when to stop the iteration If the numerical technique uses an iterative process, the iterations can be stopped after a while a) If absolute difference of the exact solution and the approximation at k. iteration is in within a specified tolerance x x k < tol1 (normally x* is not known when using a numerical technique) b) If absolute difference from one iteration to the other is in within a specified tolerance x k x k 1 < tol2 c) It the iteration number reaches to a maximum iteration number iter < iteration_number
17 Analysis-is the result good? a) Complexity of the approximation Let the approximation error be error = x x k or error = (x x k ) For some numerical techniques we have to limit the number of terms towards approximation. e.g: Taylor expansion is f x + h = f x + h. f x + h2 2! f x + h3 3! f x + + hn n! f(n) x Where f (n) ( ) denotes the nth derivative of f( ) f x is a function of x f x + h is a function of x+h (h is a small value) Taylor expansion puts the relationship between f x and f x + h For approximation of f x + h f h = 1 + h + h2 + h3 + + hn 2! 3! n! terms and omit the others = e x+h around x = 0 with a small h infinite number of terms but instead we can involve with a number of f h = 1 + h + h2 + h3 + O 2! 3! h4 here we omit the sum of the remaining terms denoted with O h 4 O( ) describes the error with limiting number of terms in use.
18 Analysis- is the result good? b) Floating Point Representation error On a computer we can represent integer numbers easily 255 is always 255. When it comes to the real numbers they have to be represented approximately. The value of pi as an example can only be approximated differently when represented with different number of digits. This brings an error in the approximation because numbers used are different.
19 Analysis - Round-off error c) Round off Errors During calculations/computing sometimes we round the number Rounding to 3 most significant digits after the decimal point 0,9900+0.0044+0.0042 the calculations when rounding: (0,9900+0.0044)+0.0042 =0.994+0.004=0.998 Or 0,9900+(0.0044+0.0042)=0.990+0.009=0.999 In a numerical analysis these two number will lead to different calculations/computing kucg.korea.ac.kr