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

Slides:



Advertisements
Similar presentations
Polynomial Inequalities in One Variable
Advertisements

MATLAB BASICS ECEN 605 Linear Control Systems Instructor: S.P. Bhattacharyya.
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.
Fundamentals of Electric Circuits Chapter 14 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Feedback Control Systems Dr. Basil Hamed Electrical & Computer Engineering Islamic University of Gaza.
Chapter 10: Frequency Response Techniques 1 ©2000, John Wiley & Sons, Inc. Nise/Control Systems Engineering, 3/e Chapter 10 Frequency Response Techniques.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Laplace Transforms.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 19P. 1Winter Quarter MATLAB: Script and.
Control Systems Engineering, Fourth Edition by Norman S. Nise Copyright © 2004 by John Wiley & Sons. All rights reserved. Figure C-1 (p. 907) MATLAB window.
Review. Please Return Loan Clickers to the MEG office after Class! Today! FINAL EXAM: Wednesday December 8 8:00 AM to 10:00 a.m.
Poles and Zeros and Transfer Functions
Modeling in the Time Domain - State-Space
Digital Fundamentals Floyd Chapter 9 Tenth Edition
EE313 Linear Systems and Signals Fall 2010 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian L. Evans Dept. of Electrical.
The sampling of continuous-time signals is an important topic It is required by many important technologies such as: Digital Communication Systems ( Wireless.
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: First-Order Second-Order N th -Order Computation of the Output Signal.
Properties and the Inverse of
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
ECE 4115 Control Systems Lab 1 Spring 2005
System Function of discrete-time systems
Frequency Response OBJECTIVE - Bode and Nyquist plots for control analysis - Determination of transfer function - Gain and Phase margins - Stability in.
Control Systems Engineering, Fourth Edition by Norman S. Nise Copyright © 2004 by John Wiley & Sons. All rights reserved. Figure 11.1 Bode plots showing.
1 Z-Transform. CHAPTER 5 School of Electrical System Engineering, UniMAP School of Electrical System Engineering, UniMAP NORSHAFINASH BT SAUDIN
Modified by Albert W.J. Hsue,
1 Fourier Representation of Signals and LTI Systems. CHAPTER 3 School of Computer and Communication Engineering, UniMAP Hasliza A Samsuddin EKT.
ECE 4115 Control Systems Lab 1 Spring 2005 Chapter 1 System models.
Ch.10 Design of Digital Filters and Controllers Discretization The sampled signal x s (t) = x(t) p(t) where p(t) is the sampling pulse signal, with.
Frequency Response OBJECTIVE - Bode and Nyquist plots for control analysis - Determination of transfer function - Gain and Phase margins - Stability in.
MATLAB-Tutorial 2 Class ECES-304 Presented by : Shubham Bhat.
ES97H Biomedical Signal Processing
Simulink Simulink is a graphical extension to MATLAB for modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams.
On preserving passivity in sampled-data linear systems A Sysquake application to illustrate “On preserving passivity in sampled-data linear systems” Ramon.
Signals and Systems, 2/E by Simon Haykin and Barry Van Veen Copyright © 2003 John Wiley & Sons. Inc. All rights reserved. Figure 4.1 (p. 343) FS and FT.
Discretization of Continuous-Time State Space Models
Root Locus Techniques (Sketching Method) Date: 25 th September 2008 Prepared by: Megat Syahirul Amin bin Megat Ali
Fourier Representation of Signals and LTI Systems.
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.
Automatic Control By Dr. / Mohamed Ahmed Ebrahim Mohamed Web site:
CONTROL SYSTEM DESIGN by using MATLAB
State Space Models The state space model represents a physical system as n first order differential equations. This form is better suited for computer.
1 LTI Systems; Convolution September 4, 2000 EE 64, Section 1 ©Michael R. Gustafson II Pratt School of Engineering.
1 Fourier Representation of Signals and LTI Systems. CHAPTER 3 School of Computer and Communication Engineering, UniMAP Amir Razif B. Jamil Abdullah EKT.
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.
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.
EE611 Deterministic Systems Examples and Discrete Systems Descriptions Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
EE611 Deterministic Systems System Descriptions, State, Convolution Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Automatic control systems V. Discrete control
Discrete-Time Transfer Functions
ERT 210 DYNAMICS AND PROCESS CONTROL CHAPTER 11 – MATLAB TUTORIAL
Root Locus Techniques DNT Control Principle Date: 18th September 2008
Chapter 12 Design via State Space <<<4.1>>>
Lesson 15: Bode Plots of Transfer Functions
© Dr. Elmer P. Dadios - DLSU Fellow & Professor
CHAPTER 5 Z-Transform. EKT 230.
Digital and Non-Linear Control
Discrete-Time Transfer Functions
6. Nyquist Diagram, Bode Diagram, Gain Margin, Phase Margin,
Bode Plot Nafees Ahmed Asstt. Professor, EE Deptt DIT, DehraDun.
Fourier Transform September 27, 2000 EE 64, Section 1 ©Michael R. Gustafson II Pratt School of Engineering.
Control System Toolbox
Fundamentals of Electric Circuits Chapter 14
Modeling in the Time Domain
UNIVERSITI MALAYSIA PERLIS SCHOOL OF ELECTRICAL SYSTEM ENGINEERING
Control System Toolbox (Part-III)
ECEN 605 Linear Control Systems Instructor: S.P. Bhattacharyya
IntroductionLecture 1: Basic Ideas & Terminology
Presentation transcript:

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

Discrete-time (z-)transfer functions and state-space models are created in the same way as for continuous-time models. As an example, to create the transfer function Hdis(z)=(z+0.5)/(z *z+2) with sampling time 0.4 (time-units), we execute Discrete-time transfer functions numdis=[1,0.5]; dendis=[1,1.5,2]; Tsdis=0.4; Hdis=tf(numdis,dendis,Tsdis);

The function "tf" converts state-space models to a corresponding transfer function according to the formula(s) H(s)=C(sI-A) -1 B + D (continuous-time case) Hd(z)=Cd(zI-Ad) -1 Bd + Dd (discrete-time case) In the following example a continuous-time state-space model is converted to a corresponding (continuous-time) transfer function: From state-space model to transfer function A= -1; B=2; C=3; D=4; sscont1=ss(A,B,C,D); Hcont1=tf(sscont1)

% Nise, N.S. % Control Systems Engineering, 4th ed. % John Wiley & Sons, Hoboken, NJ, % (ch3p5): State-space representations can be converted to transfer functions % represented by a numerator and a denominator using [num,den] = ss2tf(A,B,C,D,iu), % '(ch3p5)' % Display label. 'Non LTI' % Display label. A=[0 1 0;0 0 1; ]; % Represent A. B=[7;8;9]; % Represent B. C=[2 3 4]; % Represent C. D=0; % Represent D. 'Ttf(s)' % Display label. [num,den]=ss2tf(A,B,C,D,1) % Convert state-space % representation to a % transfer function represented as % a numerator and denominator in % polynomial form, G(s)=num/den, % and display num and den. 'LTI‘ % Display label. Tss=ss(A,B,C,D) % Form LTI state-space model. 'Polynomial form, Ttf(s)' % Display label. Ttf=tf(Tss) % Transform from state space to % transfer function % in polynomial % form.

And in the following example a discrete-time state-space model is converted to a corresponding (discrete-time) transfer function (the sampling-time is 0.1): Ad=0.5; Bd=0.2; Cd=0.3; Dd=0.4; Ts=0.1; ssdis1=ss(Ad,Bd,Cd,Dd,Ts); Hdis1=tf(ssdis1) Discrete-time state-space to transfer function

A continuous-time LTI-model can be discretized using the function "c2d", using the syntax sysdis=c2d(syscont,Ts,method) Ts is the sampling time. method is a string telling which discretizing method to be used, and the following are available: 'zoh' for zero order hold. 'foh' for first order hold. 'tustin' for Tustin's method of bilinear transformation. 'prewarp' for Tustin's method with frequency prewarping. 'matched' for the matched pole-zero method. As an example, let us discretize a continuous-time model (transfer function) which contains a time-delay, assuming zero order hold: From discrete-time to continuous-time K=2; T=4; num=[K,0]; den=[T,1]; Tdelay=1; Hcont4=tf(num,den,'Td',Tdelay); Ts=0.2; Hdis4=c2d(Hcont4,Ts,'zoh')

A model can be thought of as a block with inputs and outputs and containing a transfer function or a state-space model inside it. The functions "series", "parallel", and "feedback" can be used to perform basic block-diagram manipulation, as demonstrated in the following. These functions apply to continuous-time models as well as discrete-time systems. As an example, assume given the following transfer functions: Ha(s)=1/(s+2) Hb(s)=3/(s+4) First, let us create the above two systems: Let us connect Ha(s) and Hb(s) in series, which means that Hser(s) becomes Ha(s)*Hb(s): Combining models (in series, parallel, and feedback) k1=1; k2=2; k3=3; k4=4; Ha=tf(k1,[1,k2]); Hb=tf(k3,[1,k4]); Hser=series(Ha,Hb)

We can simulate the step response of one or several LTI-models with "step". The input step is then a unit step (the step height is equal to one). Let us simulate both H1c and H1d from t=0 to Tfinal=10 time units: The resulting plot is not shown here in this text. We can store the simulated time response, y, and the time vector, t, by using return (or left) arguments: In this case, no plot will be shown on the screen. Note that only single systems can be simulated when you use left-hand arguments, as above, that is "[y,t]=step(H1c,H1d,Tf);" will not work. "impulse" simulates the impulse response: Simulation (time response) Tf=10; step(H1c,H1d,Tf) Tf=10; [y,t]=step(H1d,Tf); Tf=10; impulse(H1c,Tf)

% Nise, N.S. % Control Systems Engineering, 4th ed. % John Wiley & Sons, Hoboken, NJ, % % (ch4p3): We also can plot the step response of systems represented in state % space using the step(T,t) command. Here T is any LTI object and t = a:b:c is % the range for the time axis, where a is the initial time, b is the time step size, % and c is the final time. '(ch4p3)' % Display label. clf % Clear graph. A=[0 1 0;0 0 1; ]; % Generate A matrix. B=[0;0;1]; % Generate B vector. C=[2 7 1]; % Generate C vector. D=0; % Generate D. T=ss(A,B,C,D) % Generate LTI object, T, in state % space and display. t=0:0.1:10; % Define range of time for plot. step(T,t) % Plot step response for given % range of time. grid on % Turn grid on for plot

The frequency response of an LTI-model can be calculated with "bode". Here, "bode" shows the Bode-plots of both H1c and H1d, in the same diagram: The resulting plot is not shown here in this text. Using the syntax [mag,phase,w]=bode(sys) the magnitude and the phase (in degrees), and the frequency vector (in rad/s) used by "bode", are returned. With "bode(sys,w)" the Bode-plot will be drawn using our own frequency vector, w. Frequency response bode(H1c,H1d) n1=[1]; d1=[1,2,4]; H1=tf(n1,d1); [mag,phase,w]=bode(H1); semilogx(w,mag(:)); set(gca,'xtick',[.1,.2,.5,1,2,5,10]); set(gca,'ytick',[0:0.05:0.4]); grid