summaryrefslogtreecommitdiff
path: root/3754/CH20/EX20.17/20_17.sce
blob: f32161a16fd7d0c711b6ba32d276a1f226a99faf (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
clear//

//Variables

IZmin = 0                     //Minimun Zener current (in Ampere)
ILmax = 2.0                   //Maximum load current (in Ampere)
VL = 12.0                     //Voltage across load (in volts)
VSmin = 15.0                  //Minimum Input voltage (in volts)
VSmax = 20.0                  //Maximum Input Voltage (in volts)
beta = 100                    //common emitter current gain
VBE = 0.5                     //Voltage between base-emitter junction (in volts)
VZ = 12.5                     //Voltage across zener diode (in volts)
IZmin = 1.0 * 10**-3          //Current through Zener diode   
ICmax = ILmax                 //Maximum Collector current (in Ampere) 

//Calculation

IBmax = ICmax / beta          //Maximum collector current
IR = IBmax + IZmin            //Current through resistance R (in Ampere)
Rmax = (VSmin - VZ)/ IR       //Maximum value of resistance R (in ohm)
IZmax = (VSmax - VZ)/ Rmax    //Maximum value of Zener current (in Ampere)
PZmax = VZ * IZmax            //Maximum power dissipation in Zener Diode (in watt)
PRmax = (VSmax - VZ) * IZmax  //Maximum power dissipated in Resistance R (in watt)
VCEmax = VSmax - VL           //Maximum value of collector-to-emitter voltage (in volts)      
PDmax = VCEmax * ILmax        //Maximum power dissipation of the transistor (in watt)

//Result

printf("\n Maximum value of R is  %0.0f  ohm.\nMaximum power dissipation of the zener diode is  %0.2f  W.\nMaximum power dissipation of resistance R is  %0.2f  W.\nMaximum power dissipation of the transistor is  %0.3f  W.",Rmax,PZmax,PRmax,PDmax)