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.

Slides:



Advertisements
Similar presentations
Laplace Transform Math Review with Matlab:
Advertisements

The Inverse Laplace Transform
LAPLACE TRANSFORMS.
MATLAB BASICS ECEN 605 Linear Control Systems Instructor: S.P. Bhattacharyya.
ECEN/MAE 3723 – Systems I MATLAB Lecture 3.
Chapter 6: Roots: Open Methods
Part 2 Chapter 6 Roots: Open Methods
259 Lecture 17 Working with Data in MATLAB. Overview  In this lecture, we’ll look at some commands that are useful for working with data!  fzero  sum,
H(s) x(t)y(t) 8.b Laplace Transform: Y(s)=X(s) H(s) The Laplace transform can be used in the solution of ordinary linear differential equations. Let’s.
1 1 Eng. Mohamed Eltaher Eng.Ahmed Ibrahim. 2 2 Exercise (1)  Solve the following set of equations using MATLAB x 1 + 2x 2 + 3x 3 + 5x 4 = 21 – 2x 1.
AMI 4622 Digital Signal Processing
Lecture 141 EEE 302 Electrical Networks II Dr. Keith E. Holbert Summer 2001.
EE-2027 SaS, L13 1/13 Lecture 13: Inverse Laplace Transform 5 Laplace transform (3 lectures): Laplace transform as Fourier transform with convergence factor.
Matlab Matlab is a powerful mathematical tool and this tutorial is intended to be an introduction to some of the functions that you might find useful.
Part 4 Chapter 13 Linear Regression
Transient and steady state response (cont.)
The ‘PLOT’ Command (1) >> X = linspace(0, 2*pi, 30); >> Y = sin(X); >> plot(X,Y) >> Z = cos(X); >> plot(X,Y,X,Z);
Concept of Transfer Function Eng. R. L. Nkumbwa Copperbelt University 2010.
Numerical Operations S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: Polynomial Manipulations.
Matlab intro The Environment
THE LAPLACE TRANSFORM LEARNING GOALS Definition The transform maps a function of time into a function of a complex variable Two important singularity functions.
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
Properties of the z-Transform
Properties and the Inverse of
Introduction to MATLAB for Engineers, Third Edition Chapter 6 Model Building and Regression PowerPoint to accompany Copyright © The McGraw-Hill Companies,
ENSC 383- Feedback Control Summer 2010 TAs:Kaveh Kianfar, Esmaeil Tafazzoli G(s) U(s) inputY(s) output MATLAB Tutorial 1.
MESB 374 System Modeling and Analysis Inverse Laplace Transform and I/O Model.
MATLAB Basics. The following screen will appear when you start up Matlab. All of the commands that will be discussed should be typed at the >> prompt.
ECE 8443 – Pattern Recognition ECE 3163 – Signals and Systems Objectives: Modulation Summation Convolution Initial Value and Final Value Theorems Inverse.
Advanced Topics- Polynomials
Partial-fraction Expansion
ECE 4115 Control Systems Lab 1 Spring 2005
The Hong Kong Polytechnic University Industrial Centre 1 MatLAB Lesson 4 : Polynomial Edward Cheung Room W311g 2008.
Solving DEs etc. Laplace transforming derivatives Etc.
1 Inverse Laplace Transform Note that most of the transforms are written as fractions.
Rational Transforms Consider the problem of finding the inverse Laplace transform for: where {ai} and {bi} are real numbers, and M and N are positive.
ES 240: Scientific and Engineering Computation. Chapter 13: Linear Regression 13. 1: Statistical Review Uchechukwu Ofoegbu Temple University.
Continuing with Integrals of the Form: & Partial Fractions Chapter 7.3 & 7.4.
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.
LINEAR ALGEBRA Matrix analysis Linear equations Eigenvalues and singular values Matrix functions.
Z TRANSFORM AND DFT Z Transform
MATLAB-Tutorial 2 Class ECES-304 Presented by : Shubham Bhat.
THE LAPLACE TRANSFORM LEARNING GOALS Definition
ES97H Biomedical Signal Processing
Digital Signal Processing
Polynomials, Curve Fitting and Interpolation. In this chapter will study Polynomials – functions of a special form that arise often in science and engineering.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
Inverse Laplace Transforms (ILT)
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Lecture 4: The z-Transform 1. The z-transform The z-transform is used in sampled data systems just as the Laplace transform is used in continuous-time.
1 Lecture 8 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Properties of the z-Transform
EEE 244-3: MATRICES AND EQUATION SOLVING
Polynomial Long Division Review
Introduction to Programming for Mechanical Engineers
LAPLACE TRANSFORMS.
Lec 4. the inverse Laplace Transform
H(s) 8.b Laplace Transform:
© Dr. Elmer P. Dadios - DLSU Fellow & Professor
Salinity Calibration fit with MATLAB
3.1 Introduction Why do we need also a frequency domain analysis (also we need time domain convolution):- 1) Sinusoidal and exponential signals occur.
Lecture 3: Solving Diff Eqs with the Laplace Transform
Chapter 5 Integral Transforms and Complex Variable Functions
Lecture 10 2D plotting & curve fitting
Z TRANSFORM AND DFT Z Transform
Chapter 4. Time Response I may not have gone where I intended to go, but I think I have ended up where I needed to be. Pusan National University Intelligent.
EEE 244-3: MATRICES AND EQUATION SOLVING
Curve Fitting in Matlab
THE LAPLACE TRANSFORM LEARNING GOALS Definition
Presentation transcript:

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 list, brief descriptions, and links to reference pages, type: >> help polyfun The following table lists the MATLAB polynomial functions. FunctionDescription conv Multiply polynomials deconv Divide polynomials poly Polynomial with specified roots polyder Polynomial derivative polyfit Polynomial curve fitting polyval Polynomial evaluation polyvalm Matrix polynomial evaluation residue Partial-fraction expansion (residues) roots Find polynomial roots Eng. Mohamed El-Taher Eng. Ahmed Ibrahim

