summaryrefslogtreecommitdiff
path: root/3754/CH12/EX12.15/12_15.sce
blob: d9f2d21386654c17088a5e296eaa8b375ce2c5f6 (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
28
29
30
31
32
33
clear//

//Variables

R = 3.3 * 10**3              //Resitance (in ohm) 

//Calculation

//Case (a)

V11=0;V21=0;
V01 = 0                      //Output Voltage (in volts)

//Case (b)

V21 = 0                      //Voltage (in volts)
V22 = 5                      //Voltage (in volts)
V02 = V22 - 0.7              //Output voltage (in volts)  

//Case (c)

V31 = 5                      //Voltage (in volts)
V32 = 0                      //Voltages (in volts)
V03 = V31 - 0.7              //Output voltage (in volts)  

//Case (d)

V41=5;V42=5;
V04 = V41 - 0.7              //Output voltage (in volts)  

//Result

printf("\n Output Voltage in case 1 is  %0.3f  V.\nOutput Voltage in case 2 is  %0.3f  V.\nOutput Voltage in case 3 is  %0.3f  V.\nOutput Voltage in case 4 is  %0.3f  V.",V01,V02,V03,V04)