summaryrefslogtreecommitdiff
path: root/1958/CH12/EX12.5/Chapter12_example12_5.sce
blob: f5b29f409c6e8eba4259a4bf65365b087194503f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
clc
clear
//Input data
L=50//Inductance in mH
R=5//Resistance in ohms
V=6//Volatage of the battery in V
t=5//Time in ms

//Calculations
t1=(L/R)//Time constant in ms
I=(V/R)*(1-exp(-t/t1))//Current in A

//Output
printf('The time constant of the circuit is %i ms \n The current in the circuit is %3.2f A',t1,I)