Solutions to Systems of Linear Equations

Similar documents
Review of Ohm's Law: The potential drop across a resistor is given by Ohm's Law: V= IR where I is the current and R is the resistance.

Exercise 2: Kirchhoff s Current Law/2 Sources

LABORATORY 4 ELECTRIC CIRCUITS I. Objectives

AP PHYSICS C: ELECTRICITY AND MAGNETISM 2015 SCORING GUIDELINES

Experiment #6. Thevenin Equivalent Circuits and Power Transfer

Fig. 1-1 Current Flow in a Resistive load

Chapter 2. Engr228 Circuit Analysis. Dr Curtis Nelson

FF505 Computational Science. Matrix Calculus. Marco Chiarandini

Chapter 8: Linear Algebraic Equations

POLYTECHNIC UNIVERSITY Electrical Engineering Department. EE SOPHOMORE LABORATORY Experiment 2 DC circuits and network theorems

INTRODUCTION TO ELECTRONICS

Engineering Fundamentals and Problem Solving, 6e

Chapter - 1 Direct Current Circuits

52 VOLTAGE, CURRENT, RESISTANCE, AND POWER

Lecture Notes on DC Network Theory

resistance in the circuit. When voltage and current values are known, apply Ohm s law to determine circuit resistance. R = E/I ( )

Clicker Session Currents, DC Circuits

09-Circuit Theorems Text: , 4.8. ECEGR 210 Electric Circuits I

Electricity & Magnetism

Series & Parallel Resistors 3/17/2015 1

Chapter 8 Linear Algebraic Equations

Numerical Methods Lecture 2 Simultaneous Equations

+ MATRIX VARIABLES AND TWO DIMENSIONAL ARRAYS

EE-201 Review Exam I. 1. The voltage Vx in the circuit below is: (1) 3V (2) 2V (3) -2V (4) 1V (5) -1V (6) None of above

Outline. Week 5: Circuits. Course Notes: 3.5. Goals: Use linear algebra to determine voltage drops and branch currents.

9. Introduction and Chapter Objectives

Matrices. A matrix is a method of writing a set of numbers using rows and columns. Cells in a matrix can be referenced in the form.

Syllabus and Course Overview!

= e = e 3 = = 4.98%

Chapter 19 Lecture Notes

Graphical Solutions of Linear Systems

UNIT 4 DC EQUIVALENT CIRCUIT AND NETWORK THEOREMS

Solution: Based on the slope of q(t): 20 A for 0 t 1 s dt = 0 for 3 t 4 s. 20 A for 4 t 5 s 0 for t 5 s 20 C. t (s) 20 C. i (A) Fig. P1.

Writing Circuit Equations

CHAPTER D.C. CIRCUITS

Come & Join Us at VUSTUDENTS.net

Review of Circuit Analysis

Phy301- Circuit Theory

Direct Current (DC): In a DC circuit the current and voltage are constant as a function of time. Power (P): Rate of doing work P = dw/dt units = Watts

Circuit Analysis and Ohm s Law

Preamble. Circuit Analysis II. Mesh Analysis. When circuits get really complex methods learned so far will still work,

Calendar Update Energy of Charges Intro to Circuits Ohm s Law Analog Discovery MATLAB What s next?

Prepare for this experiment!

DC motor / generator. Jeffrey A. Meunier

EE301 RESISTANCE AND OHM S LAW

Switch. R 5 V Capacitor. ower upply. Voltmete. Goals. Introduction

ConcepTest PowerPoints

Direct-Current Circuits. Physics 231 Lecture 6-1

CHARGES IN AN ELECTRIC FIELD

Prepare for this experiment!

Differential Equations and Linear Algebra Supplementary Notes. Simon J.A. Malham. Department of Mathematics, Heriot-Watt University

Greek Letter Omega Ω = Ohm (Volts per Ampere)

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,

Notes on Electricity (Circuits)

6. MESH ANALYSIS 6.1 INTRODUCTION

Physics 3150, Laboratory X January 22, 2014 Ann Onymous (lab partner: John Doe)

Q-2 How many coulombs of charge leave the power supply during each second?

