summaryrefslogtreecommitdiff
path: root/3835/CH2/EX2.30/Ex2_30.sce
blob: 68913d18279c9e606aaa4279b4172f268b5d3c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
clear
//
v=120
r=40
i=v/(r)
//applying kvl to the closed loop
v=3*520
printf("\n voltage= %0.1f  v",v)
//when v=120,R can be found by I*(r+20)=120-->r=20
r=20
printf("\n r=20 ohm")
//when r=20 total r=20+20+20=60
r=60
l=10
tc=l/(r) //time constant
printf("\n tc= %0.1f  sec",tc)
//i=I0*e^-(t/tc)=3*e^(-6t)
energy=(10*9)/(2)
benergy=0.05*energy
printf("\n balance energy= %0.1f  J",benergy)
//(L*i^2)/2=2.25-->hence i=0.6708
//3*e^-6t=0.6708-->e^-6t=0.2236-->applying log on both sides we get t=0.25
printf("\n t=0.25 sec")