blob: 08039d13a68dadf5a965bade91d375a8c5acacef (
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 35
disp("CHAPTER 1");
disp("EXAMPLE 35");
//VARIABLE INITIALIZATION
I=10; //current source in Amperes
v=10; //voltage source in Volts
r1=4; //top resistance in Ohms
r2=4; //right resistance in Ohms
r3=4; //bottom resistance in Ohms
r4=6; //left resistance in Ohms
r5=1; //in Ohms
//SOLUTION
res=I+(v/r1);
va=res/((1/r4)+(1/r1));
vb=(v/r2)/((1/r2)+(1/r3));
vth=va-vb;
req1=(r1*r4)/(r1+r4);
req2=(r2*r3)/(r2+r3);
rth=req1+req2;
Ith=vth/(rth+r5);
disp(sprintf("By Thevenin Theorem, the current through 1Ω resistor is %f A",Ith));
//END
|