3-3 Complex Numbers. Simplify. SOLUTION: 2. SOLUTION: 3. (4i)( 3i) SOLUTION: 4. SOLUTION: 5. SOLUTION: esolutions Manual - Powered by Cognero Page 1

Consider the following generalized simple circuit

Power lines. Why do birds sitting on a high-voltage power line survive?

COOKBOOK KVL AND KCL A COMPLETE GUIDE

Analysis of Mesh Circuit Using Linear Algebra

DC CIRCUIT ANALYSIS. Loop Equations

Circuits. PHY2054: Chapter 18 1

4.2 Graphs of Rational Functions

Fundamentals of Electric Circuits, Second Edition - Alexander/Sadiku

STEAM Clown Production. Series Circuits. STEAM Clown & Productions Copyright 2017 STEAM Clown. Page 2

Ohm's Law and Resistance

DC STEADY STATE CIRCUIT ANALYSIS

Ch 28-DC Circuits! 1.) EMF & Terminal Voltage! 9.0 V 8.7 V 8.7 V. V =! " Ir. Terminal Open circuit internal! voltage voltage (emf) resistance" 2.

What to Add Next time you update?

US ARMY INTELLIGENCE CENTER CIRCUITS

Series/Parallel Circuit Simplification: Kirchoff, Thevenin & Norton

The General Resistor Circuit Problem

Active loads in amplifier circuits

MAE140 HW3 Solutions

B.3 Solving Equations Algebraically and Graphically

ES250: Electrical Science. HW1: Electric Circuit Variables, Elements and Kirchhoff s Laws

7.6 The Inverse of a Square Matrix

CHAPTER FOUR CIRCUIT THEOREMS

Exercise 2: The DC Ohmmeter

Chapter 10 AC Analysis Using Phasors

Coulomb s constant k = 9x10 9 N m 2 /C 2

Physics 102: Lecture 06 Kirchhoff s Laws

Voltage Dividers, Nodal, and Mesh Analysis

Gr. 11 Physics Electricity

Agenda for Today. Elements of Physics II. Resistance Resistors Series Parallel Ohm s law Electric Circuits. Current Kirchoff s laws

Basic Linear Algebra in MATLAB

Chapter 7 Direct-Current Circuits

Rectangular Systems and Echelon Forms

Elementary Theory of DC Permanent Magnet Motors

ECE Homework Set 2

Brian Blais Quick Homemade Guide to Circuits

18.06 Problem Set 1 - Solutions Due Wednesday, 12 September 2007 at 4 pm in

Physics for Scientists & Engineers 2

Experiment 4. RC Circuits. Observe and qualitatively describe the charging and discharging (decay) of the voltage on a capacitor.

Simple Resistive Circuits

Activity 1: Investigating Temperature

MATH 1130 Exam 1 Review Sheet

Electrical Engineering Fundamentals for Non-Electrical Engineers

Transcription:

Solutions to Systems of Linear Equations 5 Overview In this chapter we studying the solution of sets of simultaneous linear equations using matrix methods. The first section considers the graphical interpretation of such solutions. Graphical Interpretation In engineering problem solving the need to solve a set of simultaneous linear equations arises frequently Note: We keep specializing the system of equations to linear equations since in the modeling of large systems, linear approximations are a reasonable first approach and in many cases sufficient for design purposes To develop an appreciation for what is really happening when we ask the computer solve a set of simultaneous linear equations, we will explore graphical solutions first Chapter 5: Overview 5

A Pair of Linear Equations with Two Unknowns In the x-y plane we can write y m x + b y m 2 x + b 2 (5.) We know that m is the slope and b is the y-intercept y y mx+ b b x Depending upon how will m, m 2, b and b 2 are chosen, the lines Intersect at a point if m m 2 Be parallel to one another if m m 2, but b b 2 Be the same line if m m 2 and b b 2 y Parallel y Same Line y x x x Point of Intersection Chapter 5: Graphical Interpretation 5 2