3 2.REPRESENTING POLYNOMIALS  MATLAB software represents polynomials as row vectors containing coefficients ordered by descending powers. For example, consider the equation  This is the celebrated example Wallis used when he first represented Newton's method to the French Academy. To enter this polynomial into MATLAB, use p = [ ];

4 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim 3.EVALUATING POLYNOMIALS  The polyval function evaluates a polynomial at a specified value. To evaluate p at s = 5, use >>polyval(p,5) ans = 110  It is also possible to evaluate a polynomial in a matrix sense. In this case becomes, where X is a square matrix and I is the identity matrix. For example, create a square matrix X and evaluate the polynomial p at X: >> X = [2 4 5; ; 7 1 5]; >> Y = polyvalm(p,X) Y=

5 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim 4.ROOTS roots  The roots function calculates the roots of a polynomial: >>r = roots(p) r = i i poly  By convention, the MATLAB software stores roots in column vectors. The function poly returns to the polynomial coefficients:: >> p2 = poly(r) >> p2 = e  poly and roots are inverse functions.

6 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim 5.DERIVATIVES polyder  The polyder function computes the derivative of any polynomial. To obtain the derivative of the polynomial p = [ ], >> q = polyder(p) q =  polyder also computes the derivative of the product or quotient of two polynomials. For example, create two polynomials a and b: >> a = [1 3 5]; >> b = [2 4 6];  Calculate the derivative of the product a*b by calling polyder with a single output argument: >> c = polyder(a,b) >> c =

7 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim polyder  Calculate the derivative of the quotient a/b by calling polyder with two output arguments: >> [q,d] = polyder(a,b) q = d = Where q/d is the result of the operation.

8 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim 6.CONVOLUTION conv deconv  Polynomial multiplication and division correspond to the operations convolution and deconvolution. The functions conv and deconv implement these operations.  Consider the polynomials and To compute their product, >> a = [1 2 3]; b = [4 5 6]; >> c = conv(a,b) c =

9 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  Use deconvolution to divide back out of the product: >> [q,r] = deconv(c,a) q = r =

10 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim 7.LAPLACE TRANSFORM  Consider the transfer function  The numerator vector : Num=[b0b1..bn]  The denominator vector: dem=[1a1..an]  The command : [r,p,k]=residue (num,den)  The partial fraction expansion is given by  Where r : residue, p : poles of the system and k :direct terms of partial fraction 7.1 Partial fraction expansions

11 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  Consider the transfer function >> b = [-4 8]; a = [1 6 8]; [r,p,k] = residue(b,a) r = p = k = []

12 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  Given three input arguments (r, p, and k), residue converts back to polynomial form: >> [num,den] = residue(r,p,k) b2 = -4 8 a2 =  The command printsys (num,den,‘s’) prints the num/den in terms of the ratio of polynomials in s. num/den = -4 s s^2 + 6 s + 8

13 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  The command ilaplace will find the inverse Laplace transform of a Laplace function. -4 s + 8 F(s) = s^2 + 6 s + 8 >> syms s >> f=(-4*s+8)/(s^2+6*s+8) f = -(4*s - 8)/(s^2 + 6*s + 8) >> ilaplace(f) ans = 8/exp(2*t) - 12/exp(4*t) >> pretty (ans) exp(2 t) exp(4 t)

14 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  Consider the transfer function  The MATLAB command [z,p,k] = tf2zp(num,dem) is used to find the zeros, poles, and gain K of B(s)/A(s).  If the zeros, poles, and gain K are given, the following MATLAB command can be used to find the original num/den: [num,den] = zp2tf (z,p,k) 7.2 Finding zeros and poles of B(s)/A(s)

15 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  Given three input arguments (r, p, and k), residue converts back to polynomial form: >> [num,den] = residue(r,p,k) b2 = -4 8 a2 =  The command printsys (num,den,‘s’) prints the num/den in terms of the ratio of polynomials in s. num/den = -4 s s^2 + 6 s + 8

16 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim 8.Polynomial Curve Fitting  polyfit finds the coefficients of a polynomial that fits a set of data in a least-squares sense: p = polyfit(x,y,n) p = polyfit(x,y,n) x and y are vectors containing the x and y data to be fitted, and n is the degree of the polynomial to return.  For example, consider the x-y test data >> x = [ ]; >> y = [ ]; A third degree polynomial that approximately fits the data is >> p = polyfit(x,y,3) p =

17 Eng. Mohamed El-Taher Eng. Ahmed Ibrahim  Compute the values of the polyfit estimate over a finer range, and plot the estimate over the real data values for comparison: >> x2 = 1:.1:5; >> y2 = polyval(p,x2); >> plot(x,y,'o',x2,y2) >> grid on