Continuous Time Linear Systems EE 350 Recitation 1 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved 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 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved 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 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved 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 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 4 Basic Operations MATLAB supports basic operations and can be used as a calculator Operation MATLAB Example addition subtraction multiplication division power 200 350 300 200 4 16 24 6 24 6 4 2 Result 550 100 64 4 0 25 16 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 5 Built In Functions There are a host of useful functions Operation natural logarithm logarithm Base 10 exponent ex square root cos radians cosd degrees MATLAB Example log 10 log10 10 exp 1 sqrt 100 cos pi cosd 45 Result 2 3026 2 7183 1 10 1 0 7071 To learn about a function xyz type help xyz School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved 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 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 7 Problem 1 x e j 4 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 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved 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 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved 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 10 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 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 Publish the m file and plot to a PDF file 11 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 MATLAB Publish Tool Set the Output file format to PDF Choose the Output folder 12 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 PDF Output File 13 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Consider the capacitor shown below Problem 3 i t C v t 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 14 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 3 Solution 15 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 3 Solution 16 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Consider the inductor shown below Problem 4 i t L v t 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 17 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 4 Solution 18 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 4 Solution 19 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 5 Consider the RC circuit below where the switch has been opened a long time before it is closed at time t 0 1R 2R t 0 i t C sV v t 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 20 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Problem 5 Solution 21 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 5 Solution 22 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 5 Solution 23 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 5 Solution 24 School of Electrical Engineering and Computer Science Jeffrey Schiano 2019 2026 All rights reserved Recitation 1 Problem 6 Consider the RLC circuit below where the switch has been closed a long time before it is opened at time t 0 i t L R C sV t 0 sR 1 Obtain an ODE that describes the response of i t for t 0 2
View Full Document