To obtain a matrix formulation of this problem we would first rewrite (5.) as m x m 2 x y b y b 2 (5.2) or m m 2 x y b b 2 (5.3) The two lines intersect in a point if the matrix inverse m m 2 (5.4) exists; why? Consider m m 2 m m 2 x y m m 2 b b 2 0 0 I Chapter 5: Graphical Interpretation 5 3

Thus the intersection point has x-y coordinates x y m m 2 b b 2 (5.5) Linear Equations with Three Unknowns: The Intersection of Planes The equation for a plane in the space x-y-z is given by z ax+ by+ c Two planes (two equations and three unknowns) may Intersect in a line (multiple solutions) Lie parallel to one another (no solutions) Be the same plane (multiple solutions) Three planes (three equations and three unknowns) may Intersect in a single point (a single solutions) Intersect in a line (multiple solutions) Form three parallel planes (no solutions) Be the same plane (multiple solutions) Other possibilities (see book) Chapter 5: Graphical Interpretation 5 4

x z y Two Planes Intersecting in a Line Three Parallel Planes Plane #2 Plane #3 Plane # Unique Point of Intersection M Hyperplanes of N Variables Each The generalization of the above ideas is consider a hyperplane defined in N-dimensional space a x + a 2 x 2 + a 3 x 3 + + a N x N 0 Chapter 5: Graphical Interpretation 5 5

We can not actually draw hyperplanes beyond N 3, but the concept of solving M simultaneous equations of N unknowns, extends from the notions developed for three dimensions In the following assume the M hyperplanes are unique If M< N we say that the system is underspecified and a unique solution does not exist As an example consider how two planes may intersect in a line (here M 2 and N 3) If M N a unique solution is possible if none of the hyperplanes are parallel to each other As an examples consider how three faces of a cube intersect in a point If M> N we say that the system is overspecified and a unique solution does not exist As an example consider how three lines in the plane may pair-wise intersect, but not have a common solution When a unique solution exists we say that the system of equations is nonsingular When no unique solution exists we say the system of equations is singular Chapter 5: Graphical Interpretation 5 6

Solutions Using Matrix Operations The two equations and two unknowns given in (5.2) can be cast into a more general notation as follows a x + a 2 x 2 b a 2 x + a 22 x 2 b 2 Extending to N equations and N unknowns we have a x + a 2 x 2 + + a N x N b a 2 x + a 22 x 2 + + a 2N x N b 2 a N x + a N2 x 2 + + a NN x N b N (5.6) If we let a a 2 a N x b A a 2 a 22 x, X 2, B a N a NN x N b 2 b N (5.7) we can write (5.6) in matrix form AX B Not that we could also write (5.6) as X T A T B T (5.8) (5.9) Chapter 5: Solutions Using Matrix Operations 5 7

This follows from the matrix theory result that Note: (5.9) is simply another way expressing a system of N equations and N unknowns as a matrix equation Matrix Division In MATLAB solving matrix equations of the form (5.8) and (5.9) is very easy Two basic approaches are available In this subsection we consider the use of matrix division Given (the form of (5.8)) is the matrix equation, with X the quantity of interest, we use matrix left division as follows X A\B; % Note the backslash The numerical technique used here is Gauss elimination Given (the form of (5.8)) is the matrix equation, with X the quantity of interest, we use matrix right division as follows X A/B; % Note the backslash Example: N 2» A [ 2; 3 4];» B [2; 5];» X A\B ( GH) T H T G T AX XA B B Chapter 5: Solutions Using Matrix Operations 5 8

X.0000 0.5000» Xt B'/A' Xt.0000 0.5000 %The same solutions as expected If the solution is singular MATLAB gives Nan s or Inf s If the solution is nearly singular, a warning message is given Matrix Inverse As shown in (5.5) an alternate solution approach involves the use of the matrix inverse, i.e., if then but A A I and IX X, so In MATLAB this would be written as X inv(a)*b; A AX B AX A X A B B (5.0) Chapter 5: Solutions Using Matrix Operations 5 9

