summaryrefslogtreecommitdiff
path: root/3836/CH12/EX12.5/Ex12_5.sce
blob: 668b0596d72426693c0a68e571214bf18bf50d31 (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
clear
//Initialization
r1=100                  //Resistance in Ohm
r2=200                 //Resistance in Ohm
r3=50                 //Resistance in Ohm
v1=15                 //voltage source
v2=20                 //voltage source

//Calculation
//Considering 15 V as a source & replace the other voltage source by its internal resistance,
r11=(r2*r3)*(r2+r3)**-1              //resistance in parallel
v11=v1*(r11/(r1+r11))               //voltage
//Considering 20 V as a source & replace the other voltage source by its internal resistance,
r22=(r1*r3)*(r1+r3)**-1              //resistance in parallel
v22=v2*(r22/(r2+r22))               //voltage

//output of the original circuit
v33=v11+v22



//Results
printf("\n Voltage, V = %.2f",v33)