MATLAB-Tutorial 2 Class ECES-304 Presented by : Shubham Bhat.

Slides:



Advertisements
Similar presentations
MATLAB BASICS ECEN 605 Linear Control Systems Instructor: S.P. Bhattacharyya.
Advertisements

STATE SPACE MODELS MATLAB Tutorial.
ECEN/MAE 3723 – Systems I MATLAB Lecture 3.
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.
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.
AMI 4622 Digital Signal Processing
EE-2027 SaS, L13 1/13 Lecture 13: Inverse Laplace Transform 5 Laplace transform (3 lectures): Laplace transform as Fourier transform with convergence factor.
Transfer Functions Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: The following terminology.
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.
Multivariable Control Systems
1 ECEN Automatic Control Systems Matlab Lecture 1 Introduction and Control Basics Presented by Moayed Daneshyari OKLAHOMA STATE UNIVERSITY.
Modeling in the Time Domain - State-Space
Digital Control Systems
Simplifying Rational Expressions.
MATLAB-Tutorial 3 Class ECES-304 Presented by : Shubham Bhat.
Chapter 9 Introduction to MATLAB for Engineers, Third Edition
ENGR-25_Arrays-2.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
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.
4.6 Cramer’s Rule Using Determinants to solve systems of equations.
Copyright © 2010 Pearson Education, Inc. All rights reserved Sec
Rational Expressions rational expression: quotient of two polynomials x2 + 3x x + 2 means (x2 + 3x - 10) ÷ (3x + 2) restrictions: *the denominator.
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.
Advanced Topics- Polynomials
Adding & Subtracting Rational Expressions. Vocabulary Rational Expression Rational Expression - An expression that can be written as a ratio of 2 polynomials.
Notes Over 9.4 Simplifying a Rational Expression Simplify the expression if possible. Rational Expression A fraction whose numerator and denominator are.
Partial-fraction Expansion
ECE 4115 Control Systems Lab 1 Spring 2005
Factor Each Expression Section 8.4 Multiplying and Dividing Rational Expressions Remember that a rational number can be expressed as a quotient.
Solving DEs etc. Laplace transforming derivatives Etc.
Section 9-3a Multiplying and Dividing Rational Expressions.
1 Inverse Laplace Transform Note that most of the transforms are written as fractions.
Modified by Albert W.J. Hsue,
SECTION 2 MULTIPLYING AND DIVIDING RATIONAL FUNCTIONS CHAPTER 5.
Mathematical Models and Block Diagrams of Systems Regulation And Control Engineering.
ECE 4115 Control Systems Lab 1 Spring 2005 Chapter 1 System models.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Boyce/DiPrima 9 th ed, Ch 6.2: Solution of Initial Value Problems Elementary Differential Equations and Boundary Value Problems, 9 th edition, by William.
Lecture 7: State-Space Modeling 1.Introduction to state-space modeling Definitions How it relates to other modeling formalisms 2.State-space examples 3.Transforming.
Simplify, Multiply & Divide Rational Expressions.
Chapter 11 Digital Control Systems
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
To simplify a rational expression, divide the numerator and the denominator by a common factor. You are done when you can no longer divide them by a common.
CONTROL SYSTEM DESIGN by using MATLAB
Inverse Laplace Transform. Laplace Transform of derivatives.
Control Systems Engineering, Fourth Edition by Norman S. Nise Copyright © 2004 by John Wiley & Sons. All rights reserved. Figure 10.1 The HP 35670A Dynamic.
Products and Factors of Polynomials (part 2 of 2) Section 440 beginning on page 442.
Signals and Systems, 2/E by Simon Haykin and Barry Van Veen Copyright © 2003 John Wiley & Sons. Inc. All rights reserved. Figure 9.1 (p. 664) Two different.
Simplifying. Multiplying and Dividing Rational Expressions Remember that a rational number can be expressed as a quotient of two integers. A rational.
EE611 Deterministic Systems Examples and Discrete Systems Descriptions Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Chapter 6 Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter 6-1 Rational Expressions and Equations.
Root Locus Techniques DNT Control Principle Date: 18th September 2008
© Dr. Elmer P. Dadios - DLSU Fellow & Professor
자동제어 3강: 라플라스 역변환 강의실 : 산107 담당교수 : 고경철(기계공학부) 사무실 : 산학협력관 105B
Apply Exponent Properties Involving Quotients
Rational expressions 8.11.
Copyright © 2008 Pearson Education, Inc
Using Determinants to solve systems of equations
Lecture 3: Solving Diff Eqs with the Laplace Transform
ECEN Automatic Control Systems Introduction and Control Basics
Without a calculator, simplify the expressions:
Warm-Up (Fractions) Calculator Free. [1] [2] [3] [4]
1 ECEN Automatic Control Systems Matlab Lecture 1 Introduction and Control Basics Presented by Moayed Daneshyari OKLAHOMA STATE UNIVERSITY.
Communication and Coding Theory Lab(CS491)
ECEN 605 Linear Control Systems Instructor: S.P. Bhattacharyya
Roots, Radicals, and Root Functions
Presentation transcript:

MATLAB-Tutorial 2 Class ECES-304 Presented by : Shubham Bhat

% Nise, N.S. % Control Systems Engineering, 4th ed. % John Wiley & Sons, Hoboken, NJ, % % Control Systems Engineering Toolbox Version 4.0 % Copyright © 2004 by John Wiley & Sons, Inc. % % (ch2p8) Example 2.3: Let us do Example 2.3 in the book using MATLAB. '(ch2p8) Example 2.3' % Display label. numy=32; % Define numerator. deny=poly([ ]); % Define denominator. [r,p,k] = residue(numy,deny) % Calculate residues, poles, and % direct quotient.

The models supported by CST are continuous-time models and discrete-time models of the following types: transfer functions state-space models Creating and handling LTI-models (Linear Time-Invariant)

We will start with continuous-time models, and then take discrete-time models. Continuous-time transfer functions The function "tf" creates transfer functions. "tf" needs two MATLAB-vectors, one containing the coefficients of the numerator polynomial - taken in descending orders - and one for the denominator polynomial of the transfer function. As an example we will create the transfer function H0(s)=K0*s/(T0*s+1) Creating models K0=2; T0=4; num0=[K0,0]; den0=[T0,1]; H0=tf(num0,den0);

'(ch2p9)' % Display label. 'Vector Method, Polynomial Form' % Display label. numf=150*[1 2 7] % Store 150(s^2+2s+7) in numf and % display. denf=[ ] % Store s(s+1)(s+4) in denf and % display. 'F(s)' % Display label. F=tf(numf,denf) % Form F(s) and display. clear % Clear previous variables from workspace. % Nise, N.S. % Control Systems Engineering, 4th ed. % John Wiley & Sons, Hoboken, NJ, % % Control Systems Engineering Toolbox Version 4.0 % Copyright © 2004 by John Wiley & Sons, Inc. % % (ch2p9): Creating Transfer Functions % (1) Vector Method, Polynomial Form: % A transfer function can be expressed as a numerator polynomial divided by a % denominator polynomial, i.e. F(s) = N(s)/D(s).

'Vector Method, Factored Form' % Display label. numg=[-2 -4] % Store (s+2)(s+4) in numg and % display. deng=[ ] % Store (s+7)(s+8)(s+9) in deng and % display. K=20 % Define K. 'G(s)' % Display label. G=zpk(numg,deng,K) % Form G(s) and display. clear % Clear previous variables from % workspace.

The function "ss" creates linear state-space models having the form dx/dt=Ax + Bu ; y=Cx + Du As illustrated in the following example: Given the following state-space model: dx1/dt=x2 ; dx2/dt=-4*x1 -2*x2 + 2*u; y=x1 This model is created by To retrieve the system parameters and give them specific names, we can execute Continuous-time state-space models A=[0,1;-4,-2]; B=[0;2]; C=[1,0]; D=[0]; ss1=ss(A,B,C,D); [A1,B1,C1,D1,Ts]=ssdata(ss1)

% Nise, N.S. % Control Systems Engineering, 4th ed. % John Wiley & Sons, Hoboken, NJ, % % Control Systems Engineering Toolbox Version 4.0 % Copyright © 2004 by John Wiley & Sons, Inc. % % (ch3p3): The state-space representation consists of specifying the A, B, C, and % D matrices followed by the creation of an LTI state-space object using the MATLAB % command, ss(A,B,C,D). Hence, for the matrices in (ch3p1) and (ch3p2), the % state-space representation would be: '(ch3p3)' % Display label. A=[0 1 0;0 0 1; ]; % Represent A. B=[7;8;9]; % Represent column vector B. C=[2 3 4]; % Represent row vector C. D=0; % Represent D. F=ss(A,B,C,D) % Create an LTI object and display.

Homework Problems % 13. Find the ratio of factors and ratio of polynomials ‘Polynomial form’ Gtf=tf([ ],[ ]) ‘Factored Form’ Gzpk=zpk(Gtf) % 14. Generate partial fractions numg=[ ]; deng=[ (roots([ ]))’ (roots([1 6 90]))’]; [numg,deng]=zp2tf(numg’,deng’,1e4); Gtf=tf(numg,deng); G=zpk(Gtf); [r,p,k]=residue(numg,deng);

Homework Problems % 10. Write the transfer function in phase variable form ‘a’ Num=100; Den=[ ]; G=tf(num,den) [Acc,Bcc,Ccc,Dcc]=tf2ss(num,den); Af=flipud(Acc); A=fliplr(Af) B=flipud(Bcc) C=fliplr(Ccc)