blob: 6ba7e6e0e3ccd1b3012e08f985c2c291c0187888 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
//Chapter 18, Problem 9
clc;
//initializing the variables:
L = 0.04; //inductance in henry
R = 10; //resistance in ohms
V = 120; //supply voltage
//calculation:
taw = L/R
t1 = taw
I = V/R
i1 = I*(1 - %e^(-1*t1/taw))
i2 = 0.01*I
t2 = -1*taw*log(i2/I)
printf("(a)The final value of current = %.0f A\n\n",I);
printf("(b)Time constant of the circuit = %.3f sec\n\n",taw);
printf("(c)Value of current after a time equal to the time constant = %.2f A\n\n",i1);
printf("(d)The expected time for the current to rise to within 0.01 times of its final value = %.2f sec\n\n",t2);
|