# Nodal Analysis Problem (Matlab and PSpice Output Included)

Discussion in 'Homework Help' started by smithc2005, Oct 2, 2009.

1. ### smithc2005 Thread Starter New Member

Oct 2, 2009
1
0
I have to solve for V0 , using nodal analysis. I am getting different answers in matlab and PSPICE. The circuit is below

2 supernodes ; or 1 big supernode Here are my nodal equations:

v1-v3 = 12
v3 - v2 = 6

(v3)/6k + (v1)/4k - 6/k = 0

Matlab output is here:

Code ( (Unknown Language)):
1. A=[1,0,-1;0,-1,1;.004,0,.006]
2. b=[12;6;.006]
3. format long
4. inv(A)*b
5.
6. A =
7.
8.     1.0000         0   -1.0000
9.          0   -1.0000    1.0000
10.     0.0040         0    0.0060
11.
12.
13. b =
14.
15.    12.0000
16.     6.0000
17.     0.0060
18.
19.
20. ans =
21.
22.    7.799999999999999
23.  -10.200000000000001
24.   -4.200000000000001
PSPICE Schematic:

So confused!!!!

Last edited: Oct 2, 2009
2. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
783
A couple of your matrix terms look wrong - you should have values like 1/4000 = .00025 and 1/6000 = 0.000167 there somewhere.

3. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
783
BTW - the PSPICE worked correctly.

4. ### Tesla23 Active Member

May 10, 2009
323
67
To doublecheck just use superposition and you can pretty well write down the solution:

Vo = -6/10*12 + 0 + 4/10*36 = ?

5. ### kaankarabulut New Member

Oct 3, 2009
3
0
7.2v is correct one. probably your equ is wrong

6. ### t_n_k AAC Fanatic!

Mar 6, 2009
5,448
783
Starting equations were correct but Matlab stuff should be like this ....

-->A
A =

1. 0. - 1.
0. - 1. 1.
0.00025 0. 0.0001667

-->b
b =

12.
6.
0.006

-->inv(A)*b
ans =

19.2
1.2
7.2