blob: 20596387df5e4a4b68835685025cabc4e75113ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
//CHAPTER 1- D.C. CIRCUIT ANALYSIS AND NETWORK THEOREMS
//Example 53
disp("CHAPTER 1");
disp("EXAMPLE 53");
//VARIABLE INITIALIZATION
v1=10; //LHS voltage source in Volts
v2=4; //RHS voltage source in Volts
r1=2; //LHS resistance in Ohms
r2=3; //in Ohms
r3=10; //in Ohms
r4=3; //in Ohms
r5=1; //RHS resistance in Ohms
//SOLUTION
van=v1*(r2/(r1+r2)); //by voltage divider law
vbn=-v2*(r4/(r5+r4)); //by voltage divider law
ran=(r1*r2)/(r1+r2);
rbn=(r4*r5)/(r4+r5);
vab=(ran*0)+van-vbn+(rbn*0);
vth=vab;
disp(sprintf("The Thevenin voltage is %d V",vth));
//END
|