1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

32
1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    216
  • download

    0

Transcript of 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

Page 1: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

1

Nodal Analysis

Discussion D2.3September 2006

Chapter 2Section 2-7

Page 2: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

2

Nodal Analysis

• Interested in finding the NODE VOLTAGES, which are taken as the variables to be determined

• For simplicity we start with circuits containing only current sources

Page 3: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

3

Nodal Analysis Steps

1. Select one of the n nodes as a reference node (that we define to be zero voltage, or ground). Assign voltages v1, v2, … vn-1 to the remaining n-1 nodes. These voltages are referenced with respect to the reference node.

2. Apply KCL to each of the n-1 non-reference nodes. Use Ohm’s law to express the branch currents in terms of the node voltages.

3. Solve the resulting simultaneous equations to obtain the node voltages v1, v2, … vn-1.

Page 4: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

4

Example

Select a reference node as ground. Assign voltages v1, v2, and v3 to the remaining 3 nodes.

1v 2v 3v

2A 1r

2r

3

r 4

r 5rsi

Page 5: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

5

Example

Apply KCL to each of the 3 non-reference nodes (sum of currents leaving node is zero).

2A 1r

2r

3

r 4

r 5rsi

1v 2v 3v

1i

2i

3i

4i

5i

1 22 0i i

2 3 4 0i i i

4 5 0si i i

Node 1:

Node 2:

Node 3:

Page 6: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

6

Example

Now express i1, i2, …i5 in terms of v1, v2, v3 (the node voltages). Note that current flows from a higher to a lower potential.

11

1

0vi

r

1 2

22

v vi

r

2

33

0vi

r

2 3

44

v vi

r

3

55

0vi

r

2A 1r

2r

3

r 4

r 5rsi

1v 2v 3v

1i

2i

3i

4i

5i

Page 7: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

7

1 22 0i i

2 3 4 0i i i

4 5 0si i i

Node 1:

Node 2:

Node 3:

1 1 2

1 2 2

2v v v

r r r

31 2 2 2

2 2 3 4 4

vv v v v

r r r r r

3 32

4 4 5s

v vvi

r r r

11

1

0vi

r

1 2

22

v vi

r

2

33

0vi

r

2 3

44

v vi

r

3

55

0vi

r

Page 8: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

8

2A 1r

2r

3

r 4

r 5rsi

1v 2v 3v

1i

2i

3i

4i

5i

In MATLAB, if 1 2 3 4 5[ ]r r r r r r

then

1 2 3 4 51 2 3 4 5

1 1 1 1 11 . / r [ ] [ g g ]g g g g

r r r r r

is a row matrix of the five conductances

Page 9: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

9

Node 1:

Node 2:

Node 3:

1 2 1 2 2 30 2g g v g v v

31 2 2 2

2 2 3 4 4

0vv v v v

r r r r r

3 32

4 4 5

0 s

v vvi

r r r

1 1 2

1 2 2

0 2v v v

r r r

2 1 2 3 4 2 4 3 0g v g g g v g v

1 4 2 4 5 30 sv g v g g v i

Page 10: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

10

1 2 2 1

2 2 3 4 4 2

4 4 5 3

0 2

0

0 s

g g g v

g g g g g v

g g g v i

These three equations can be written in matrix form as

2 1 2 3 4 2 4 3 0g v g g g v g v

1 2 1 2 2 30 2g g v g v v

1 4 2 4 5 30 sv g v g g v i

Page 11: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

11

Gv k

Gv

k

is an (n –1) x (n –1) symmetric conductance matrix

is a 1 x (n-1) vector of node voltages

is a vector of currents representing “known” currents

1 2 2 1

2 2 3 4 4 2

4 4 5 3

0 2

0

0 s

g g g v

g g g g g v

g g g v i

Page 12: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

12

Writing the Nodal Equations by Inspection

•The matrix G is symmetric, Gkj = Gjk and all of the off-diagonal terms are negative or zero.

