American International University- Bangladesh Faculty of Engineering (EEE) Control Systems Laboratory

Size: px
Start display at page:

Download "American International University- Bangladesh Faculty of Engineering (EEE) Control Systems Laboratory"

Transcription

1 Experiment 1 American International University- Bangladesh Faculty of Engineering (EEE) Control Systems Laboratory Title: Introduction to design and simulation of open loop and close loop control systems using a Computer Aided Design (CAD) tool---matlab. Abstract: This experiment introduces students to the widely used simulation software MATLAB and how it is used to describe control system related problems and functions. It shows a few basic techniques such as - 1. Creating polynomial functions, finding roots of a polynomial function, evaluating polynomials, calculating product of two polynomial functions in MATLAB. 2. Obtaining overall transfer functions of open loop and close loop control systems. 3. Observing the step responses of open-loop and closed-loop control systems. Introduction: The objectives of this experiment are to complete the above mentioned tasks with the knowledge of using all the commands associated with the tasks. Basic mathematical skills such as Laplace transformation in control system and understanding of open loop and close loop systems and their differences is necessary for this experiment. As all the tasks are associated with MATLAB, some basic commands and their various uses along with some user guideline for this software is necessary. This entire experiment is based on MATLAB codes in 3 groups. First group of code shows polynomial and its mathematical manipulation, second group shows a simulation of open loop control system and the third group of codes shows a simulation of close loop control system. Doing these in MATLAB allows a accurate solution for students instead doing them using mathematically. It shows them another way of doing these tasks and it saves time. Basic parameters used in MATLAB: Table 1: Managing workspace and file commands

2 Command cd clc clear (all) clear x copyfile delete dir exist help lookfor mkdir movefile pwd rmdir type what which who whos Description Change current directory Clear the Command Window Removes all variables from the workspace Remove x from the workspace Copy file or directory Delete files Display directory listing Check if variables or functions are defined Display help for MATLAB functions Search for specified word in all help entries Make new directory Move file or directory Identify current directory Remove directory Display contents of file List MATLAB files in current directory Locate functions and files Display variables currently in the workspace Display information on variables in the workspace Table 2: Elementary matrices and arrays Command eye linspace ones rand zeros Description Identity matrix Generate linearly space vectors Create array of all ones Uniformly distributed random numbers and arrays Create array of all zeros Table 3: Arrays and Matrices: Basic information Command disp isempty isequal length ndims numel size Description Display text or array Determine if input is empty matrix Test arrays for equality Length of vector Number of dimensions Number of elements Size of matrix

3 Precautions: Make sure that all the m-files are saved in the current directory of MATLAB. Otherwise, the m-files will not be found and executed when they are called from the command window. Theory and Methodology: A combination of components that act together is called system. There are two types of systems- open loop and close loop control systems. Systems in which the output quantity has no effect on the input quantity are open-loop control systems. A generic open-loop system is shown in Fig. 1.1 below. Fig. 1.1: Block diagram of an Open-Loop System The input transducer converts the input into the form that is used by the controller. The controller then drives a process or plant. Other signals such as disturbances are added to the controller and process outputs via summing junctions. The drawback of open-loop system is that it cannot compensate for any disturbances that add to the controller driving signal or the output. Systems in which the output quantity has an effect upon the input quantity---primarily to maintain the desired output value---are close-loop control systems. In close loop control systems feedback of the output quantity is a must. The unit that provides the means for feeding back the output quantity or a function of the output to compare it with the reference input is called a feedback element. The block diagram of closed-loop system is given in fig The output transducer or sensor measures the output response and converts it into the form used by the controller. The first summing junction algebraically adds the signal from the input to the signal from the output, which arrives via the feedback path. The result from this is generally called error signal or actuating signal. If the output signal is directly compared with the reference input then this type of closed-loop system is called a unity feedback system. If a portion of the output signal is compared with the reference input signal then this type of closed-loop system is called a non-unity feedback system. Fig. 1.2: Block diagram of Closed-Loop System

4 The advantage of closed-loop system over open-loop system is that, it can compensate for the disturbance by measuring the output response, feeding the measurement back through a feedback path and comparing that response to the input at the summing junction. Closed-loop systems are less sensitive to noise, disturbances and changes in the environment. In the 1960s, control engineers turned to linear algebra techniques of state space modeling for these systems. The matrix-based mathematics of state space analysis and design drove the need for more sophisticated computer analysis. C. B. Moler of the University of New Mexico wrote an interactive program called MATLAB. The introduction of MATLAB was a phenomenal success, as it revolutionized computer-aided analysis and design of control systems. Open loop control system block diagram: The transfer unction for open loop - Ge(s) = C(s)/R(s) Close loop control system block diagram: Closed-loop, transfer function shown in the Figure right below,