Using (5.9) the solution is which reduces to X T A T ( A T ) B T ( A T ) X T B T ( A T ) (5.) Example: Practice! p. 57 (2,6) Solve the following systems of equations using both matrix division and inverse matrices. For systems with just two variables (unknowns), plot the equations on the same graph to see the intersection (unique solution) or show that the system is singular (without a unique solution). 2. A system of two equations and two unknowns: 2x + x 2 3 2x + x 2 Load the system into MATLAB with A 2 2, B 3» A [-2 ; -2 ]; B [-3; ];» % Solve using matrix division:» X A\B Warning: Matrix is singular to working precision. Chapter 5: Solutions Using Matrix Operations 5 0

X Inf Inf» % Solve using the matrix inverse, first check» % to see if rank is 2» rank(a) ans» % Unique solution does not exist Now we plot the two equations to see what is going on with regard to the solution» x -0:.:0;» x2_ 2*x - 3;» x2_2 2*x + ;» s length(x);» plot(x(:0:s),x2_(:0:s),'s',x(:0:s),... x2_2(:0:s),'d')% Plot symbols at a few points» legend('first Eqn','Second Eqn')» hold Current plot held» plot(x,x2_,x,x2_2) % Plot lines with all points» grid» title('plot of Two Equations for #2','fontsize',6)» ylabel('x2','fontsize',4)» xlabel('x','fontsize',4) Chapter 5: Solutions Using Matrix Operations 5

25 20 Plot of Two Equations for #2 First Eqn Second Eqn 5 0 5 x2 0-5 -0-5 -20-25 -0-8 -6-4 -2 0 2 4 6 8 0 6. A system of three equations and three unknowns: x 3x + 2x 2 x 3 x + 3x 2 + 2x 3 x x 2 x 3 Chapter 5: Solutions Using Matrix Operations 5 2

Load the system into MATLAB with A 3 2 3 2, B» A [3 2 -; - 3 2; - -]; B [; ; ];» % Solve using matrix division:» X A\B X 9.0000-6.0000 4.0000» %Solve using the matrix inverse, first check rank:» rank(a) ans 3» X inv(a)*b X 9.0000-6.0000 4.0000» % Solutions agree! The three planes must intersect at the point (9,-6,4) Chapter 5: Solutions Using Matrix Operations 5 3

Problem Solving Applied: Electrical Circuit Analysis In the solution of electrical circuit problems we must deal with systems of linear equations. The electrical engineering curriculum does not take this subject lightly. The electrical engineering BSEE program devotes two semesters to circuit analysis Two semesters to electronic circuits analysis One semester to the study of signals and systems The foundation of circuit analysis are Kirchoff s voltage and current laws We will briefly introduce these two laws here, but to keep things simple we will only consider resistor networks with direct current (dc) or ideal battery sources Kirchoff s Voltage Law The sum of voltage drops (or rises) around a closed loop in a circuit (without any independent current sources in series) is zero. The voltage drop across a resistive element is the current through the element times the element resistance, e.g. ohms law i v + - R Ohms Law v ir Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 4

A simple application: v + - + - R R 2 i + - Kirchoff s voltage law applied to the single loop current gives v + R i + R 2 i 0 i or ( R + R 2 )i v Kirchoff s Current Law The sum of currents leaving (or entering) a node in a circuit (without any independent voltage sources attached) is zero. Again ohm s law comes in handy A Simple Example: v + - R v 2 + R 2 - Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 5

Kirchoff s current law applied to node voltage or ( v 2 v ) -------------------- R ( v 2 0) + ------------------ 0 R 2 v 2 gives ----- + ----- (assume v v2 ----- v R R 2 R is known) Example: A three loop current network with five resistors and two voltage sources. R R 3 R 5 v + - R 2 R 4 i2 i i 3 + - v 2 Here we have three loops, hence we can write three equations to solve for the three unknowns i, i 2, and i 3 The first loop equation has a voltage source and two resistors; the resistor R 2 has current i flowing from top to bottom and current i 2 flowing from bottom to top v + R i + ( i i 2 )R 2 0 or ( R + R 2 )i R 2 i 2 v (5.2) Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 6