The ki (the ith component of the vector k) = the algebraic sum of the independent currents connected to node i, with currents entering the node taken as positive.

The Gkj terms are the negative sum of the conductances connected to BOTH node k and node j.

The Gkk terms are the sum of all conductances connected to node k.

1 2 2 1

2 2 3 4 4 2

4 4 5 3

0 2

0

0 s

g g g v

g g g g g v

g g g v i

2A 1r

2r

3

r 4

r 5rsi

1v 2v 3v

1i

2i

3i

4i

5i

Page 13: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

13

Gv k

MATLAB Solution of Nodal Equations

1v G k

1 2 2 1

2 2 3 4 4 2

4 4 5 3

0 2

0

0 s

g g g v

g g g g g v

g g g v i

Page 14: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

14

1

2

3

1 1 2 1 0 2

1 1 1 4 1 3 1 3 0

0 1 3 1 3 1 2 1

v

v

v

v1 v2 v3

1

2

3

1.5 1 0 2

1 1.583 0.333 0

0 0.333 0.833 1

v

v

v

Test with numbers

2A 4

31

221A

1/3 S

1/4 S1/2 S

1/2 S1 S

Page 15: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

15

MATLAB Run

1

2

3

1.5 1 0 2

1 1.583 0.333 0

0 0.333 0.833 1

v

v

v

2A 4

31

221A

v1 v2 v3

Page 16: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

16

PSpice Simulation

MATLAB:

Page 17: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

17

Let's write a general MATLAB program to solve this problem

1 2 2 1

2 2 3 4 4 2

4 4 5 3

0 2

0

0 s

g g g v

g g g g g v

g g g v i

2A 1r

2r

3

r 4

r 5rsi

1v 2v 3v

1i

2i

3i

4i

5i

1 2 3 4 5[ ]r r r r r rInputs: [ 2; 0; ]sk i

Find all voltages and currents

Page 18: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

18

function nodal1(r,k)

% PowerPoint nodal example

% Discussion D2.3

% r is a 1 x 5 vector of resistances

% k is a 3 x 1 vector of known currents entering the three nodes

% nodal1(r,k)

%

g = 1 ./ r

G = [g(1)+g(2) -g(2) 0; -g(2) g(2)+g(3)+g(4) -g(4); 0 -g(4) g(4)+g(5)]

k

v = inv(G)*k

i(1) = v(1)*g(1);

i(2) = (v(1) - v(2))*g(2);

i(3) = v(2)*g(3);

i(4) = (v(2) - v(3))*g(4);

i(5) = v(3)*g(5);

i

kab = [i(1)+i(2) i(5)-i(4)]

2A 1r

2r

3

r 4

r 5rsi

1v 2v 3v

1i

2i

3i

4i

5i

Page 19: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

19

2A 4

31

221A

1/3 S

1/4 S1/2 S

1/2 S1 S

Do same problem as before

[2 1 4 3 2]r

[ 2; 0; ]sk i

nodal1(r,k)

Page 20: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

20

MATLAB Run

Page 21: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

21

Nodal Analysis for Circuits Containing Voltage Sources That Can’t be Transformed to Current Sources

• Case 1. If a voltage source is connected between the reference node and a nonreference node, set the voltage at the nonreference node equal to the voltage of the source.

• Case 2. If a voltage source is connected between two nonreference nodes, assume temporarily that the current through the voltage source is known and write the equations by inspection.

Page 22: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

22

Example

2A1g

0V 3g

2g 4gsi

DC1v 2v 3v

1i

2i

3i

4i

5i

Assume temporarily that i2 is known and write the equations by inspection.

1 1 2

2 3 3 2 2

3 3 4 3

0 0 2

0

0 s

g v i

g g g v i

g g g v i

Page 23: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

23

There appears to be 4 unknowns (v1, v2, v3, and i2) and only 3 equations. However, from the circuit