5 The product, G(s)H(s), in equation is called the open-loop transfer function, or loop gain. POLYVAL means Evaluate polynomial. Y = POLYVAL(P,X) returns the value of a polynomial P evaluated at X. P is a vector of length N+1 whose elements are the coefficients of the polynomial in descending powers. Y = P(1)*X^N + P(2)*X^(N-1) P(N)*X + P(N+1) PRINTSYS Print system in pretty format. PRINTSYS is used to print state space systems with labels to the right and above the system matrices or to print transfer functions as a ratio of two polynomials. ROOTS Find polynomial roots. ROOTS(C) computes the roots of the polynomial whose coefficients are the elements of the vector C. If C has N+1 components, the polynomial is C(1)*X^N C(N)*X + C(N+1). POLY Convert roots to polynomial. POLY(A), when A is an N by N matrix, is a row vector with N+1 elements which are the coefficients of the characteristic polynomial, DET(lambda*EYE(SIZE(A)) - A). POLY(V), when V is a vector, is a vector whose elements are the coefficients of the polynomial whose roots are the elements of V. For vectors, ROOTS and POLY are inverse functions of each other, up to ordering, scaling, and roundoff error. CONV Convolution and polynomial multiplication. C = CONV(A, B) convolves vectors A and B. The resulting vector is length LENGTH(A)+LENGTH(B)-1. If A and B are vectors of polynomial coefficients, convolving them is equivalent to multiplying the two polynomials. STEP Step response of LTI models. STEP(SYS) plots the step response of the LTI model SYS (created with either TF, ZPK, or SS). For multi-input models, independent step commands are applied to each input channel. The time range and number of points are chosen automatically. [Y,T,X] = STEP(SYS) also returns, for a state-space model SYS, the state trajectory X, a LT-by- NX-by-NU array if SYS has NX states. FEEDBACK Feedback connection of two LTI models. SYS = FEEDBACK(SYS1,SYS2) computes an LTI model SYS for the closed-loop feedback system Negative feedback is assumed and the resulting system SYS maps u to y. To apply positive feedback, use the syntax SYS = FEEDBACK(SYS1,SYS2,+1).

6 p1=[ ] means defining the function pl = s 3 + 0s 2 + 5s 1 + 6s 0 The row vector is defined in left to right descending order. using polyval, putting s=1; pl is evaluated = (1) + 6 = 12 roots of pl = s 3 + 0s 2 + 5s + 6 = s(s+2)(s+3) For open loop, overshoot is somewhat and steady state value has reached after 1.5 seconds

7 For close loop, overshoot is somewhat (reduced in comparison to open loop) and steady state value has reached before 1.5 seconds Pre lab homework: Students should study - 1. Laplace transform and its mathematical manipulations, 2. Basic idea and block diagram of control systems, 3. Basic idea and block diagram of open loop control system, 4. Basic idea and block diagram of close loop control system. Equipments : Computer Precautions: Students should take the following precautions while conducting the experiment - 1. check the PC if it is working; otherwise inform lab instructor, 2. be careful while handling the power supply buttons of computers and to keep them off when they are not needed, 3. Ckeck if MATLAB is working correctly, Experimental Procedure: Working in MATLAB environment: 1. To start MATLAB software package, click on the START menu in the desktop, then find the MATLAB icon from the program group. This will open a MATLAB Command Window for you. You can find the MATLAB software package in the desktop as well. You can just double-click it. 2. When the MATLAB Command Window pops up, you will get a prompt (>>). You can write your MATLAB commands after this prompt and MATLAB will execute them line by line. Working in the MATLAB environment is generally straightforward as most commands are entered as you would write them mathematically. For example, entering the following sample expression >> a = 4/3 yields the MATLAB response as follows a = However, it is much more convenient to use an M-file (with.m extension) than to enter commands line by line at the MATLAB prompt. In MATLAB Command Window, click New- >M-file to bring up a new M-file. 4. In M-files, statements that begin with a % are considered to be comments and are ignored by MATLAB. The commands in these files are executed in the MATLAB environment simply by entering the name of the file without the.m. For this lab, an M-file Lab1.m was written in C:\Spring 2012 folder. This same file has been loaded in all the computers in the lab. To run this file first you have to change your working directory by writing the following commands at your MATLAB prompt as: >>C:\ Spring 2012

8 Now write the file name at MATLAB prompt to run your file from the directory like following: >>Lab1 and then press ENTER. You will get the answers like following: p1 = num/den = s^3 + 5 s ans = With the help of the teacher, run the M-file on a PC in MATLAB environment. Write down the answers from the MATLAB command prompt in a your notebook and analyze them. Remember, in MATLAB, if the semicolon at the end of a command is not used, it will display computed answer for that command in the MATLAB command window. 6. After running the M-file, two figures will pop up. Go to Figure No. 2. Click on Tools-Axes Properties. In Edit Axes Properties window, click the Manual in Tick Step option. Enter 0.2 for time in seconds. Keep the default value for y(t). Click Manual in the Limits option. Enter 1.8 in the right cell for time in seconds. Keep the left cell as 0. Click Apply and then Ok. This will allow you to analyze both the figures within the same zone. Simulation: See the MATLAB Code in appendix section Command window Output: p1 = num/den = s^3 + 5 s ans = 12 r1 =

9 i i p2 = num/den = s^ e-015 s^2 + 5 s exp = OL_TRF_num = 1 1 OL_TRF_den = num/den = s s^2 + 8 s + 15 G = 1 1 H = CL_TRF_num = 0 1 1

10 CL_TRF_den = num/den = s s^2 + 9 s + 16

11 Report: Write a report on this experiment. With the approval and help of the teacher paste the Matlab results (from the Matlab Command Window), Matlab codes (from the M-file) and Matlab plots in an MS Word file. Only one group should print out this file. Members of the group and other groups should make copies of this printout at some other time. These printouts should be attached in the Body of everyone s lab reports. Comment on the step responses for different control systems. Did you find any difference in the step responses of open loop and closed loop control systems? Provide your comments and recommendations for it. Reference: Norman S. Nise, Control Systems Engineering, available Edition, John Wiley & Sons Inc.

