summaryrefslogtreecommitdiff
path: root/83/CH10/EX10.1/example_10_1.sce
blob: 5d84bb37837bd7bffc3c32ff11f20cbe6d7b8817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//Chapter 10
//Example 10.1
//page 374
//To calculate symmetrical components of line currents
clear;clc;
Ia=10*(cosd(30)+%i*sind(30));
Ib=15*(cosd(-60)+%i*sind(-60));
// from KCL Ia+Ib+Ic=0
Ic=-(Ia+Ib);
//defining alpha(a)
a=cosd(120)+(%i*sind(120));
Ip=[Ia;Ib;Ic];
A=[1 1 1;a^2 a 1;a a^2 1];
IA=inv(A)*Ip;
IB=diag([a^2,a,1])*IA;
IC=diag([a,a^2,1])*IA;

function [r,theta]=phasorform(x)
    r=abs(x);
    theta=atand(imag(x),real(x));
endfunction

[IAr,IAth]=phasorform(IA);
[IBr,IBth]=phasorform(IB);
[ICr,ICth]=phasorform(IC);

//to display the results of symettrical components of line currents

printf('\n\nIA1=%0.2f @ %d deg A',IAr(1,1),IAth(1,1));
printf('\nIA2=%0.2f @ %d deg A',IAr(2,1),IAth(2,1));
printf('\nIA0=%0.2f A',IAr(3,1));


printf('\n\nIB1=%0.2f @ %d deg A',IBr(1,1),IBth(1,1));
printf('\nIB2=%0.2f @ %d deg A',IBr(2,1),IBth(2,1));
printf('\nIB0=%0.2f A',IBr(3,1));


printf('\n\nIC1=%0.2f @ %d deg A',ICr(1,1),ICth(1,1));
printf('\nIC2=%0.2f @ %d deg A',ICr(2,1),ICth(2,1));
printf('\nIC0=%0.2f A',ICr(3,1));

//to calculate Delta currents

IAB=(Ia-Ib)/3;
IBC=(Ib-Ic)/3;
ICA=(Ic-Ia)/3;

//to get the results in phasor notation
[IABr,IABth]=phasorform(IAB);
[IBCr,IBCth]=phasorform(IBC);
[ICAr,ICAth]=phasorform(ICA);

printf('\n\nIAB=%0.2f @ %d deg A',IABr,IABth);
printf('\nIBC=%0.2f @ %d deg A',IBCr,IBCth);
printf('\nICA=%0.2f @ %d deg A',ICAr,ICAth);

//to calculte the symmetrical components of delta currents by reusing the variable Ip
Ip=[IAB;IBC;ICA];
IAB=inv(A)*Ip;
IBC=diag([a^2,a,1])*IAB;
ICA=diag([a,a^2,1])*IAB;

[IABr,IABth]=phasorform(IAB);
[IBCr,IBCth]=phasorform(IBC);
[ICAr,ICAth]=phasorform(ICA);

//to display the results of symmetrical components of Delta currents

printf('\n\nIAB1=%0.2f @ %d deg A',IABr(1,1),IABth(1,1));
printf('\nIAB2=%0.2f @ %d deg A',IABr(2,1),IABth(2,1));
printf('\nIAB0=%0.2f A',IABr(3,1));


printf('\n\nIBC1=%0.2f @ %d deg A',IBCr(1,1),IBCth(1,1));
printf('\nIBC2=%0.2f @ %d deg A',IBCr(2,1),IBCth(2,1));
printf('\nIBC0=%0.2f A',IBCr(3,1));


printf('\n\nICA1=%0.2f @ %d deg A',ICAr(1,1),ICAth(1,1));
printf('\nICA2=%0.2f @ %d deg A',ICAr(2,1),ICAth(2,1));
printf('\nICA0=%0.2f A\n\n',ICAr(3,1));