summaryrefslogtreecommitdiff
path: root/620/CH19/EX19.7/example19_7.sce
blob: e04fb6bd6a5d19c4f1cb95944c61fae6def400fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
l=30*10^(-3);
r=2000;
v=50;
disp("Part a");
t0=l/r;
t1=0;
v1=v*exp(-t1/t0);
disp("the initial voltage (in V) across the coil is"); disp(v1);
t2=7.5*10^(-6);
v2=v*exp(-t2/t0);
disp("the voltage (in V) across the coil 7.5 μs after closing th sitch is"); disp(v2);
disp("Part c");
t3=45*10^(-6);
i=v*(1-exp(-t2/t0))/r;
disp("the current (in mA) 45 μs after closing the switch is"); disp(i*10^3);
disp("Part d");
v3=37.5;
t4=-log(1-v3/v)*t0;
disp("the time taken (in μs) for voltage across resistor to reach 37.5 V is"); disp(t4*10^6);