DOING PHYSICS WITH MATLAB

Similar documents
DOING PHYSICS WITH MATLAB FINITE DIFFERENCE METHOD: NUMERICAL ANAYSIS OF RC CIRCUITS

1 Phasors and Alternating Currents

Chapter 33. Alternating Current Circuits

Learnabout Electronics - AC Theory

Alternating Current Circuits

AC Circuits Homework Set

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

Ch. 23 Electromagnetic Induction, AC Circuits, And Electrical Technologies

12 Chapter Driven RLC Circuits

Solutions to these tests are available online in some places (but not all explanations are good)...

Chapter 6 Objectives

Physics 4 Spring 1989 Lab 5 - AC Circuits

Physics 142 AC Circuits Page 1. AC Circuits. I ve had a perfectly lovely evening but this wasn t it. Groucho Marx

ELECTROMAGNETIC OSCILLATIONS AND ALTERNATING CURRENT

Physics 4B Chapter 31: Electromagnetic Oscillations and Alternating Current

ECE2262 Electric Circuits. Chapter 6: Capacitance and Inductance

Electromagnetic Oscillations and Alternating Current. 1. Electromagnetic oscillations and LC circuit 2. Alternating Current 3.

CHAPTER 22 ELECTROMAGNETIC INDUCTION

Capacitor. Capacitor (Cont d)

f = 1 T 6 a.c. (Alternating Current) Circuits Most signals of interest in electronics are periodic : they repeat regularly as a function of time.

ELECTRO MAGNETIC INDUCTION

Handout 11: AC circuit. AC generator

RLC Circuit (3) We can then write the differential equation for charge on the capacitor. The solution of this differential equation is

Sinusoidal Steady-State Analysis

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

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

Inductance, RL and RLC Circuits

Part 4: Electromagnetism. 4.1: Induction. A. Faraday's Law. The magnetic flux through a loop of wire is

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Physics 8.02 Spring 2003 Experiment 17: RLC Circuit (modified 4/15/2003) OBJECTIVES

Note 11: Alternating Current (AC) Circuits

Sinusoidal Response of RLC Circuits

Chapter 10: Sinusoids and Phasors

ELECTROMAGNETIC INDUCTION AND FARADAY S LAW

Driven RLC Circuits Challenge Problem Solutions

REACTANCE. By: Enzo Paterno Date: 03/2013

General Physics (PHY 2140)

Course Updates. Reminders: 1) Assignment #10 due Today. 2) Quiz # 5 Friday (Chap 29, 30) 3) Start AC Circuits

EXPERIMENT 07 TO STUDY DC RC CIRCUIT AND TRANSIENT PHENOMENA

Chapter 31 Electromagnetic Oscillations and Alternating Current LC Oscillations, Qualitatively

Alternating Current. Chapter 31. PowerPoint Lectures for University Physics, Twelfth Edition Hugh D. Young and Roger A. Freedman

I. Impedance of an R-L circuit.

SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING. Self-paced Course

Chapter 32A AC Circuits. A PowerPoint Presentation by Paul E. Tippens, Professor of Physics Southern Polytechnic State University

EM Oscillations. David J. Starling Penn State Hazleton PHYS 212

Lecture 21. Resonance and power in AC circuits. Physics 212 Lecture 21, Slide 1


Introduction to AC Circuits (Capacitors and Inductors)

Chapter 31: AC Circuits

Chapter 31: RLC Circuits. PHY2049: Chapter 31 1

Electrical Engineering Fundamentals for Non-Electrical Engineers

Physics for Scientists & Engineers 2

PHYS Fields and Waves

Alternating Current Circuits. Home Work Solutions

Physics 240 Fall 2005: Exam #3. Please print your name: Please list your discussion section number: Please list your discussion instructor:

MAY/JUNE 2006 Question & Model Answer IN BASIC ELECTRICITY 194

Chapter 32. Inductance

Experiment Guide for RC Circuits

CHAPTER 6. Inductance, Capacitance, and Mutual Inductance

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

Physics 240 Fall 2005: Exam #3 Solutions. Please print your name: Please list your discussion section number: Please list your discussion instructor:

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

ALTERNATING CURRENT

LINEAR CIRCUIT ANALYSIS (EED) U.E.T. TAXILA 09

