summaryrefslogtreecommitdiff
path: root/3809/CH6/EX6.7/EX6_7.sce
blob: fba76de47fe64be7aaac49b0b9fea6a2b8340f83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//Chapter 6, Example 6.7
clc
//Initialisation
pi=3.14                       //pi
f=50                          //frequency in hertz
L=400*10**-3                  //inductance in hemry
C=50*10**-6                   //capacitance in farad
R=200                         //resistance in ohm

//Calculation
w=2*pi*f                       //angular frequency
Xl=w*L                         //inductive reactance
Xc=1/(w*C)                     //Capacitive Reactance
X=Xl-Xc                         //Complex part

//Results
printf("Complex Impedance = %d + j %d Ohm",R, round(X))