0 2 1V v v 1 2 0v v V or

so we can replace v1 (we could also replace v2) and write

1 1 2

2 3 3 2 2

3 3 4 3

0 0 2

0

0 s

g v i

g g g v i

g g g v i

1 2 0 2

2 3 3 2 2

3 3 4 3

0 0 2

0

0 s

g v V i

g g g v i

g g g v i

Page 24: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

24

Writing the above equation with the unknowns (v2, v3, i2) on the LHS yields

1 2 1 0

2 3 3 3

3 3 4 2

0 1 2

1 0

0 s

g v g V

g g g v

g g g i i

1 2 0 2

2 3 3 2 2

3 3 4 3

0 0 2

0

0 s

g v V i

g g g v i

g g g v i

Page 25: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

25

v1 v2 v3

Test with numbers

1 2

2 2

3

1 2 0 0 2

0 1 3 1 4 1 3

0 1 3 1 3 1 2 1

v i

v i

v

Noting that 1 2 2v v

2 2

2 2

3

1 2 0 0 2 2

0 1 3 1 4 1 3

0 1 3 1 3 1 2 1

v i

v i

v

2V

DC

2A g

g

g g1A

1/3 S

1/4 S1/2 S

1/2 S

i2

Page 26: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

26

v1 v2 v3

Test with numbers

Unknowns: 2 3 2 1 2, , ( 2)v v i v v

2 2

2 2

3

1 2 0 0 2 2

0 0.5833 1 3

0 1 3 0.8333 1

v i

v i

v

2

3

2

0.5 0 0 1

0.5833 0.3333 1 0

0.3333 0.8333 0 1

v

v

i

2V

DC

2A g

g

g g1A

1/3 S

1/4 S1/2 S

1/2 S

i2

Page 27: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

27

MATLAB Run

2

3

2

0.5 0 1 1

0.5833 0.3333 1 0

0.3333 0.8333 0 1

v

v

i

VVA

v1 v2 v3

1 2 2 2.6316Vv v v2v3

2V

DC

2A G

G

G G1A

1/3 S

1/4 S1/2 S

1/2 S

i2

i2

Page 28: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

28

PSpice Simulation

MATLAB: 1 2 2 2.6316Vv v v2v3i2

Page 29: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

29

Let's write a general MATLAB program to solve this problem

1 2 3 4[ ]g g g g gInputs: 1 0[ 2 ; 0; ]sk g V i

Find all voltages and currents

1 2 1 0

2 3 3 3

3 3 4 2

0 1 2

1 0

0 s

g v g V

g g g v

g g g i i

2A1g

0V 3g

2g 4gsi

DC1v 2v 3v

1i

2i

3i

4i

5i

Page 30: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

30

function nodal2(g,V0,is)% PowerPoint nodal-2 example% Discussion D2.3% g is a 1 x 4 vector of conductances% V0 = the known dc voltage source% is = the known dc current source% nodal2(g,V0,Is)%

G = [g(1) 0 1; g(2)+g(3) -g(3) -1; -g(3) g(3)+g(4) 0]k = [-2+g(1)*V0; 0; is]vvi = inv(G)*kv = zeros(1,3);v(2) = vvi(1);v(3) = vvi(2);v(1) = v(2)-V0;v

i(1) = v(1)*g(1);i(2) = vvi(3);i(3) = v(2)*g(2);i(4) = (v(2) - v(3))*g(3);i(5) = v(3)*g(4);ikab = [i(1)+i(2) i(5)-i(4)]

Page 31: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

31

Do same problem as before

[1/ 2 1/ 4 1/ 3 1/ 2]g

0 2V

nodal2(g,V0,is)

2V

DC

2A g

g

g g1A

1/3 S

1/4 S1/2 S

1/2 S

i2

1is

Page 32: 1 Nodal Analysis Discussion D2.3 September 2006 Chapter 2 Section 2-7.

32

MATLAB Run