12 Appendices %Lab 1 %MATLAB codes clc; close all; clear all; %EEE 4101 (Control Systems) %Clears the MATLAB Command Window %Closes all figures %Clears all variables %Part 1 %Creating equations, Calculating roots, Outputting transfer functions etc. p1=[ ] printsys(p1,[ ],'s') polyval(p1,1) r1=roots(p1) p2=poly(r1) printsys(p2,[ ],'s') %Defines the coefficients of a linear equation %Outputs the polynomial of the equation %as a transfer function and also in %symbolic form, where the variable %is labelled as "s" %Evaluates the polynomial of the equation %with a value of 1 %Calculates the roots of the equation %Creates an equation from the roots (r1). %This should match with the original equation(p1). %But it will not match exactly in this case. %This is because the imaginary portion of the %complex root has fractions and MATLAB cannot %incorporate all digits to the right of a %fraction in computations. %Outputs the equation as a transfer function %and also in symbolic form, where the variable %is labelled as "s". This should match with %the previous transfer function exp1=[1 1]; exp2=[1 2]; exp=conv(exp1,exp2) %Define an expression called exp1 %Define an expression called exp2 %Multiply these two expresions and store the %result in exp

13 %Part 2 %Simulating an open loop control system clear all; OL_TRF_num = [1 1] OL_TRF_den = conv([1 3], [1 5]) %Clears all variables (i.e. p1,r1,p2 etc.) %Define the numerator of a transfer function %Define the denominator of a transfer function printsys(ol_trf_num, OL_TRF_den, 's') %Outputs the transfer function (open-loop) in %symbolic form, where the variable is "s" [y, x, t]=step(ol_trf_num, OL_TRF_den); %Simulate this system for a step input.it will %store the simulation results in certain %variables like y,x,t figure (1) plot(t, y) grid %Label the figure %Display the simulation in a 2-D plot %Add gridlines in the figure title('unit step responce for open loop') ylabel('y(t)') xlabel('time in seconds') %Add a title to the figure %Label y axis %Label x axis %Part 3 %Simulating a close loop control system %This control system has unity feedback clear all; G = [1 1] H = conv([1 3], [1 5]) %Clears all variables (i.e. p1,r1,p2,gnum, %Gden,y,x,t etc.) %Define the feedforward transfer function %Define the feedback transfer function [CL_TRF_num, CL_TRF_den] = cloop(g, H) %Form the resulting close-loop transfer function printsys(cl_trf_num, CL_TRF_den, 's') %Outputs the transfer function (open-loop) in %symbolic form where the variable is "s" [y, x, t]=step(cl_trf_num, CL_TRF_den);

14 %Simulate this system for a step input.it will %store the simulation results in certain %variables like y,x,t figure (2) plot(t, y) grid %Label the figure %Display the simulation in a 2-D plot %Add gridlines in the figure title('unit step responce for close loop') %Add a title to the figure ylabel('y(t)') xlabel('time in seconds') %Label y axis %Label x axis

2. Introduction to Matlab Control System Toolbox

2. Introduction to Matlab Control System Toolbox . Introduction to Matlab Control System Toolbox Consider a single-input, single-output (SISO), continuous-time, linear, time invariant (LTI) system defined by its transfer function: u(t) Y( S) num y(t)

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB MATLAB stands for MATrix LABoratory. Originally written by Cleve Moler for college linear algebra courses, MATLAB has evolved into the premier software for linear algebra computations

More information

Why use MATLAB? Mathematcal computations. Used a lot for problem solving. Statistical Analysis (e.g., mean, min) Visualisation (1D-3D)

Why use MATLAB? Mathematcal computations. Used a lot for problem solving. Statistical Analysis (e.g., mean, min) Visualisation (1D-3D) MATLAB(motivation) Why use MATLAB? Mathematcal computations Used a lot for problem solving Statistical Analysis (e.g., mean, min) Visualisation (1D-3D) Signal processing (Fourier transform, etc.) Image

More information

Getting Started with MATLAB

Getting Started with MATLAB APPENDIX B Getting Started with MATLAB MATLAB software is a computer program that provides the user with a convenient environment for many types of calculations in particular, those that are related to

More information

2.0 MATLAB Fundamentals

2.0 MATLAB Fundamentals 2.0 MATLAB Fundamentals 2.1 INTRODUCTION MATLAB is a computer program for computing scientific and engineering problems that can be expressed in mathematical form. The name MATLAB stands for MATrix LABoratory,

More information

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017 Assigned: January 27, 2017 Due Date: Week of February 6, 2017 George Mason University ECE 201: Introduction to Signal Analysis Spring 2017 Laboratory Project #1 Due Date Your lab report must be submitted

More information

Here is a quick introduction to Matlab and a couple of its symbolic and control functions.

Here is a quick introduction to Matlab and a couple of its symbolic and control functions. Some Matlab 1 Here is a quick introduction to Matlab and a couple of its symbolic and control functions. Matlab is an interpreted language. When you enter a command in the Command window, the line is executed

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Contents 1.1 Objectives... 1 1.2 Lab Requirement... 1 1.3 Background of MATLAB... 1 1.4 The MATLAB System... 1 1.5 Start of MATLAB... 3 1.6 Working Modes of MATLAB... 4 1.7 Basic

More information

University of Alberta

University of Alberta A Brief Introduction to MATLAB University of Alberta M.G. Lipsett 2008 MATLAB is an interactive program for numerical computation and data visualization, used extensively by engineers for analysis of systems.

More information

An Introduction to MATLAB and the Control Systems toolbox Aravind Parchuri, Darren Hon and Albert Honein

An Introduction to MATLAB and the Control Systems toolbox Aravind Parchuri, Darren Hon and Albert Honein E205 Introduction to Control Design Techniques An Introduction to MATLAB and the Control Systems toolbox Aravind Parchuri, Darren Hon and Albert Honein MATLAB is essentially a programming interface that

More information

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) Introduction ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) MATLAB is a powerful mathematical language that is used in most engineering companies today. Its strength lies

More information

Lab 1 Intro to MATLAB and FreeMat

