Numerical Methods.  If (n+1) number of points are given, (n+1) number of equations can be formed using a (n+1) order polynomial  The equations can be.

Slides:



Advertisements
Similar presentations
Numerical Methods.  Forward Elimination of Unknowns: In this step, the unknown is eliminated in each equation starting with the first equation. This.
Advertisements

4/22/ LU Decomposition Electrical Engineering Majors Authors: Autar Kaw Transforming.
Numerical Methods.  Polynomial interpolation involves finding a polynomial of order n that passes through the n+1 points.  Several methods to obtain.
Differentiation-Discrete Functions
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
Interpolation Used to estimate values between data points difference from regression - goes through data points no error in data points.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
7/2/ Differentiation-Discrete Functions Industrial Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
1 Chapter 3 INTERPOLATION. 2 WHAT IS INTERPOLATION? Given (x 0,y 0 ), (x 1,y 1 ), …, (x n,y n ), finding the value of ‘y’ at a value of ‘x’ in ( x 0,
CSE 330 : Numerical Methods Lecture 17: Solution of Ordinary Differential Equations (a) Euler’s Method (b) Runge-Kutta Method Dr. S. M. Lutful Kabir Visiting.
8/15/ Differentiation-Discrete Functions Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
CSE 330: Numerical Methods.  Regression analysis gives information on the relationship between a response (dependent) variable and one or more predictor.
1 Calculating Polynomials We will use a generic polynomial form of: where the coefficient values are known constants The value of x will be the input and.
CSE 330 : Numerical Methods
10/11/ Differentiation-Discrete Functions Chemical Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
1. Inverse of A 2. Inverse of a 2x2 Matrix 3. Matrix With No Inverse 4. Solving a Matrix Equation 1.
1 Interpolation. 2 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a.
Inverse and Identity Matrices Can only be used for square matrices. (2x2, 3x3, etc.)
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Chapter 14 Curve Fitting : Polynomial Interpolation Gab Byung Chae.
Numerical Methods For Slides Thanks to Lecture 6 Interpolation
Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate.
Numerical analysis in 10mins Zhiyun (Kevin) Kuang.
CSE 330 : Numerical Methods Lecture 15: Numerical Integration - Trapezoidal Rule Dr. S. M. Lutful Kabir Visiting Professor, BRAC University & Professor.
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
EE3561_Unit 5(c)AL-DHAIFALLAH14361 EE 3561 : Computational Methods Unit 5 : Interpolation Dr. Mujahed AlDhaifallah (Term 351) Read Chapter 18, Sections.
1 INTERPOLASI. Direct Method of Interpolation 3 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a value.
Numerical Methods. Introduction Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations.
CSE 330: Numerical Methods. What is regression analysis? Regression analysis gives information on the relationship between a response (dependent) variable.
Numerical Methods. Prof. S. M. Lutful Kabir, BRAC University2  One of the most popular techniques for solving simultaneous linear equations is the Gaussian.
1 Approximating functions, polynomial interpolation (Lagrange and Newton’s divided differences) formulas, error approximations.
11/22/ Differentiation-Discrete Functions.
Using Matrices to Solve a 3-Variable System
EEE 244-3: MATRICES AND EQUATION SOLVING
Moran’s I and Correlation Coefficient r Differences and Similarities
Numerical Analysis Lecture 25.
Interpolation.
Differentiation-Discrete Functions
Interpolation Estimation of intermediate values between precise data points. The most common method is: Although there is one and only one nth-order.
Chapter 18.
Differentiation-Discrete Functions
INTERPOLATION Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values.
Precisions of Adjusted Quantities
Chapter 18.
Major: All Engineering Majors Authors: Autar Kaw
Observation 1 2 ….. i …… n ……….M 1 X11 X21 Xi1 Xn1 M.1
Chapter 7 Numerical Differentiation and Integration
Today’s class Multiple Variable Linear Regression
MATH 2140 Numerical Methods
Find the inverse of the matrix
Numerical Analysis Lecture 23.
Multiplicative Inverses of Matrices and Matrix Equations
ECE 221 Electric Circuit Analysis I Chapter 6 Cramer’s Rule
MATH 174: Numerical Analysis
Numerical Computation and Optimization
Warm Up: Solve the Equation 4x2 + 8x – 32 = 0.
INTERPOLASI.
Why Splines ?
Dividing Polynomials. Dividing Polynomials Example 2X2+14x−16 X−1.
Interpolation Practice-6 Additional chapters of mathematics
EEE 244-3: MATRICES AND EQUATION SOLVING
LAGRANGE INTERPOLATING POLYNOMIALS
Regression and Correlation of Data
Matrices and Linear Equations
Numerical Analysis Lecture 24.
Observation 1 2 ….. i …… n ……….M 1 X11 X21 Xi1 Xn1 M.1
Differentiation-Discrete Functions
Interpolation with unequal intervals
Major: All Engineering Majors Authors: Autar Kaw
Presentation transcript:

Numerical Methods

 If (n+1) number of points are given, (n+1) number of equations can be formed using a (n+1) order polynomial  The equations can be arranged in matrix form [Y]=[C][A]  [Y] is a column matrix consisting of ‘y’ values of the given points  [C] is (n+1) X (n+1) sized square matrix having different terms consisting of power of ‘x’ values of the given points  [A] is the co-efficient matrix which is consisting of the unknown to be determined to find the polynomial  [A] is obtained from [A]=[C] -1 [Y] 2

% Direct Polynomial n = 3; x = [6,8,10,12]; y = [80,120,160,240]; xu = 9; % formation of [C] matrix of the equation [Y]=[C][A] for i = 1:(n+1) for j = 1:(n+1) c(i,j) = x(i)^(j-1); end Prof. S. M. Lutful Kabir, BRAC University3

% determination of inverse of [C] matrix, [CI] ci = inv(c); % determination of the coefficient matrix [A] by [CI][Y] for i = 1:(n+1) a(i) = 0.0; for j=1 : (n+1) a(i) = a(i) + ci(i,j)*y(j); end % determination of interpolated value of Y for the value, Xu fxu = 0.0; for i=1:(n+1) fxu=fxu + a(i) * xu^(i-1); end 4

 The Lagrangian interpolating polynomial is given by where n in f n (x) stands for the nth order polynomial that approximates the function y=f(x) given at n+1 data points as (x 0,y 0 ), (x 1,y 1 ), (x 2,y 2 ),……. (x n-1,y n-1 ), (x n, y n ) and L i (x) is a weighting function that includes a product of n-1 terms with terms of j = i omitted. 5Prof. S. M. Lutful Kabir, BRAC University

% Lagrangian Polynomial n = 3; x = [6,8,10,12]; y = [80,120,160,240]; xu = 9; % Determination of Lagrangian Polynomial values for x=x u for i = 1:n+1 L(i) = 1.0; for j = 1:n+1 if j ~= i L(i) = L(i) * (xu - x(j)) / (x(i) - x(j)); end 6

% determination of value of the function at x=x u fxu = 0.0; for i = 1:n+1 fxu = fxu + L(i) * y(i); end Prof. S. M. Lutful Kabir, BRAC University7

 For an example of a third order polynomial, given ( x 0, y 0 ), ( x 1, y 1 ) and ( x 2, y 2 ) 8 x0x0 x1x1 x2x2 x3x3 f (x 0 ) f (x 1 ) f (x 2 ) f (x 3 ) f [x 1,x 0 ] f [x 2,x 1 ] f [x 3,x 2 ] f [x 2,x 1, x 0 ] f [x 3,x 2, x 1 ] f [x 3,x 2,x 1, x 0 ] b0b0 b1b1 b2b2 b3b3 Prof. S. M. Lutful Kabir, BRAC University

% Newton Divided Difference Polynomial n = 3; x = [6,8,10,12]; y = [80,120,160,240]; xu = 9; % formation first column of bracketed ‘f’ table j = 1; for i = 1:(n+1) f(i,j) = y(i); end 9

Prof. S. M. Lutful Kabir, BRAC University10 % formation other columns of bracketed ‘f’ table for j = 2:(n+1) for i = 1:(n-j+2) f(i,j) = (f(i+1,j-1) - f(i,j-1)) / (x(i+j-1)-x(i)); end % formation of b 1, b 2, b 3, b 4 ……..b n+1 for j = 1:(n+1) b(j) = f(1,j); end

Prof. S. M. Lutful Kabir, BRAC University11 % determination of y value for the unknown x=x u fxu = b(1); for i = 2:(n+1) prod = 1.0; for j = 1:(i-1) prod = prod*(xu-x(j)); end fxu = fxu + b(i) * prod; end

Thanks Prof. S. M. Lutful Kabir, BRAC University12