TUTORIAL: STATE VARIABLES and MATLAB

Similar documents
Lesson 14: Van der Pol Circuit and ode23s

Chapter 4 Transients. Chapter 4 Transients

Chapter 30 Inductance

Inductive & Capacitive Circuits. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

First-order transient

Initial conditions. Necessity and advantages: Initial conditions assist

Chapter 26 Direct-Current Circuits

Definition of differential equations and their classification. Methods of solution of first-order differential equations

Circuits Practice Websheet 18.1

Inductance, Inductors, RL Circuits & RC Circuits, LC, and RLC Circuits

Sinusoidal Response of RLC Circuits

The roots are found with the following two statements. We have denoted the polynomial as p1, and the roots as roots_ p1.

ENGR 2405 Chapter 8. Second Order Circuits

20D - Homework Assignment 4

Section 5.6 Integration by Parts

Inductance, RL and RLC Circuits

CLUSTER LEVEL WORK SHOP

Chapter 33. Alternating Current Circuits

Chapter 32. Inductance

2005 AP PHYSICS C: ELECTRICITY AND MAGNETISM FREE-RESPONSE QUESTIONS

Alternating Current Circuits. Home Work Solutions

Circuit Analysis-II. Circuit Analysis-II Lecture # 5 Monday 23 rd April, 18

RLC Series Circuit. We can define effective resistances for capacitors and inductors: 1 = Capacitive reactance:

Physics 116A Notes Fall 2004

Besides resistors, capacitors are one of the most common electronic components that you will encounter. Sometimes capacitors are components that one

Chapter three. Mathematical Modeling of mechanical end electrical systems. Laith Batarseh

Self-inductance A time-varying current in a circuit produces an induced emf opposing the emf that initially set up the time-varying current.

Linear System Theory

ECE 241L Fundamentals of Electrical Engineering. Experiment 5 Transient Response

Solving a RLC Circuit using Convolution with DERIVE for Windows

Exam 3--PHYS 102--S14

ECE2262 Electric Circuit

Transient Analysis of Electrical Circuits Using Runge- Kutta Method and its Application

Step Response of First-Order Systems

Version 001 CIRCUITS holland (1290) 1

Lecture 4: Dynamics of Equivalent Circuits

Introduction to AC Circuits (Capacitors and Inductors)

Active Figure 32.3 (SLIDESHOW MODE ONLY)

Compartmental Analysis

MET 487 Instrumentation and Automatic Control. Lecture 3

Chapter 2 Motion Along A Straight Line

AP Physics C. Inductance. Free Response Problems

STATE UNIVERSITY OF NEW YORK COLLEGE OF TECHNOLOGY CANTON, NEW YORK

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

STATE VARIABLE (SV) SYSTEMS

ENERGY AND TIME CONSTANTS IN RC CIRCUITS By: Iwana Loveu Student No Lab Section: 0003 Date: February 8, 2004

Electrical Circuits (2)

Problem Weight Score Total 100

QUESTION BANK SUBJECT: NETWORK ANALYSIS (10ES34)

Chapter 28. Direct Current Circuits

a + b Time Domain i(τ)dτ.

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

Assessment Schedule 2015 Physics: Demonstrate understanding of electrical systems (91526)

TSP10N60M / TSF10N60M

Figure Circuit for Question 1. Figure Circuit for Question 2

PROBLEMS FOR EXPERIMENT ES: ESTIMATING A SECOND Solutions

Switching Flow Graph Model

Physics Tutorial - Currents and Circuits

(competition between 2 species) (Laplace s equation, potential theory,electricity) dx4 (chemical reaction rates) (aerodynamics, stress analysis)

500V N-Channel MOSFET

STGWA40HP65FB2. Trench gate field-stop, 650 V, 40 A, high-speed HB2 series IGBT in a TO-247 long leads package. Datasheet. Features.

First Order RC and RL Transient Circuits

Chapter 5 Steady-State Sinusoidal Analysis

In addition to resistors that we have considered to date, there are two other basic electronic components that can be found everywhere: the capacitor

The RC Time Constant

EE1305/EE1105 Intro to Electrical and Computer Engineering Lecture Week 6

Laplace Transform Problems

Module 4. Single-phase AC Circuits

= D. 5. The displacement s (in cm) of a linkage joint of a robot is given by s = (4t-t 2 ) 213, where t is. Find the derivative.

d n 1 f dt n 1 + K+ a 0f = C cos(ωt + φ)

Inductance, RL Circuits, LC Circuits, RLC Circuits

Response of Second-Order Systems

Appendix 3B MATLAB Functions for Modeling and Time-domain analysis

Lecture 27: FRI 20 MAR

I(t) R L. RL Circuit: Fundamentals. a b. Specifications: E (emf) R (resistance) L (inductance) Switch S: a: current buildup. b: current shutdown

Unit 2 Electrical Quantities and Ohm s Law

Chapter 11 AC and DC Equivalent Circuit Modeling of the Discontinuous Conduction Mode

Inductors. Hydraulic analogy Duality with capacitor Charging and discharging. Lecture 12: Inductors

Laboratory 3 Measuring Capacitor Discharge with the MicroBLIP

Electric Circuits Fall 2015 Solution #5

400V N-Channel MOSFET GENERAL DESCRIPTION VDSS RDS(ON) ID. Features. Ordering Information 400V 0.55Ω 10.5A. This Power MOSFET is produced using

Converter System Modeling via MATLAB/Simulink

Project Components. MC34063 or equivalent. Bread Board. Energy Systems Research Laboratory, FIU

Chapter 1 Fundamental Concepts

HiPerFAST TM High Speed IGBT C2-Class w/ Diode

Note 11: Alternating Current (AC) Circuits

7.3 State Space Averaging!

CEE 271: Applied Mechanics II, Dynamics Lecture 1: Ch.12, Sec.1-3h

ACEPACK 2 converter inverter brake, 1200 V, 25 A trench gate field-stop IGBT M series, soft diode and NTC

Physics 212 Midterm 2 Form A

HFB20HJ20C. Ultrafast, Soft Recovery Diode. Features. Description. Absolute Maximum Ratings. 1 PD A V R = 200V I F(AV) = 20A

Motion in One Dimension

NETWORK ANALYSIS WITH APPLICATIONS

Oxygen Diffusion in Animal Cells Slab Model

Homework #5 Solutions

EE292: Fundamentals of ECE

Chapter 26 Direct-Current Circuits

Assessment Schedule 2016 Physics: Demonstrate understanding electrical systems (91526)

EDEXCEL NATIONALS UNIT 5 - ELECTRICAL AND ELECTRONIC PRINCIPLES. ASSIGNMENT No.2 - CAPACITOR NETWORK

Transcription:

TUTORIAL TUTORIAL: STATE VARIABLES and MATLAB Time-domain analysis of circuits with more than one L and C is difficult because it requires solution of characteristic equations higher than second degree. This supplement illustrates the use of MATLAB functions, ode23 and ode45, for solving a system of coupled first-order differential equations of the form dx/dt = f(x,t) where x is a vector called the state vector, and t is the independent variable, which in our case will be time. As indicated in Mastering MATLAB 7, Chapter 25, a differential equation can always be expressed as a system of coupled first-order differential equations. The MATLAB functions are powerful because they can be used to solve nonlinear as well as linear equations. differential Consider the third-order circuit in Fig. 1 as an example for illustrating the use of the state vector (state variables) and ode45. Let's use MATLAB to plot v 2 as a function of time. Using Kirchhoff's laws in the time domain, we could write the third-order differential equation for v 2 and then convert it to three coupled firstorder equations following the procedure outlined in the MATLAB book. It is much easier, however, to obtain the system of coupled first-order equations directly in terms of what are called the state variables. For circuits, the state variables are the currents through inductances and the voltages across capacitances. Using Kirchhoff's laws in the time domain, it is easy to write firstorder differential equations in terms of these variables because i = C dv/dt for a capacitance, and v = L di/dt for an inductance, both of which involve first derivatives.