Lab 1 Intro to MATLAB and FreeMat Lab 1 Intro to MATLAB and FreeMat Objectives concepts 1. Variables, vectors, and arrays 2. Plotting data 3. Script files skills 1. Use MATLAB to solve homework problems 2. Plot lab data and mathematical

More information

Lab # 3 Time Response Design. State Space and Transfer Functions

Lab # 3 Time Response Design. State Space and Transfer Functions Islamic University of Gaza Faculty of Engineering Computer Engineering Dep. Feedback Control Systems Lab Eng. Tareq Abu Aisha Lab # 3 Lab # 3 Time Response Design State Space and Transfer Functions There

More information

Introduction to MATLAB

Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 Software Philosophy Matrix-based numeric computation MATrix LABoratory built-in support for standard matrix and vector operations High-level programming language Programming

More information

EE 216 Experiment 1. MATLAB Structure and Use

EE 216 Experiment 1. MATLAB Structure and Use EE216:Exp1-1 EE 216 Experiment 1 MATLAB Structure and Use This first laboratory experiment is an introduction to the use of MATLAB. The basic computer-user interfaces, data entry techniques, operations,

More information

The Interpolating Polynomial

The Interpolating Polynomial Math 45 Linear Algebra David Arnold David-Arnold@Eureka.redwoods.cc.ca.us Abstract A polynomial that passes through a given set of data points is called an interpolating polynomial. In this exercise you

More information

WHAT IS MATLAB?... 1 STARTING MATLAB & USING THE COMMAND LINE... 1 BASIC ARITHMETIC OPERATIONS... 5 ORDER OF OPERATIONS... 7

WHAT IS MATLAB?... 1 STARTING MATLAB & USING THE COMMAND LINE... 1 BASIC ARITHMETIC OPERATIONS... 5 ORDER OF OPERATIONS... 7 Contents WHAT IS MATLAB?... 1 STARTING MATLAB & USING THE COMMAND LINE... 1 BASIC ARITHMETIC OPERATIONS... 5 ORDER OF OPERATIONS... 7 WHAT IS MATLAB? MATLAB stands for MATrix LABoratory. It is designed

More information

MATLAB. Miran H. S. Mohammed. Lecture 1

MATLAB. Miran H. S. Mohammed. Lecture 1 MATLAB Miran H. S. Mohammed 1 Lecture 1 OUTLINES Introduction Why using MATLAB Installing MATLAB Activate your installation Getting started Some useful command Using MATLAB as a calculator 2 INTRODUCTION

More information

Matlab = Matrix Laboratory. It is designed to be great at handling matrices.

Matlab = Matrix Laboratory. It is designed to be great at handling matrices. INTRODUCTION: Matlab = Matrix Laboratory. It is designed to be great at handling matrices. Matlab is a high-level language and interactive environment. You write simple ASCII text that is translated into

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 1 Introduction to MATLAB Dr Richard Greenaway 1 Introduction to MATLAB 1.1 What is MATLAB? MATLAB is a high-level technical computing language

More information

LAB 2: Linear Equations and Matrix Algebra. Preliminaries

LAB 2: Linear Equations and Matrix Algebra. Preliminaries Math 250C, Section C2 Hard copy submission Matlab # 2 1 Revised 07/13/2016 LAB 2: Linear Equations and Matrix Algebra In this lab you will use Matlab to study the following topics: Solving a system of

More information

BRUSH UP ON MATLAB UNIVERSITY OF PAVIA. Industrial Control FACULTY OF ENGINEERING. Prof. Lalo Magni

