1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.

Slides:



Advertisements
Similar presentations
Lecture 5.
Advertisements

1 Chapter 13 Curve Fitting and Correlation This chapter will be concerned primarily with two separate but closely interrelated processes: (1) the fitting.
1 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim. 2 1.FUNCTION SUMMARY polyfun  Polynomial functions are located in the MATLAB polyfun directory. For a complete.
Class 7.2: Graphical Analysis and Excel Solving Problems Using Graphical Analysis.
Chapter 2 Functions and Graphs
©1999 BG Mobasseri 15/24/99 INTERPOLATION AND CURVE FITTING Etter: pp June 16, ‘99.
Chapter 18 Interpolation The Islamic University of Gaza
CITS2401 Computer Analysis & Visualisation
Introduction to Matlab. I use Matlab for: Data analysis Data plotting Image Analysis Also – Simulations (solving odes/pdes/finite element methods) – Minimisations,
Linear Transformations
Curve Fitting and Interpolation: Lecture (IV)
Drawing Parametric Curves Jean-Paul Mueller. Curves - The parametric form of a curve expresses the value of each spatial variable for points on the curve.
Calibration & Curve Fitting
6.2 Graphs of Polynomials. The Degree of Polynomials The degree of a polynomial is the value of the largest exponent. y = 5x 4 + 3x 2 – 7 Degree = 4 y.
Least-Squares Regression
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
Chapter 9 Function Approximation
Introduction to MATLAB for Engineers, Third Edition Chapter 6 Model Building and Regression PowerPoint to accompany Copyright © The McGraw-Hill Companies,
Scientific Computing Linear and Quadratic Splines.
Scientific Computing Linear Least Squares. Interpolation vs Approximation Recall: Given a set of (x,y) data points, Interpolation is the process of finding.
Curve Fitting and Interpolation: Lecture (I)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Hydroinformatics: Session4 Dr Ivan Stoianov Room 328B Dr Andrew Ireson (Room 304) Mr Juan Rodriguez-Sanchez (411A) Mr Baback.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Polynomial Interpolation You will frequently have occasions to estimate intermediate values between precise data points. The function you use to interpolate.
Advanced Topics- Polynomials
Department of Mechanical Engineering, LSU Session IV MATLAB Tutorials Session IV Mathematical Applications using MATLAB Rajeev Madazhy
Chapter 14 Curve Fitting : Polynomial Interpolation Gab Byung Chae.
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Curve-Fitting Regression
Rationals- Synthetic Division POLYNOMIAL DIVISION, FACTORS AND REMAINDERS Synthetic division is an alternative method to dividing rationals. The great.
MATHLAB Prepared for: Md. Monzur Ashraf Prepared By: Md. Shafiul Parvez Aakaash.
Lecture 25 Introduction to steady state sinusoidal analysis Overall idea Qualitative example and demonstration System response to complex inputs Complex.
Lecture 10 2D plotting & curve fitting Subplots Other 2-D Plots Other 2-D Plots Curve fitting © 2007 Daniel Valentine. All rights reserved. Published by.
Scientific Computing Introduction to Matlab Programming.
CHAPTER 3 NUMERICAL METHODS
Recap Saving Plots Summary of Chapter 5 Introduction of Chapter 6.
1 Lecture 1 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Analyzing Functions (4.16) y=f(x) MATLAB. Functional Analysis includes: Plotting and evaluating a function Finding extreme points Finding the roots (zeros.
Section 5.5 The Real Zeros of a Polynomial Function.
Recap Cubic Spline Interpolation Multidimensional Interpolation Curve Fitting Linear Regression Polynomial Regression The Polyval Function The Interactive.
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
L5 – Curves in GIS NGEN06 & TEK230: Algorithms in Geographical Information Systems by: Sadegh Jamali (source: Lecture notes in GIS, Lars Harrie) 1 L5-
MODEL FITTING jiangyushan. Introduction The goal of model fitting is to choose values for the parameters in a function to best describe a set of data.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
Principles of Extrapolation
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Recap Functions with No input OR No output Determining The Number of Input and Output Arguments Local Variables Global Variables Creating ToolBox of Functions.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 17 and 18 Interpolation.
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
Lecture 29: Modeling Data. Data Modeling Interpolate between data points, using either linear or cubic spline models Model a set of data points as a polynomial.
Introduction to Programming for Mechanical Engineers
Data manipulation II: Least Squares Fitting
Spline Interpolation Method
Chapter 18.
Spline Interpolation Method
Chapter 12 Curve Fitting : Fitting a Straight Line Gab-Byung Chae
Spline Interpolation Method
Graph Polynomials Effect of Multiplicity on a graph
CT-321 Digital Signal Processing
Graph Polynomials Effect of Multiplicity on a graph
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.

In the previous lectures 2  Matlab Windows (workspace, m-file,…)  Working with Arrays  Mathematical Operations with Arrays  Using Script Files and Managing Data  Plotting data and functions.  Programming in Matlab.  User-defined functions.

Agenda 3  Polynomials  Curve Fitting  Interpolation.

Polynomials 4  Matlab representation of a polynomial:

Polynomials 5

Polynomials 6  Operations on polynomials:  Value of a polynomial.  Roots of a polynomial.  Addition, Multiplication and Division.  Derivatives of a polynomial.

Polynomials 7  Value of a polynomial: Example 1

8 Example 1: Solution Polynomials

Polynomials 9  Roots of a polynomial:

Polynomials 10  From roots to polynomial:

Polynomials 11  Addition of polynomials:  Two polynomials can be added (or subtracted) by adding (subtracting) the vectors of the coefficients. If the polynomials are not of the same order the shorter vector has to be modified to be of the same length as the longer vector by adding zeros in front.

Polynomials 12  Multiplication of two polynomials:

Polynomials 13  Division of two polynomials:

Polynomials 14  Derivatives of a polynomial:

Curve Fitting 15  Given: n points (x,y), it is required to write a polynomial of degree n-1 that passes throw all the points.  Using the polyfit function.  Polynomials can be used to fit data points in two ways. In one the polynomial passes through all the data points, and in the other the polynomial does not necessarily pass through any of the points, but overall gives a good approximation of the data.

Curve Fitting 16  Polyfit:

Curve Fitting 17  Example 2: Given a set of 7 points: (0.9,0.9), (1.5,1.5),(3,2.5),(4,5.1),(6,4.5),(8,4.9),(9.5,6.3) Let’s try to fit the points with polynomials of degrees 1 through 6.

Curve Fitting 18  Example 2:

Curve Fitting 19  Example 2:

20  Sometimes you have a set of data points, when plotted gives a close plot to a known function (i.e., power, logarithmic, exponential,…). Curve Fitting with functions

21 Curve Fitting with functions Examples of the functions:

22  Matlab must put the mentioned function in a linear form before using polyfit() : Curve Fitting with functions

23  What is the result? Help  Help: how can you estimate the function? Curve Fitting with functions

24  Example 3: Curve Fitting with functions

25  Example 3: Solution: Curve Fitting with functions First: you have to plot the points Since t (x-axis values) is linear, then we can guess that the exponential function may give a good fit

26  Example 3: Solution: Curve Fitting with functions Second: use polyfit() w = *exp( *t)

27  Example 3: Solution: Curve Fitting with functions w = *exp( *t)

Interpolation 28  Interpolation is the estimation of values between data points. MATLAB has interpolation functions that are based on polynomials, which are described here. And on Fourier transformation, but not discussed here.  One-dimensional interpolation:  If only two data points exist, the points can be connected with a straight line is and a linear equation (polynomial of first order) can be used to estimate values between the points.  As the number of points increases, a higher-order polynomial is required.

Interpolation 29  How does Matlab do it?  Instead of considering all the points in the data set (by using one polynomial that passes through all the points), only a few data points in the neighborhood where the interpolation is needed are considered. In this method, called spline interpolation, many low-order polynomials are used, where each is valid only in a small domain of the data set.

30 Interpolation

31 Interpolation  Example 4:

32 Interpolation  Example 4: Solution

33 Interpolation  Example 4: output:

Material & problems 34  We have covered (most of) Chapter 8 from Gilat.  Important self-reading: section 8.4  Problems you can try: Sample Problem 8-4 1—6, 14,15, 18,21,22