Sinusoids and Phasors

ELECTRONICS E # 1 FUNDAMENTALS 2/2/2011

Slide 1 / 26. Inductance by Bryan Pflueger

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

Single Phase Parallel AC Circuits

University of California, Berkeley Physics H7B Spring 1999 (Strovink) SOLUTION TO PROBLEM SET 11 Solutions by P. Pebler

REVIEW EXERCISES. 2. What is the resulting action if switch (S) is opened after the capacitor (C) is fully charged? Se figure 4.27.

18 - ELECTROMAGNETIC INDUCTION AND ALTERNATING CURRENTS ( Answers at the end of all questions ) Page 1

Electromagnetic Induction Faraday s Law Lenz s Law Self-Inductance RL Circuits Energy in a Magnetic Field Mutual Inductance

The simplest type of alternating current is one which varies with time simple harmonically. It is represented by

Inductance. Slide 2 / 26. Slide 1 / 26. Slide 4 / 26. Slide 3 / 26. Slide 6 / 26. Slide 5 / 26. Mutual Inductance. Mutual Inductance.

Physics-272 Lecture 20. AC Power Resonant Circuits Phasors (2-dim vectors, amplitude and phase)

Physics 2112 Unit 20. Outline: Driven AC Circuits Phase of V and I Conceputally Mathematically With phasors

ELEC ELE TRO TR MAGNETIC INDUCTION

Circuit Analysis-III. Circuit Analysis-II Lecture # 3 Friday 06 th April, 18

Chapter 32. Inductance

Chapter 10: Sinusoidal Steady-State Analysis

PHYS 1441 Section 001 Lecture #23 Monday, Dec. 4, 2017

EE292: Fundamentals of ECE

Impedance/Reactance Problems

Energy Storage Elements: Capacitors and Inductors

2.4 Models of Oscillation

Inductance, RL Circuits, LC Circuits, RLC Circuits

Handout 10: Inductance. Self-Inductance and inductors

What happens when things change. Transient current and voltage relationships in a simple resistive circuit.

CLUSTER LEVEL WORK SHOP

Electrical Circuit & Network

Alternating Current. Symbol for A.C. source. A.C.

Lectures 16 & 17 Sinusoidal Signals, Complex Numbers, Phasors, Impedance & AC Circuits. Nov. 7 & 9, 2011

Module 4. Single-phase AC Circuits

Chapter 30. Inductance. PowerPoint Lectures for University Physics, 14th Edition Hugh D. Young and Roger A. Freedman Lectures by Jason Harlow

Unit 21 Capacitance in AC Circuits

mywbut.com Lesson 16 Solution of Current in AC Parallel and Seriesparallel

Chapter 21: RLC Circuits. PHY2054: Chapter 21 1

04-Electric Power. ECEGR 452 Renewable Energy Systems

