blob: 945b90242e6d7f800220201391dd12be06d73ace (
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 13
clc;
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
//solving by nodal analysis
res=I+(v/r1); //'res' is used to make the calculation easy
vth=res/((1/r1)+(1/r2)); //Thevenin voltage
rth=(r1*r2)/(r1+r2); //Thevenin resistance
Ith=vth/(rth+r3); //Thevenin current
disp(sprintf("By Thevenin Theorem, the current through resistor R3 is %d A",Ith));
//END
|