summaryrefslogtreecommitdiff
path: root/3754/CH35/EX35.12/35_12.sce
blob: d494cbf7632a74c90c0463b478901f22d44c1acf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
clear//

//Variables

V1 = 0.1                                          //Voltage (in volts)
V2 = 1.0                                          //Voltage (in volts)
V3 = 0.5                                          //Voltage (in volts)         
R1 = 10.0 * 10**3                                 //Resistance (in ohm)
R2 = 10.0 * 10**3                                 //Resistance (in ohm)
R3 = 10.0 * 10**3                                 //Resistance (in ohm)
R4 = 22.0 * 10**3                                 //Resistance (in ohm)

//Calculation

Vout = (-R4/R1*V1) + (-R4/R2*V2) + (-R4/R3*V3)    //Output voltage (in volts)

//Result

printf("\n Output voltage is  %0.3f  V.",abs(Vout))