The second loop equation involves three resistors, but all three loop currents appear in the equation ( i 2 i )R 2 + i 2 R 3 + ( i 2 i 3 )R 4 0 or R 2 i + ( R 2 + R 3 + R 4 )i 2 R 4 i 3 0 (5.3) The third loop equation as with the first involves a voltage source and two resistors ( i 3 i 2 )R 4 + i 3 R 5 + v 2 0 or R 4 i 2 + ( R 4 + R 5 )i 3 v 2 (5.4) Putting (5.2 4) together in matrix form we have ( R + R 2 ) R 2 0 R 2 ( R 2 + R 3 + R 4 ) R 4 i i 2 v 0 (5.5) 0 R 4 ( R 4 + R 5 ) i 3 v 2. Problem Statement: Solve (5.5) for the mesh currents i, i 2, and i 3 given as inputs the resistor values R through R 5 and the voltages v and v 2 Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 7

2. Input/Output Description: The I/O diagram is shown below Resistor Values Voltage Source Values MATLAB Solution 3. Hand Calculation: For a hand calculation assume that R R 2 R 3 R 4 R 5 ohm Mesh Currents v 5 volts and v 2 6 volts We must solve 2 0 3 0 2 i i 2 i 3 5 0 6 We solve this using MATLAB s left division command and then check the solution by computing the error» A [2-0; - 3 -; 0-2];» B [5; 0; 6];» X A\B X 3.8750 % Units of amps 2.7500 % Units of amps 4.3750 % Units of amps Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 8

» Error sum(a*x-b) Error -2.6645e-05 % Very small 4. MATLAB Solution: A script will be written which prompts the user to supply the five resistor values followed by the two voltage values. % Three-loop Circuit, three_loop.m % Five resistors and two voltage sources % % Prompt user to enter resistor values: R input('enter [R R2... R5] in ohms--> '); % Prompt user to enter voltage source values: V input('enter voltage values [v v2] in volts--> '); % Fill the A matrix and the B vector: A [R()+R(2) -R(2) 0; -R(2) R(2)+R(3)+R(4) -R(4); 0 -R(4) R(4)+R(5)]; B [V(); 0; -V(2)]; % Make sure solution is not singular if rank(a) 3 fprintf('the mesh currents in amps are: \n'); i A\B else fprintf('the solution is not unique'); end % Were Done! Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 9

5. Test Results: First check out the hand calculated value» three_loop Enter [R R2... R5] in ohms--> [ ] Enter voltage values [v v2] in volts--> [5-6] The mesh currents in amps are: i 3.8750 2.7500 <<--Values all agree with hand calculation 4.3750 Try different resistor values and turn voltage source» three_loop Enter [R R2... R5] in ohms--> [2 3 2 3 2] Enter voltage values [v v2] in volts--> [5 0] The mesh currents in amps are: v 2 off. i.409 0.688 % All currents in amps 0.409» % Check the solution error» Error sum(a*i-b) % better check sum(abs(a*i-b)) Error.02e-05 % Small so solution seems reasonable Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 20

Example: The circuit of text problem 4 (text Fig. 5.5) worked with node voltages. R R 2 v R 3 v 2 v a + - R 4 R 5 Reference Node The circuit of text Figure 5.5 as shown above contains three loops, yet only two node voltages (excluding the ground or reference node) Using node voltages we can solve for all the quantities of interest by only writing two equations for node voltages as opposed to three current equations At node ( v ) we have ( v v a ) v -------------------- ----- ( v v 2 ) + + -------------------- 0 R 2 R 4 R 3 Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 2

or ----- + ----- + ----- v -----v 2 R 2 R 3 R 4 R 3 v a ----- R 2 (5.6) At node 2 ( v 2 ) we have ( v 2 v a ) ( v -------------------- 2 v ) v + -------------------- + ----- 2 0 or R R 3 R 5 -----v R 3 + ----- + ----- + ----- v2 R R 3 R 5 v a ----- R (5.7) In matrix form (5.6) and (5.7) become ----- + ----- + ----- ----- R 2 R 3 ----- R 3 R 4 ----- R R 3 + ----- + ----- R 3 R 5 v v 2 v a ----- R 2 v a ----- R (5.8) Chapter 5: Problem Solving Applied: Electrical Circuit Analysis 5 22