summaryrefslogtreecommitdiff
path: root/1529/CH18/EX18.12/18_12.sce
blob: 5bb5e9e2272c469d14ac0a5cab3a11ce11cf2d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//Chapter 18, Problem 12
clc;
//initializing the variables:
L = 6;              //inductance in henry
r = 10;             //resistance in ohms
V = 120;            //supply voltage
taw = 0.3;          //time constant
t1 = 1;             // in secs

//calculation:
R = (L/taw) - r
Rt = R + r
I = V/Rt
i2 = 0.1*I
i1 = I*(%e^(-1*t1/taw))
t2 = -1*taw*log((i2/I))

printf("\n (a)Resistance of the coil = %.0f ohm\n\n",R)
printf("\n (b)Current flowing in the circuit one second after the shorting link has been placed = %.3f A\n\n",i1)
printf("\n (c)The time for the current to decay to 0.1 times of initial value = %.3f sec\n\n",t2)