b v 1 c C1 L i 1 d i 3 i 2 vg(t) R C2 v 2 a e Fig. 1. Third-order circuit. v g (t) is a step function that switches from v 0 to v 0 at t = 0. The state variables for the circuit in Fig. 1 are v 1, v 2, and i 1. The first equation is easily obtained from the relationship between the voltage and current for C 1 : (1) dv 1 /dt = i 1 /C The second equation is obtained by writing Kirchhoff's voltage equation around the closed path abcdea : -v g v 1 L di 1 /dt v 2 =0 from which we get (2) di 1 /dt = v 1 /L v 2 /L v g /L The third equation is obtained by using Kirchhoff's current law, i 1 = i 2 i 3 and i 3 = v 2 /R, i 2 = C 2 dv 2 /dt to get (3) dv 2 /dt = i 1 /C 2 - v 2 /RC 2 Now defining the state vector (note that x is a column vector) as (4) x = [ v 1 i 1 v 2 ]'

we get the three coupled first-order differential equations from (1), (2), (3), and (4): (5) dx 1 /dt = x 2 /C 1 (6) dx 2 /dt = x 1 /L x 3 /L v g /L (7) dx 3 /dt = x 2 /C 2 x 3 /RC 2 Before writing the program, we need the initial conditions on the vector x. The initial conditions for x are much easier to obtain than for the thirdorder differential equation for v2. Because the current cannot change instantaneously through an inductance, and because the voltage across a capacitance cannot change instantaneously, v 1 (0) = v 1 (0-) = v 0 i 1 (0) = i 1 (0-) = 0 v 2 (0) = v 2 (0-) = 0 The initial value of x is thus (8) x0 = [v 0 0 0]' The ode45 function requires a function that calculates xdot (which stands for dx/dt) as a function of t and x (see MATLAB book). Here is a function that calculates xdot as described by (5)-(7): function xdot = ckt(t,x) vg=1; C1=100e-9; C2=100e-9; R=30; L=184e-6; xdot(1) = x(2)/c1; xdot(2) = (x(1) x(3))/l vg/l; xdot(3) = x(2)/c2 x(3)/(r*c2); xdot = [xdot(1); xdot(2); xdot(3)];

To solve for x and plot v 2, we can now type the following in the command window: t0=0; tf=60e-6; tspan=[t0,tf]; x0=[-1 0 0]' ; [t,x]=ode45('ckt',tspan,x0); plot(t,x(:,3)) We could also plot all three components of x by using plot(t,x), as shown in Fig. 2. Fig. 2. Graph of the state vector x versus time for the circuit of Fig. 1. If tf is chosen to be too large, the matrix size limitation in the student edition of MATLAB will be exceeded. Also, sometimes choosing tf to be too large will cause a message "singularity expected," and the function will not be executed. EX: Use ode45 to solve for x for the circuit in Fig. 3 when R1 = 20 Ω, R2 = 5 Ω, C1 = 100 nf, C2 = 200 nf, L = 300 µh, vo = 1 V. Then plot i1 versus t and i3 versus t.

v 1 i 1 L R 1 C1 v (t) g i 3 C2 i 2 v 2 R 2 Fig. 3. The voltage v g (t) changes instantly from v o to v o at t = 0. GIVEN: x = [i 1 v 1 v 2 ]' dx 1 /dt = (x 3 x 2 )/L x 1 R 1 /L dx 2 /dt = x 1 /C 1 dx 3 /dt = x 1 /C 2 (v g x 3 )/(R 2 C 2 ) x o = [0 v o v o ]' ANS: 0.04 0.02 0-0.02 0 0.2 0.4 0.6 0.8 1 time (s) x10-4