BRUSH UP ON MATLAB UNIVERSITY OF PAVIA. Industrial Control FACULTY OF ENGINEERING. Prof. Lalo Magni UNIVERSITY OF PAVIA FACULTY OF ENGINEERING Industrial Control Prof. Lalo Magni BRUSH UP ON MATLAB Chiara Toffanin, Assistant Professor Gian Paolo Incremona, Ph.D. MATLAB: What is it? MATLAB (from MATrix

More information

To start using Matlab, you only need be concerned with the command window for now.

To start using Matlab, you only need be concerned with the command window for now. Getting Started Current folder window Atop the current folder window, you can see the address field which tells you where you are currently located. In programming, think of it as your current directory,

More information

MATLAB - Lecture # 4

MATLAB - Lecture # 4 MATLAB - Lecture # 4 Script Files / Chapter 4 Topics Covered: 1. Script files. SCRIPT FILE 77-78! A script file is a sequence of MATLAB commands, called a program.! When a file runs, MATLAB executes the

More information

Chapter 1 MATLAB Preliminaries

Chapter 1 MATLAB Preliminaries Chapter 1 MATLAB Preliminaries 1.1 INTRODUCTION MATLAB (Matrix Laboratory) is a high-level technical computing environment developed by The Mathworks, Inc. for mathematical, scientific, and engineering

More information

Introduction to MATLAB for Engineers, Third Edition

Introduction to MATLAB for Engineers, Third Edition PowerPoint to accompany Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 2 Numeric, Cell, and Structure Arrays Copyright 2010. The McGraw-Hill Companies, Inc. This work is

More information

ECE-205 Lab 1. Introduction to Simulink and Matlab

ECE-205 Lab 1. Introduction to Simulink and Matlab ECE-205 Lab 1 Introduction to Simulink and Matlab Throughout this lab we will focus on determining the behavior of a first order system written in the standard form dy( t) y( t) Kx( t) dt where xt () is

More information

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline MATLAB Tutorial EE351M DSP Created: Thursday Jan 25, 2007 Rayyan Jaber Modified by: Kitaek Bae Outline Part I: Introduction and Overview Part II: Matrix manipulations and common functions Part III: Plots

More information

Introduction to MATLAB

Introduction to MATLAB 58:110 Computer-Aided Engineering Spring 2005 Introduction to MATLAB Department of Mechanical and industrial engineering January 2005 Topics Introduction Running MATLAB and MATLAB Environment Getting help

More information

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013

Lab of COMP 406. MATLAB: Quick Start. Lab tutor : Gene Yu Zhao Mailbox: or Lab 1: 11th Sep, 2013 Lab of COMP 406 MATLAB: Quick Start Lab tutor : Gene Yu Zhao Mailbox: csyuzhao@comp.polyu.edu.hk or genexinvivian@gmail.com Lab 1: 11th Sep, 2013 1 Where is Matlab? Find the Matlab under the folder 1.

More information

MATLAB Premier. Middle East Technical University Department of Mechanical Engineering ME 304 1/50

MATLAB Premier. Middle East Technical University Department of Mechanical Engineering ME 304 1/50 MATLAB Premier Middle East Technical University Department of Mechanical Engineering ME 304 1/50 Outline Introduction Basic Features of MATLAB Prompt Level and Basic Arithmetic Operations Scalars, Vectors,

More information

1. Register an account on: using your Oxford address

1. Register an account on:   using your Oxford  address 1P10a MATLAB 1.1 Introduction MATLAB stands for Matrix Laboratories. It is a tool that provides a graphical interface for numerical and symbolic computation along with a number of data analysis, simulation

More information

Creates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window.

Creates a 1 X 1 matrix (scalar) with a value of 1 in the column 1, row 1 position and prints the matrix aaa in the command window. EE 350L: Signals and Transforms Lab Spring 2007 Lab #1 - Introduction to MATLAB Lab Handout Matlab Software: Matlab will be the analytical tool used in the signals lab. The laboratory has network licenses

More information

ME 121 MATLAB Lesson 01 Introduction to MATLAB

ME 121 MATLAB Lesson 01 Introduction to MATLAB 1 ME 121 MATLAB Lesson 01 Introduction to MATLAB Learning Objectives Be able run MATLAB in the MCECS computer labs Be able to perform simple interactive calculations Be able to open and view an m-file

More information

Workshop Matlab/Simulink in Drives and Power electronics Lecture 3

Workshop Matlab/Simulink in Drives and Power electronics Lecture 3 Workshop Matlab/Simulink in Drives and Power electronics Lecture 3 : DC-Motor Control design Ghislain REMY Jean DEPREZ 1 / 29 Workshop Program 8 lectures will be presented based on Matlab/Simulink : 1

More information

Introduction to MATLAB LAB 1

Introduction to MATLAB LAB 1 Introduction to MATLAB LAB 1 1 Basics of MATLAB MATrix LABoratory A super-powerful graphing calculator Matrix based numeric computation Embedded Functions Also a programming language User defined functions

More information

MATLAB CONTROL SYSTEM TOOLBOX IN LTI SYSTEM MODEL ANALYSIS

MATLAB CONTROL SYSTEM TOOLBOX IN LTI SYSTEM MODEL ANALYSIS MATLAB CONTROL SYSTEM TOOLBOX IN LTI SYSTEM MODEL ANALYSIS Asist.univ. Luminiţa Giurgiu Abstract The MATLAB environment has important numerical tools. One of them provides a reliable foundation for control

More information

Teaching Manual Math 2131

Teaching Manual Math 2131 Math 2131 Linear Algebra Labs with MATLAB Math 2131 Linear algebra with Matlab Teaching Manual Math 2131 Contents Week 1 3 1 MATLAB Course Introduction 5 1.1 The MATLAB user interface...........................

More information

Can be put into the matrix form of Ax=b in this way:

Can be put into the matrix form of Ax=b in this way: Pre-Lab 0 Not for Grade! Getting Started with Matlab Introduction In EE311, a significant part of the class involves solving simultaneous equations. The most time efficient way to do this is through the

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 1 Chapter 2 MATLAB Fundamentals PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

More information

Introduction to MATLAB Programming

Introduction to MATLAB Programming Introduction to MATLAB Programming Arun A. Balakrishnan Asst. Professor Dept. of AE&I, RSET Overview 1 Overview 2 Introduction 3 Getting Started 4 Basics of Programming Overview 1 Overview 2 Introduction

More information

Introduction to MATLAB 7 for Engineers

Introduction to MATLAB 7 for Engineers PowerPoint to accompany Introduction to MATLAB 7 for Engineers William J. Palm III Chapter 2 Numeric, Cell, and Structure Arrays Copyright 2005. The McGraw-Hill Companies, Inc. Permission required for

More information

Lecturer: Keyvan Dehmamy

Lecturer: Keyvan Dehmamy MATLAB Tutorial Lecturer: Keyvan Dehmamy 1 Topics Introduction Running MATLAB and MATLAB Environment Getting help Variables Vectors, Matrices, and linear Algebra Mathematical Functions and Applications

More information

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c.

MATLAB BASICS. < Any system: Enter quit at Matlab prompt < PC/Windows: Close command window < To interrupt execution: Enter Ctrl-c. MATLAB BASICS Starting Matlab < PC: Desktop icon or Start menu item < UNIX: Enter matlab at operating system prompt < Others: Might need to execute from a menu somewhere Entering Matlab commands < Matlab

More information

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial 1 Matlab Tutorial 2 Lecture Learning Objectives Each student should be able to: Describe the Matlab desktop Explain the basic use of Matlab variables Explain the basic use of Matlab scripts Explain the

More information

16.06/16.07 Matlab/Simulink Tutorial

16.06/16.07 Matlab/Simulink Tutorial Massachusetts Institute of Technology 16.06/16.07 Matlab/Simulink Tutorial Version 1.0 September 2004 Theresa Robinson Nayden Kambouchev 1 Where to Find More Information There are many webpages which contain

More information

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP)

MATLAB Tutorial. Digital Signal Processing. Course Details. Topics. MATLAB Environment. Introduction. Digital Signal Processing (DSP) Digital Signal Processing Prof. Nizamettin AYDIN naydin@yildiz.edu.tr naydin@ieee.org http://www.yildiz.edu.tr/~naydin Course Details Course Code : 0113620 Course Name: Digital Signal Processing (Sayısal

More information

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis Introduction to Matlab 1 Outline What is Matlab? Matlab desktop & interface Scalar variables Vectors and matrices Exercise 1 Booleans Control structures File organization User defined functions Exercise

More information

Lab #1 Revision to MATLAB

Lab #1 Revision to MATLAB Lab #1 Revision to MATLAB Objectives In this lab we would have a revision to MATLAB, especially the basic commands you have dealt with in analog control. 1. What Is MATLAB? MATLAB is a high-performance

More information

Working with Rational Expressions

Working with Rational Expressions Working with Rational Expressions Return to Table of Contents 4 Goals and Objectives Students will simplify rational expressions, as well as be able to add, subtract, multiply, and divide rational expressions.

More information

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System CHAPTER 1 INTRODUCTION Digital signal processing (DSP) technology has expanded at a rapid rate to include such diverse applications as CDs, DVDs, MP3 players, ipods, digital cameras, digital light processing

More information

Introduction to Scientific Computing with Matlab

Introduction to Scientific Computing with Matlab UNIVERSITY OF WATERLOO Introduction to Scientific Computing with Matlab SAW Training Course R. William Lewis Computing Consultant Client Services Information Systems & Technology 2007 Table of Contents

More information

Chapter 2. MATLAB Fundamentals

Chapter 2. MATLAB Fundamentals Chapter 2. MATLAB Fundamentals Choi Hae Jin Chapter Objectives q Learning how real and complex numbers are assigned to variables. q Learning how vectors and matrices are assigned values using simple assignment,

More information

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices

Introduction to. The Help System. Variable and Memory Management. Matrices Generation. Interactive Calculations. Vectors and Matrices Introduction to Interactive Calculations Matlab is interactive, no need to declare variables >> 2+3*4/2 >> V = 50 >> V + 2 >> V Ans = 52 >> a=5e-3; b=1; a+b Most elementary functions and constants are

More information

YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM

YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM YOGYAKARTA STATE UNIVERSITY MATHEMATICS AND NATURAL SCIENCES FACULTY MATHEMATICS EDUCATION STUDY PROGRAM TOPIC 1 INTRODUCING SOME MATHEMATICS SOFTWARE (Matlab, Maple and Mathematica) This topic provides

More information

Developing a MATLAB-Based Control System Design and Analysis Tool for Enhanced Learning Environment in Control System Education

Developing a MATLAB-Based Control System Design and Analysis Tool for Enhanced Learning Environment in Control System Education Developing a MATLAB-Based Control System Design and Analysis Tool for Enhanced Learning Environment in Control System Education Frank S. Cheng and Lin Zhao Industrial and Engineering Technology Department

More information

A General Introduction to Matlab

A General Introduction to Matlab Master Degree Course in ELECTRONICS ENGINEERING http://www.dii.unimore.it/~lbiagiotti/systemscontroltheory.html A General Introduction to Matlab e-mail: luigi.biagiotti@unimore.it http://www.dii.unimore.it/~lbiagiotti

More information

An Introduction to MATLAB II

An Introduction to MATLAB II Lab of COMP 319 An Introduction to MATLAB II Lab tutor : Gene Yu Zhao Mailbox: csyuzhao@comp.polyu.edu.hk or genexinvivian@gmail.com Lab 2: 16th Sep, 2013 1 Outline of Lab 2 Review of Lab 1 Matrix in Matlab

More information

Root Locus Controller Design

Root Locus Controller Design Islamic University of Gaza Faculty of Engineering Electrical Engineering department Control Systems Design Lab Eng. Mohammed S. Jouda Eng. Ola M. Skeik Experiment 4 Root Locus Controller Design Overview

More information

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras

MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras MATLAB Programming for Numerical Computation Dr. Niket Kaisare Department Of Chemical Engineering Indian Institute of Technology, Madras Module No. #01 Lecture No. #1.1 Introduction to MATLAB programming

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Introduction: MATLAB is a powerful high level scripting language that is optimized for mathematical analysis, simulation, and visualization. You can interactively solve problems

More information

Laboratory 1 Introduction to MATLAB for Signals and Systems

Laboratory 1 Introduction to MATLAB for Signals and Systems Laboratory 1 Introduction to MATLAB for Signals and Systems INTRODUCTION to MATLAB MATLAB is a powerful computing environment for numeric computation and visualization. MATLAB is designed for ease of use

More information

LAB 1 General MATLAB Information 1

LAB 1 General MATLAB Information 1 LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by

More information

Matlab Introduction. Scalar Variables and Arithmetic Operators

Matlab Introduction. Scalar Variables and Arithmetic Operators Matlab Introduction Matlab is both a powerful computational environment and a programming language that easily handles matrix and complex arithmetic. It is a large software package that has many advanced

More information

MATLAB Premier. Asst. Prof. Dr. Melik DÖLEN. Middle East Technical University Department of Mechanical Engineering 10/30/04 ME 304 1

MATLAB Premier. Asst. Prof. Dr. Melik DÖLEN. Middle East Technical University Department of Mechanical Engineering 10/30/04 ME 304 1 MATLAB Premier Asst. Prof. Dr. Melik DÖLEN Middle East Technical University Department of Mechanical Engineering 0/0/04 ME 04 Outline! Introduction! Basic Features of MATLAB! Prompt Level and Basic Aritmetic

More information

Lab. Manual. Practical Special Topics (Matlab Programming) (EngE416) Prepared By Dr. Emad Saeid

Lab. Manual. Practical Special Topics (Matlab Programming) (EngE416) Prepared By Dr. Emad Saeid KINGDOM OF SAUDI ARABIA JAZAN UNIVERSTY College of Engineering Electrical Engineering Department المملكة العربية السعودية وزارة التعليم العالي جامعة جازان كلية الھندسة قسم الھندسة الكھربائية Lab. Manual

More information

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips Cal Poly San Luis Obispo Mechanical Engineering ME Mechanical Control Systems Matlab/Simulink Hints and Tips Ridgely/Owen, last update Jan Building A Model The way in which we construct models for analyzing

More information

MATLAB Fundamentals. Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University

MATLAB Fundamentals. Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University MATLAB Fundamentals Berlin Chen Department of Computer Science & Information Engineering National Taiwan Normal University Reference: 1. Applied Numerical Methods with MATLAB for Engineers, Chapter 2 &

More information

Colorado State University Department of Mechanical Engineering. MECH Laboratory Exercise #1 Introduction to MATLAB

Colorado State University Department of Mechanical Engineering. MECH Laboratory Exercise #1 Introduction to MATLAB Colorado State University Department of Mechanical Engineering MECH 417 - Laboratory Exercise #1 Introduction to MATLAB Contents 1) Vectors and Matrices... 2 2) Polynomials... 3 3) Plotting and Printing...

More information

An Introduction to Numerical Methods

An Introduction to Numerical Methods An Introduction to Numerical Methods Using MATLAB Khyruddin Akbar Ansari, Ph.D., P.E. Bonni Dichone, Ph.D. SDC P U B L I C AT I O N S Better Textbooks. Lower Prices. www.sdcpublications.com Powered by

More information

Introduction to Matlab

Introduction to Matlab Introduction to Matlab Andreas C. Kapourani (Credit: Steve Renals & Iain Murray) 9 January 08 Introduction MATLAB is a programming language that grew out of the need to process matrices. It is used extensively

More information

A Guide to Using Some Basic MATLAB Functions

A Guide to Using Some Basic MATLAB Functions A Guide to Using Some Basic MATLAB Functions UNC Charlotte Robert W. Cox This document provides a brief overview of some of the essential MATLAB functionality. More thorough descriptions are available

More information

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano

MATLAB Lesson I. Chiara Lelli. October 2, Politecnico di Milano MATLAB Lesson I Chiara Lelli Politecnico di Milano October 2, 2012 MATLAB MATLAB (MATrix LABoratory) is an interactive software system for: scientific computing statistical analysis vector and matrix computations

More information

Complex Dynamic Systems

Complex Dynamic Systems Complex Dynamic Systems Department of Information Engineering and Mathematics University of Siena (Italy) (mocenni at dii.unisi.it) (madeo at dii.unisi.it) (roberto.zingone at unisi.it) Lab Session #1

More information

MATLAB Introductory Course Computer Exercise Session

MATLAB Introductory Course Computer Exercise Session MATLAB Introductory Course Computer Exercise Session This course is a basic introduction for students that did not use MATLAB before. The solutions will not be collected. Work through the course within

More information

MATH 2650/ Intro to Scientific Computation - Fall Lab 1: Starting with MATLAB. Script Files

MATH 2650/ Intro to Scientific Computation - Fall Lab 1: Starting with MATLAB. Script Files MATH 2650/3670 - Intro to Scientific Computation - Fall 2017 Lab 1: Starting with MATLAB. Script Files Content - Overview of Course Objectives - Use of MATLAB windows; the Command Window - Arithmetic operations

More information

AMS 27L LAB #2 Winter 2009

AMS 27L LAB #2 Winter 2009 AMS 27L LAB #2 Winter 2009 Plots and Matrix Algebra in MATLAB Objectives: 1. To practice basic display methods 2. To learn how to program loops 3. To learn how to write m-files 1 Vectors Matlab handles

More information

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain

Introduction to Matlab. By: Dr. Maher O. EL-Ghossain Introduction to Matlab By: Dr. Maher O. EL-Ghossain Outline: q What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators (Arithmetic, relational, logical ) Display Facilities Flow Control

More information

Algebra 2 Common Core Summer Skills Packet

Algebra 2 Common Core Summer Skills Packet Algebra 2 Common Core Summer Skills Packet Our Purpose: Completion of this packet over the summer before beginning Algebra 2 will be of great value to helping students successfully meet the academic challenges

More information

Matlab and Octave: Quick Introduction and Examples 1 Basics

Matlab and Octave: Quick Introduction and Examples 1 Basics Matlab and Octave: Quick Introduction and Examples 1 Basics 1.1 Syntax and m-files There is a shell where commands can be written in. All commands must either be built-in commands, functions, names of

More information

Note 10 Introduction to MATLAB & SIMULINK

Note 10 Introduction to MATLAB & SIMULINK Note 10 Introduction to MATLAB & SIMULINK Department of Mechanical Engineering, University Of Saskatchewan, 57 Campus Drive, Saskatoon, SK S7N 5A9, Canada 1 1 Introduction to MATLAB MATLAB stands for the

More information

SIMULINK Tutorial. Select File-New-Model from the menu bar of this window. The following window should now appear.

SIMULINK Tutorial. Select File-New-Model from the menu bar of this window. The following window should now appear. SIMULINK Tutorial Simulink is a block-orientated program that allows the simulation of dynamic systems in a block diagram format whether they are linear or nonlinear, in continuous or discrete forms. To

More information

Matlab Practice Sessions

Matlab Practice Sessions Matlab Practice Sessions 1. Getting Started Startup Matlab Observe the following elements of the desktop; Command Window Current Folder Window Command History Window Workspace Window Notes: If you startup

More information

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin

Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming usin Matlab notes Matlab is a matrix-based, high-performance language for technical computing It integrates computation, visualisation and programming using familiar mathematical notation The name Matlab stands

More information

Introduction to MatLab. Introduction to MatLab K. Craig 1

Introduction to MatLab. Introduction to MatLab K. Craig 1 Introduction to MatLab Introduction to MatLab K. Craig 1 MatLab Introduction MatLab and the MatLab Environment Numerical Calculations Basic Plotting and Graphics Matrix Computations and Solving Equations

More information

Introduction to the MATLAB SIMULINK Program

Introduction to the MATLAB SIMULINK Program Introduction to the MATLAB SIMULINK Program Adapted from similar document by Dept. of Chemical Engineering, UC - Santa Barbara MATLAB, which stands for MATrix LABoratory, is a technical computing environment

More information

Applied Matrix Theory - Math Summer 09 MATLAB Project 3 Created by Prof. Diego Maldonado and Prof. Virginia Naibo

Applied Matrix Theory - Math Summer 09 MATLAB Project 3 Created by Prof. Diego Maldonado and Prof. Virginia Naibo Applied Matrix Theory - Math 551 - Summer 09 MATLAB Project Created by Prof. Diego Maldonado and Prof. Virginia Naibo In this project you will be introduced to MATLAB programming. What you have to submit:

More information

ELEC ENG 4CL4 CONTROL SYSTEM DESIGN

ELEC ENG 4CL4 CONTROL SYSTEM DESIGN ELEC ENG 4CL4 CONTROL SYSTEM DESIGN Lab #1: MATLAB/Simulink simulation of continuous casting Objectives: To gain experience in simulating a control system (controller + plant) within MATLAB/Simulink. To

More information

Matlab Tutorial, CDS

Matlab Tutorial, CDS 29 September 2006 Arrays Built-in variables Outline Operations Linear algebra Polynomials Scripts and data management Help: command window Elisa (see Franco next slide), Matlab Tutorial, i.e. >> CDS110-101

More information

An Introduction to MATLAB See Chapter 1 of Gilat

An Introduction to MATLAB See Chapter 1 of Gilat 1 An Introduction to MATLAB See Chapter 1 of Gilat Kipp Martin University of Chicago Booth School of Business January 25, 2012 Outline The MATLAB IDE MATLAB is an acronym for Matrix Laboratory. It was

More information

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu

ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu ECON 502 INTRODUCTION TO MATLAB Nov 9, 2007 TA: Murat Koyuncu 0. What is MATLAB? 1 MATLAB stands for matrix laboratory and is one of the most popular software for numerical computation. MATLAB s basic

More information

MATLAB Project: Getting Started with MATLAB

MATLAB Project: Getting Started with MATLAB Name Purpose: To learn to create matrices and use various MATLAB commands for reference later MATLAB built-in functions used: [ ] : ; + - * ^, size, help, format, eye, zeros, ones, diag, rand, round, cos,

More information

Getting started with MATLAB

Getting started with MATLAB Sapienza University of Rome Department of economics and law Advanced Monetary Theory and Policy EPOS 2013/14 Getting started with MATLAB Giovanni Di Bartolomeo giovanni.dibartolomeo@uniroma1.it Outline

More information

Lecture 3: Array Applications, Cells, Structures & Script Files

Lecture 3: Array Applications, Cells, Structures & Script Files Lecture 3: Array Applications, Cells, Structures & Script Files Dr. Mohammed Hawa Electrical Engineering Department University of Jordan EE201: Computer Applications. See Textbook Chapter 2 and Chapter

More information

Getting To Know Matlab

Getting To Know Matlab Getting To Know Matlab The following worksheets will introduce Matlab to the new user. Please, be sure you really know each step of the lab you performed, even if you are asking a friend who has a better

More information

1-- Pre-Lab The Pre-Lab this first week is short and straightforward. Make sure that you read through the information below prior to coming to lab.

1-- Pre-Lab The Pre-Lab this first week is short and straightforward. Make sure that you read through the information below prior to coming to lab. EELE 477 Lab 1: Introduction to MATLAB Pre-Lab and Warm-Up: You should read the Pre-Lab and Warm-up sections of this lab assignment and go over all exercises in the Pre-Lab section before attending your

More information

Control System Toolbox

Control System Toolbox The Almighty University of Mohaghegh Ardabili Control System Toolbox The SISO Design Tool 1 Transfer Function TF = 2s + 4 s 2 + 6s + 5 TF = TF = 2(s + 2) (s + 1)(s + 5) 2(s + 2) (s + 1)(s + 5) 0 1 A= 5

More information

Matlab Tutorial: Basics

Matlab Tutorial: Basics Matlab Tutorial: Basics Topics: opening matlab m-files general syntax plotting function files loops GETTING HELP Matlab is a program which allows you to manipulate, analyze and visualize data. MATLAB allows

More information

Introduction to Simulink

Introduction to Simulink Introduction to Simulink Mikael Manngård Process Control Laboratory, Åbo Akademi University February 27, 2014 Simulink is an extension to MATLAB that is used for modeling and simulation of dynamic systems.

More information

Introduction to MATLAB

Introduction to MATLAB Chapter 1 Introduction to MATLAB MATLAB Matrix Laoratory A special-purpose program optimized to perform engineering and scientific calculations Chapter M1: Introduction to MATLAB 1 MATLAB Integrated development

More information