blob: b0d4535b1bca078641db1f09f91856e72ff849af (
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
|
//CHAPTER 1- D.C. CIRCUIT ANALYSIS AND NETWORK THEOREMS
//Example 13
disp("CHAPTER 1");
disp("EXAMPLE 13");
//VARIABLE INITIALIZATION
v=10; //voltage source in Volts
I=5; //current source in Amperes
r1=2; //in Ohms
r2=2; //in Ohms
r3=4; //in Ohms
//SOLUTION
res=I+(v/r1);
vth=res/((1/r1)+(1/r2)); //by nodal analysis
rth=(r1*r2)/(r1+r2);
Ith=vth/(rth+r3);
disp(sprintf("By Thevenin Theorem, the current through resistor R3 is %d A",Ith));
//END
|