summaryrefslogtreecommitdiff
path: root/2498/CH2/EX2.30/ex2_30.sce
blob: 425f09fc93630a95cad78d119007d124e4aabdac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Exa 2.30
clc;
clear;
close;
format('v',6)
// Given data
Vin = 10;// in V
V1 = 2;// in V
// Vin-V_C+V1 = 0;
V_C = Vin+V1;// in V
//During positive half cycle the output voltage 
Vout = Vin-V_C;// in V
disp(Vout,"During positive half cycle the output voltage in V is");
Vin = -10;// iin V
V1 = 12;// in V
// Vin-V1-Vout = 0;
//During negative half cycle the output voltage 
Vout = Vin-V1;// in V
disp(Vout,"During negative half cycle the output voltage in V is");