summaryrefslogtreecommitdiff
path: root/3754/CH21/EX21.6/21_6.sce
blob: 57eea43ae4de47e7d15c55e06ec93cfe2b9c6860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
clear//

//Variables

TON = 30.0                 //Chopper ON time (in milli-second)
TOFF = 10.0                //Chopper OFF time (in milli-second)   
Vdc = 200.0                //dc voltage (in volts)

//Calculation

T = TON + TOFF             //Total time (in milli-second)
cdc = TON / T              //Chopper duty cycle
VL = Vdc * cdc             //dc output voltage (in volts)  

//Result

printf("\n Average valuye of dc voltage is  %0.3f  V.",VL)