ECEN Automatic Control Systems Introduction and Control Basics

Slides:



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

ECEN/MAE 3723 – Systems I MATLAB Lecture 3.
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
ECEN/MAE 3723 – Systems I MATLAB Lecture 1. Lecture Overview  Introduction and History  Matlab architecture  Operation basics  Visualization  Programming.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/22/2003.
1 ECEN Automatic Control Systems Matlab Lecture 1 Introduction and Control Basics Presented by Moayed Daneshyari OKLAHOMA STATE UNIVERSITY.
Introduction to MATLAB MECH 300H Spring Starting of MATLAB.
Introduction to Matlab Jianguo Wang CSSCR September 2009.
Automatic Control System
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
ENSC 383- Feedback Control Summer 2010 TAs:Kaveh Kianfar, Esmaeil Tafazzoli G(s) U(s) inputY(s) output MATLAB Tutorial 1.
A L I MAM M OHAMMAD B IN S AUD I SLAMIC U NIVERSITY C OLLEGE OF S CIENCES D EPARTMENT OF M ATHEMATICS MATLAB 251 : MATH SOFTWARE Introduction to MATLAB.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
A Brief Introduction to Matlab Laila Guessous Dept. of Mechanical Engineering Oakland University.
EECE 360/460 Matlab Tutorial Jan Outline What is Matlab? What is Matlab? Matlab Interface Matlab Interface Basic Syntax Basic Syntax Plotting Graphs.
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
ECE 4115 Control Systems Lab 1 Spring 2005
Modified by Albert W.J. Hsue,
ECE 4115 Control Systems Lab 1 Spring 2005 Chapter 1 System models.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Chapter 4 Transfer Function and Block Diagram Operations § 4.1 Linear Time-Invariant Systems § 4.2 Transfer Function and Dynamic Systems § 4.3 Transfer.
MATLAB-Tutorial 2 Class ECES-304 Presented by : Shubham Bhat.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Introduction to Matlab Patrice Koehl Department of Biological Sciences National University of Singapore
DEPARTMENT OF MECHANICAL TECHNOLOGY VI -SEMESTER AUTOMATIC CONTROL 1 CHAPTER NO.6 State space representation of Continuous Time systems 1 Teaching Innovation.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
Variable-Frequency Response Analysis Network performance as function of frequency. Transfer function Sinusoidal Frequency Analysis Bode plots to display.
Inverse Laplace Transform. Laplace Transform of derivatives.
State Space Models The state space model represents a physical system as n first order differential equations. This form is better suited for computer.
Transfer Functions Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: The following terminology.
Matlab Programming for Engineers
John Federici NJIT Physics Department
Automatic Control Theory CSE 322
MESB374 System Modeling and Analysis Transfer Function Analysis
Modeling and Simulation Dr. Mohammad Kilani
Release Numbers MATLAB is updated regularly
Lesson 15: Bode Plots of Transfer Functions
Laplace Transforms Chapter 3 Standard notation in dynamics and control
© Dr. Elmer P. Dadios - DLSU Fellow & Professor
Chapter 4 Transfer Function and Block Diagram Operations
Introduction to Matlab
Lecture 25.
Lecture: MATLAB Chapter 1 Introduction
Introduction to MATLAB
Lecture 3: Solving Diff Eqs with the Laplace Transform
ME375 Handouts - Fall 2002 MESB374 Chapter8 System Modeling and Analysis Time domain Analysis Transfer Function Analysis.
Outline Matlab tutorial How to start and exit Matlab Matlab basics.
MATLAB DENC 2533 ECADD LAB 9.
Joseph L. Hellerstein IBM Thomas J Watson Research Center, NY
Control System Toolbox
MATH 493 Introduction to MATLAB
Use of Mathematics using Technology (Maltlab)
Lecture 2 Introduction to MATLAB
Plotting Data with MATLAB
Tutorial 2 SEG7550 Introduction to MATLAB II
1 ECEN Automatic Control Systems Matlab Lecture 1 Introduction and Control Basics Presented by Moayed Daneshyari OKLAHOMA STATE UNIVERSITY.
Hanani binti Abdul Wahab 24 September 2008
Introduction to MATLAB
CSCI N317 Computation for Scientific Applications Unit 1 – 1 MATLAB
دکتر حسين بلندي- دکتر سید مجید اسما عیل زاده
Chapter 8. Frequency-Domain Analysis
Using Script Files and Managing Data
Root Locus Plot of Dynamic Systems
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.
Control System Toolbox (Part-II)
Chapter 2. Mathematical Foundation
Control System Toolbox (Part-III)
ECEN 605 Linear Control Systems Instructor: S.P. Bhattacharyya
Control System Toolbox (Part-II)
The Frequency-Response Design Method
Presentation transcript:

ECEN 4413 - Automatic Control Systems Introduction and Control Basics OKLAHOMA STATE UNIVERSITY ECEN 4413 - Automatic Control Systems Matlab Lecture 1 Introduction and Control Basics Presented by Moayed Daneshyari

What is Matlab? Invented by Cleve Moler in late 1970s to give students access to LINPACK and EISPACK without having to learn Fortran. Together with Jack Little and Steve Bangert they founded Mathworks in 1984 and created Matlab. The current version is 7. Interpreted-code based system in which the fundamental element is a matrix.

The Interface Workspace and Launch Pad Command Window Command History Current Directory

Variable assignment Scalar: a = 4 Vector: v = [3 5 1] v(2) = 8 Matrix: m = [1 2 ; 3 4] m(1,2)=0

Basic Operations Scalar expressions b = 10 / ( sqrt(a) + 3 ) c = cos (b * pi) Matrix expressions n = m * [1 0]’

Useful matrix operations Determinant: det(m) Inverse: inv(m) Rank: rank(m) i by j matrix of zeros: m = zeros(i,j) i by j matrix of ones: m = ones(i,j) i by i identity matrix: m = eye(i)

Example Generate and plot a cosine function x = [0:0.01:2*pi]; y = cos(x); plot(x,y)

Example Adding titles to graphs and axis title(‘this is the title’) xlabel(‘x’) ylabel(‘y’)

Adding graphs to reports Three options: 1) Print the figure directly 2) Save it to a JPG / BMP / TIFF file and add to the report (File → Export…) 3) Copy to clipboard and paste to the report (Edit → Copy Figure) * * The background is copied too! By default it is gray. To change the background color use: set(gcf,’color’,’white’)

The .m files Programming in Matlab is done by creating “.m” files. File → New → M-File Useful for storing a sequence of commands or creating new functions. Call the program by writing the name of the file where it is saved (check the “current directory”) “%” can be used for commenting.

Other useful information help <function name> displays the help for the function ex.: help plot helpdesk brings up a GUI for browsing very comprehensive help documents save <filename> saves everything in the workspace (all variables) to <filename>.mat. load <filename> loads the file.

Using Matlab to create models Why model? - Represent - Analyze What kind of systems are we interested? - Single-Input-Single-Output (SISO) Linear Time Invariant (LTI) Continuous G(s) Y(s) X(s)

Model representations Three Basic types of model representations for continuous LTI systems: Transfer Function representation (TF) Zero-Pole-Gain representation (ZPK) State Space representation (SS) ! More help is available for each model representation by typing: help ltimodels

Transfer Function representation Given: Matlab function: tf Method (a) Method (b) num = [0 0 25]; den = [1 4 25]; G = tf(num,den) s = tf('s'); G = 25/(s^2 +4*s +25)

Zero-Pole-Gain representation Given: Matlab function: zpk zeros = [1]; poles = [2-i 2+i]; gain = 3; H = zpk(zeros,poles,gain)

State Space representation Given: , Matlab function: ss A = [1 0 ; -2 1]; B = [1 0]’; C = [3 -2]; D = [0]; sys = ss(A,B,C,D)

System analysis Once a model has been introduced in Matlab, we can use a series of functions to analyze the system. Key analyses at our disposal: 1) Stability analysis e.g. pole placement 2) Time domain analysis e.g. response to different inputs 3) Frequency domain analysis e.g. bode plot

Stability analysis Is the system stable? Recall: All poles of the system must be on the right hand side of the S plain for continuous LTI systems to be stable. Manually: Poles are the roots for the denominator of transfer functions or eigen values of matrix A for state space representations In Matlab: pole(sys)

Time domain analysis Once a model has been inserted in Matlab, the step response can be obtained directly from: step(sys) Unit Step Response of G(s) Time (sec) Amplitude 0.5 1 1.5 2 2.5 3 0.2 0.4 0.6 0.8 1.2 1.4 Peak Time Rise Time Steady State Settling Time overshoot

Time domain analysis Matlab also caries other useful functions for time domain analysis: Impulse response impulse(sys) Response to an arbitrary input e.g. t = [0:0.01:10]; u = cos(t); lsim(sys,u,t) ! It is also possible to assign a variable to those functions to obtain a vector with the output. For example: y = impulse(sys);

Frequency domain analysis Bode plots can be created directly by using: bode(sys)

Frequency domain analysis For a pole and zero plot: pzmap(sys)

Extra: partial fraction expansion Given: num=[2 3 2]; den=[1 3 2]; [r,p,k] = residue(num,den) r = -4 1 p = -2 -1 k = 2 Answer: