EE 350. Continuous-Time Linear Systems. Recitation 1. 1

Similar documents
Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

STAT/MATH 395 A - PROBABILITY II UW Winter Quarter Matlab Tutorial

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.

INTRODUCTION TO MATLAB, SIMULINK, AND THE COMMUNICATION TOOLBOX

PART 1 PROGRAMMING WITH MATHLAB

Assignment 02 (Due: Monday, February 1, 2016)

Chapter 2. MATLAB Fundamentals

Introduction to MATLAB Practical 1

Logical Subscripting: This kind of subscripting can be done in one step by specifying the logical operation as the subscripting expression.

LAB 1: Introduction to MATLAB Summer 2011

Introduction to Matlab

Introduction to MATLAB

Eric W. Hansen. The basic data type is a matrix This is the basic paradigm for computation with MATLAB, and the key to its power. Here s an example:

1 Introduction to Matlab

EE 301 Signals & Systems I MATLAB Tutorial with Questions

Matlab Tutorial. Get familiar with MATLAB by using tutorials and demos found in MATLAB. You can click Start MATLAB Demos to start the help screen.

1. Register an account on: using your Oxford address

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

Matlab Introduction. Scalar Variables and Arithmetic Operators

A Guide to Using Some Basic MATLAB Functions

Prof. Manoochehr Shirzaei. RaTlab.asu.edu

How to learn MATLAB? Some predefined variables

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

Interactive Computing with Matlab. Gerald W. Recktenwald Department of Mechanical Engineering Portland State University

AMS 27L LAB #2 Winter 2009

Computational lab on complex numbers

Getting Started. Chapter 1. How to Get Matlab. 1.1 Before We Begin Matlab to Accompany Lay s Linear Algebra Text

Matlab Programming Introduction 1 2

Introduction to Matlab

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment

A Brief Introduction to MATLAB

Introduction to Matlab to Accompany Linear Algebra. Douglas Hundley Department of Mathematics and Statistics Whitman College

INTRODUCTION TO MATLAB PLOTTING WITH MATLAB

EGR 111 Introduction to MATLAB

EEE161 Applied Electromagnetics Laboratory 1

Matlab Tutorial: Basics

Complex Dynamic Systems

General Information. There are certain MATLAB features you should be aware of before you begin working with MATLAB.

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to.

UNIVERSITI TEKNIKAL MALAYSIA MELAKA FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER

Chapter 8 Complex Numbers & 3-D Plots

Introduction to Matlab

Introduction to MATLAB

Starting MATLAB To logon onto a Temple workstation at the Tech Center, follow the directions below.

2 Amazingly Simple Example Suppose we wanted to represent the following matrix 2 itchy = To enter itchy in Matla

APPM 2460 PLOTTING IN MATLAB

MATLAB Modul 3. Introduction

MATLAB SUMMARY FOR MATH2070/2970

Laboratory 1 Octave Tutorial

Mechanical Engineering Department Second Year (2015)

MATLAB/Octave Tutorial

Introduction to Engineering gii

2.0 MATLAB Fundamentals

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms:

MATH 2221A Mathematics Laboratory II

Matlab Tutorial 1: Working with variables, arrays, and plotting

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

Chapter 1 Introduction to MATLAB

Introduction to MatLab. Introduction to MatLab K. Craig 1

ARRAY VARIABLES (ROW VECTORS)

University of Alberta

EE 301 Lab 1 Introduction to MATLAB

Summer 2009 REU: Introduction to Matlab

Inlichtingenblad, matlab- en simulink handleiding en practicumopgaven IWS

Homework 1 Description CmpE 362 Spring Instructor : Fatih Alagoz Teaching Assistant : Yekta Said Can Due: 3 March, 23:59, sharp

Math Scientific Computing - Matlab Intro and Exercises: Spring 2003

A = [1, 6; 78, 9] Note: everything is case-sensitive, so a and A are different. One enters the above matrix as

Introduction to Matlab

Matlab Tutorial, CDS

Curriculum Map: Mathematics

Grace days can not be used for this assignment

Introduction to MATLAB

MATLAB Tutorial. Mohammad Motamed 1. August 28, generates a 3 3 matrix.

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

A General Introduction to Matlab

16.06/16.07 Matlab/Simulink Tutorial

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

MAT 275 Laboratory 1 Introduction to MATLAB

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

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

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #0: Introduction to MATLAB

Introduction to Matlab

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.

MATLAB Basics EE107: COMMUNICATION SYSTEMS HUSSAIN ELKOTBY

The value of f(t) at t = 0 is the first element of the vector and is obtained by

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

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

Introduction to Python Practical 1

ME422 Mechanical Control Systems Matlab/Simulink Hints and Tips

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

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

Introduction to Matlab

A very brief Matlab introduction

Lab P-1: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

AMATH 352: MATLAB Tutorial written by Peter Blossey Department of Applied Mathematics University of Washington Seattle, WA

Classes 7-8 (4 hours). Graphics in Matlab.

Basic Graphs. Dmitry Adamskiy 16 November 2011

MatLab Just a beginning

Fundamentals of MATLAB Usage

PC-MATLAB PRIMER. This is intended as a guided tour through PCMATLAB. Type as you go and watch what happens.

Transcription:

EE 350 Continuous-Time Linear Systems Recitation 1 Recitation 1. 1

Recitation 1 Topics MATLAB Programming Basic Operations, Built-In Functions, and Variables m-files Graphics: 2D plots EE 210 Review Branch Relationships for Inductors and Capacitors Switched RC Circuits Switched RLC Circuits Recitation 1. 2

MATLAB MATLAB (matrix laboratory) is a numerical computing environment and programming language MATLAB allows Matrix manipulations Plotting Implementation of algorithms Symbolic computing Creation of user interfaces Recitation 1. 3

SIMULINK A dataflow graphical programming language for modeling and simulating dynamic systems Widely used in control systems engineering and signal processing Tightly integrated with the MATLAB environment Recitation 1. 4

Basic Operations MATLAB supports basic operations and can be used as a calculator Operation MATLAB Example Result addition 200 + 350 550 subtraction 300-200 100 multiplication 4*16 64 division 24/6 4 power 4^2 16 Recitation 1. 5

Built-In Functions There are a host of useful functions Operation MATLAB Result Example natural logarithm log(10) 2.3026 logarithm Base 10 log10(10) 1 exponent (e x ) exp(1) 2.7183 square root sqrt(100) 10 cos (radians) cos(pi) -1 cosd (degrees) cosd(45) 0.7071 To learn about a function xyz, type: >> help xyz Recitation 1. 6

Variables MATLAB does not require any variable type declarations or dimension statements to define variables When defining a variable, it must appear on the left side of the equality sign acceptable: >> x = 3 unacceptable: >> 3 = x Multiplication must be explicit, that is, include the multiplication symbol * acceptable: >> y = 3*x + 2 unacceptable: >> y = 3x + 2 Recitation 1. 7

Problem 1 Use Euler's identity to determine the rectangular form of x j 4 e Verify your result using the MATLAB command window MATLAB recognizes i and j as the square root of -1 Use 1i to improve calculation speed Recitation 1. 8

Vectors Row vector: >> w = [1, 2, 3, 4] Column vector: >> x = [1; 2; 3; 4] Row Vector of 5 ones: >> y = ones(1,5) Column vector of 5 ones: >> x = ones(5,1) Row vector of 3 zeros: >> a = zeros(1,3) A vector [1, 1.5, 2]: >> b = [1 : 0.5 : 2] A row vector of 100 points evenly spaced between 0 and 10: >> c = linspace(0,10); The semicolon suppresses the echo! Recitation 1. 9

Scripts MATLAB statements may be executed in a script as control flow program Generate a script by choosing New Script (Ctrl + N) Recitation 1. 10

Problem 2 Write a script that plots cos(t) and sin(t) versus t using 100 points uniformly distributed over the interval 0 to 4 Plot the cosine signal using a solid black curve, and the sine signal using a dotted blue curve Use the legend command to distinguish the curves in the plot Use the xlabel, ylabel, and title commands to label the plot Recitation 1. 11

Problem 3(A) Consider the capacitor shown below i( t) C vt () 1. What is i(t) in terms of v(t)? 2. What is the energy stored in the capacitor? 3. What is v(t) in terms of i(t)? 4. Can v(t) change instantaneously? Why? 5. Can i(t) change instantaneously? Recitation 1. 12

Problem 3(A) Solution Recitation 1. 13

Problem 3(A) Solution Recitation 1. 14

Problem 3(B) Consider the inductor shown below i( t) L vt () 1. What is v(t) in terms of i(t)? 2. What is the energy stored in the inductor? 3. What is i(t) in terms of v(t)? 4. Can i(t) change instantaneously? Why? 5. Can v(t) change instantaneously? Recitation 1. 15

Problem 3(B) Solution Recitation 1. 16

Problem 3(B) Solution Recitation 1. 17

Problem 4 Consider the RC circuit below, where the switched has been opened a long time before it is closed at time t = 0. 60V 5k 10k t 0 10k i( t) 250 F 1. Determine v(0 ) and i(0 ) 2. Determine v(0 + ) and i(0 + ) 3. Determine v( ) and i( ) 4. Obtain an ODE that describes the response of v(t) for t 0 Recitation 1. 18 vt ()

Problem 4 Solution Recitation 1. 19

Problem 4 Solution Recitation 1. 20

Problem 4 Solution Recitation 1. 21

Problem 4 Solution Recitation 1. 22

Problem 4 Solution Recitation 1. 23

Problem 5 Consider the RLC circuit below, where the switched has been closed a long time before it is opened at time t = 0. i( t) 2F 1H 1 2V t 0 1 1. Obtain an ODE that describes the response of i(t) for t 0. 2. Determine the initial conditions, i(t) and di/dt at time t = 0 +. 3. Determine i(t) after the switch has been opened a long time. Recitation 1. 24

Problem 5 Solution Recitation 1. 25

Problem 5 Solution Recitation 1. 26

Problem 5 Solution Recitation 1. 27

Problem 5 Solution Recitation 1. 28

EE 350 Continuous-Time Linear Systems Recitation 1 Recitation 1. 1

Recitation 1 Topics MATLAB Programming Basic Operations, Built-In Functions, and Variables m-files Graphics: 2D plots EE 210 Review Branch Relationships for Inductors and Capacitors Switched RC Circuits Switched RLC Circuits Recitation 1. 2

MATLAB MATLAB (matrix laboratory) is a numerical computing environment and programming language MATLAB allows Matrix manipulations Plotting Implementation of algorithms Symbolic computing Creation of user interfaces Recitation 1. 3

SIMULINK A dataflow graphical programming language for modeling and simulating dynamic systems Widely used in control systems engineering and signal processing Tightly integrated with the MATLAB environment Recitation 1. 4

Basic Operations MATLAB supports basic operations and can be used as a calculator Operation MATLAB Example Result addition 200 + 350 550 subtraction 300-200 100 multiplication 4*16 64 division 24/6 4 power 4^2 16 Recitation 1. 5

Built-In Functions There are a host of useful functions Operation MATLAB Result Example natural logarithm log(10) 2.3026 logarithm Base 10 log10(10) 1 exponent (e x ) exp(1) 2.7183 square root sqrt(100) 10 cos (radians) cos(pi) -1 cosd (degrees) cosd(45) 0.7071 To learn about a function xyz, type: >> help xyz Recitation 1. 6

Variables MATLAB does not require any variable type declarations or dimension statements to define variables When defining a variable, it must appear on the left side of the equality sign Multiplication must be explicit, that is, include the multiplication symbol * Recitation 1. 7

Problem 1 Use Euler's identity to determine the rectangular form of Verify your result using the MATLAB command window MATLAB recognizes i and j as the square root of -1 Use 1i to improve calculation speed Recitation 1. 8

Vectors Row vector: >> w = [1, 2, 3, 4] Column vector: >> x = [1; 2; 3; 4] Row Vector of 5 ones: >> y = ones(1,5) Column vector of 5 ones: >> x = ones(5,1) Row vector of 3 zeros: >> a = zeros(1,3) A vector [1, 1.5, 2]: >> b = [1 : 0.5 : 2] A row vector of 100 points evenly spaced between 0 and 10: >> c = linspace(0,10); The semicolon suppresses the echo! Recitation 1. 9

Scripts MATLAB statements may be executed in a script as control flow program Generate a script by choosing New Script (Ctrl + N) Recitation 1. 10

Problem 2 Write a script that plots cos(t) and sin(t) versus t using 100 points uniformly distributed over the interval 0 to 4 Plot the cosine signal using a solid black curve, and the sine signal using a dotted blue curve Use the legend command to distinguish the curves in the plot Use the xlabel, ylabel, and title commands to label the plot Recitation 1. 11

Problem 3(A) Consider the capacitor shown below 1. What is i(t) in terms of v(t)? 2. What is the energy stored in the capacitor? 3. What is v(t) in terms of i(t)? 4. Can v(t) change instantaneously? Why? 5. Can i(t) change instantaneously? Recitation 1. 12

Problem 3(A) Solution Recitation 1. 13

Problem 3(A) Solution Recitation 1. 14

Problem 3(B) Consider the inductor shown below 1. What is v(t) in terms of i(t)? 2. What is the energy stored in the inductor? 3. What is i(t) in terms of v(t)? 4. Can i(t) change instantaneously? Why? 5. Can v(t) change instantaneously? Recitation 1. 15

Problem 3(B) Solution Recitation 1. 16

Problem 3(B) Solution Recitation 1. 17

Problem 4 Consider the RC circuit below, where the switched has been opened a long time before it is closed at time t = 0. 1. Determine v(0 ) and i(0 ) 2. Determine v(0 + ) and i(0 + ) 3. Determine v( ) and i( ) 4. Obtain an ODE that describes the response of v(t) for t 0 Recitation 1. 18

Problem 4 Solution Recitation 1. 19

Problem 4 Solution Recitation 1. 20

Problem 4 Solution Recitation 1. 21

Problem 4 Solution Recitation 1. 22

Problem 4 Solution Recitation 1. 23

Problem 5 Consider the RLC circuit below, where the switched has been closed a long time before it is opened at time t = 0. 1. Obtain an ODE that describes the response of i(t) for t 0. 2. Determine the initial conditions, i(t) and di/dt at time t = 0 +. 3. Determine i(t) after the switch has been opened a long time. Recitation 1. 24

Problem 5 Solution Recitation 1. 25

Problem 5 Solution Recitation 1. 26

Problem 5 Solution Recitation 1. 27

Problem 5 Solution Recitation 1. 28