Review of DC Electric Circuit. DC Electric Circuits Examples (source:

Impedance. Reactance. Capacitors

Transcription:

DOING PHYSIS WITH MATAB THE FINITE DIFFERENE METHOD FOR THE NUMERIA ANAYSIS OF IRUITS ONTAINING RESISTORS, APAITORS AND INDUTORS MATAB DOWNOAD DIRETORY N01.m Voltage and current for a resistor, capacitor and inductor calculations using the finite difference method. N02.m Animation of the phasors for a resistor, capacitor and inductor. view animation Numerical methods are often used to study mechanical systems. However, these same methods can be employed to investigate the response of circuits containing resistors, capacitors and inductors. A wide range of circuit responses for different signal inputs can be modelled very easily. For example, the transient response of circuits; the frequency response of filters and tuned circuits; resonance, damped and forced oscillations; voltage, current, power, energy and phase relationships. Also, the method can be used for circuit design. 1

No differential equations need to be solved and no integrals evaluated. All that is necessary is to model the incremental changes that occur in currents and voltages in a brief time period where the derivative of a function is approximated using a finite difference. Resistors, capacitors and inductors are basic components of circuits. These components are connected to a source of electrical energy. A simple model for the source of electrical energy is to consider it to be a voltage source called the emf and a series resistance called the internal resistance R int. The potential difference applied to a circuit is called the terminal voltage or input voltage v IN. If a current i IN is supplied from the electrical energy source to a circuit, the input (terminal) voltage is (1) vin iin RINT In the computer modelling of circuit behaviour, the effects of internal resistance of the source can be considered. Suitable electrical sources include step, on/off/on, sinusoidal and pulsed functions. The script N01.m is used to model the voltage across and current through the passive elements resistor, capacitor and inductor. 2

RESISTOR For a resistor R, the voltage vr () t across it and the current ir () t through it are always in phase and related by the equation v R (t) = R i(t) For a sinusoidal current through the resistor and the voltage across it are given by (2) i I cos t R R cos v R I cos t V t V I R R R R R R owercase letters are used for currents and voltages which are functions of time whereas uppercase letters are used for peak values (amplitude). Figures 1 and 2 show the graphical output from the script N01.m. The voltage across the resistor is in phase with the current such that the voltage is proportional to the current. 3

The ratio of the peak voltage to the peak current is called the impedance. VR (3) ZR R I R The resistance is independent of the input frequency. Fig. 1. The voltage across a 1000 and the current through it as functions of time. The current and voltage are in phase. I 100 ma R 1000 f 1000 Hz N01.m R 4

Fig. 2. The phase plot of the voltage across a 1000 against and the current through the resistor is a straight line. The reciprocal of the slope of the line is equal to the resistance. Numerical results are summarised in the ommand Window: input frequency f = 1000.00 Hz resistance R = 1000.00 ohms peak voltage VR = 100.00 V peak current IR = 100.00 ma impedance ZR = 1000.00 ohms theoretical impedance ZR_T = 1000.00 ohms 5

APAITOR A capacitor consists of two metal plates separated by an insulating material. When a potential difference v exists across a capacitor, one plate has a positive charge +q and the other plate a charge q. The charge q is proportional to the potential difference between the plates of the capacitor. The constant of proportionality is called the capacitance (farad F). (4) q( t) v ( t) Differentiating both sides of this equation with respect to t and using the fact that i dq / dt we get dv i (5) dt We can write this equation in terms of differences rather than differentials (6) v ( ) ( ) / t i t t 6

Thus, a capacitor will resist changes in the potential difference across it because it requires a time t for the potential difference to change by v. The potential difference across the capacitor decreases when it discharges and increases when charging. The larger the value of, the slower the change in potential. If t is small, then to a good approximation, the potential difference across the capacitor at time t is Forward difference (7A) v ( t) v ( t t) i ( t t) t / entral difference (7B) v ( t) v ( t 2 t) i ( t) 2 t / The magnitude of the impedance Z of a capacitor is called the capacitive reactance X and is equal to the ratio of peak voltage V to peak current I (8A) (8B) Z Z V X I X 1 Figures 3 and 4 show the graphical output of the script N01.m. It shows that the phase of the voltage lags the phase of the current by /2 rad. The phase plot for the capacitor (figure 4) sweeps out an ellipse with time in a clockwise sense. 7

The input corresponds to the current (9) i I cos t as shown by the red cosine curve in figure 3. The blue curve corresponds to the voltage across the capacitor calculated using the finite difference method. The voltage across the capacitor corresponds to a sine curve (10) v V sin t V cos t / 2 The voltage and current are not in phase. The instantaneous voltage v () t lags the instantaneous current i () t by /2 rad. The ommand Window displays a summary of the results for the capacitor calculations using the script N01.m input frequency f = 1000.00 Hz capacitance = 1.00e-06 F peak voltage V = 15.93 V peak current I = 100.00 ma impedance Z = 159.26 ohms (equation 8A) theoretical impedance Z_T = 159.15 ohms (equation 8B) 8

Fig. 3. The voltage across a 1.00 F capacitor and the capacitor current as functions of time. The capacitor voltage lags the capacitor current by /2 rad. I 100 ma 1.00 μf f 1000 Hz N01.m 9

Fig. 4. The phase plot of the voltage across a 1.00 μfcapacitor against and the capacitor current is an ellipse that is swept out with time in a clockwise sense. 10

INDUTOR An inductor can be considered to be a coil of wire. When a varying current passes through the coil, a varying magnetic flux is produced and this in turn induces a potential difference across the inductor. This induced potential difference opposes the change in current. The potential difference across the inductor is proportional to the rate of change of the current, where the constant of proportionality is known as the inductance of the coil (henrys H) and is given by the equation (11) v = di/dt This equation can be expressed in terms of differences, (12) i ( t) v ( t) t / Thus, an inductor will resist changes in the current through it because it requires a time t for the current to change by i. 11

If t is small, then to a good approximation, the current through the inductor at time t is Forward difference (13A) i ( t) i ( t t) v ( t t) t / entral difference (13B) i ( t) i ( t 2 t) v ( t t) 2 t / The magnitude of the impedance Z of an inductor is called the inductive reactance X and is equal to the ratio of peak voltage V to peak current I (14A) Z V X I (15B) Z X Figures 5 and 6 show the graphical output of the script N01.m. It shows that the voltage leads the current by /2 rad. The phase plot for the inductor (figure 6) sweeps out an ellipse with time in an anticlockwise sense. 12

The input corresponds to the voltage (9) v v sin t as shown by the blue sine curve in figure 5. The red curve corresponds to the inductor current calculated using the finite difference method (equation 13). The inductor current corresponds to a negative cosine curve (10) i I sin t / 2 I cos t The voltage and current are not in phase. The instantaneous current i () t lags the instantaneous voltage v () t by /2 rad. Alternatively, the instantaneous voltage v () t leads the instantaneous current i () t by /2 rad. The ommand Window displays a summary of the results for the capacitor calculations using the script N01.m input frequency f = 1000.00 Hz inductance = 1.00e-02 H peak voltage V = 10.00 V peak current I = 159.13 ma impedance Z = 62.84 ohms (equation 14A) theoretical impedance Z_T = 62.83 ohms (equation 14B) 13

Fig. 5. The voltage across a 10.0 mh inductor and the inductor current as functions of time. The inductor voltage leads the capacitor current by /2 rad. V 10.0 V 100 mh f 1000 Hz N01.m Fig. 6. The phase plot of the voltage across a 100 mh inductor against and the inductor current is an ellipse that is swept out with time in a clockwise sense. 14

The phases between the voltage and currents can be shown in phasor diagrams such as shown in figure 7. The phasors rotate anticlockwise with an angular velocity. One rotation is completed in a time interval of one period T 2 /. An animation of the phasors was created with the script N02.m. view animation 15

Fig. 7. Phasor diagrams for a resistor, capacitor and inductor. The phasors rotate anticlockwise with an angular velocity. Resistor: voltage and current in phase. apacitor: voltage lags current by / 2 rad. Inductor: Voltage leads current by / 2 rad. 16

Matlab Script N01.m All parameters are expressed in S.I. Units unless stated otherwise. The input parameters are specified in the INPUT section % INPUTS: S.I. UNITS ================================= R = 1.0e3; = 1e-6; = 10e-3; IR = 0.10; I = 0.10; V = 10; f = 1e3; N = 200; It is very easy to implement the finite difference routines. % AUATIONS ========================================================= = T = 1/f; w = 2*pi*f; tmax = 2*T; t = linspace(0,tmax,n); dt = t(2)-t(1); ir = IR.*cos(w*t); vr = R.* ir; k = 2*dt/; i = I.* cos(w*t); v = zeros(1,n); v(2) = v(1)+(dt/)*i(1); k = 2*dt/; v = V.* sin(w*t); 17

i = zeros(1,n); i(2) = i(1)+(dt/)*v(1); for c = 3 : N-1 v(c) = v(c-2) + k*i(c-1); i(c) = i(c-2) + k*v(c-1); %i(c) = i(c-1)+(dt/)*v(c-1); end i = i - max(i)/2; % not sure why need to shift the current % Peak values /Impedances / reactances VR = max(vr); IR = max(ir); V = max(v); I = max(i); V = max(v); I = max(i); ZR = VR/IR; Z = V/I; Z = V/I; % resistance % capacitive reactance % inductive reactance % Theorteical values for impedance ZR_T = VR/IR; Z_T = 1/(w*); Z_T = w*; 18

DOING PHYSIS WITH MATAB http://www.physics.usyd.edu.au/teach_res/mp/mphome.htm Ian ooper email: ian.cooper@sydney.edu.au School of Physics, University of Sydney, Australia 19