summaryrefslogtreecommitdiff
path: root/3793/CH4/EX4.9/exp_4_9.sce
blob: 469b8424316c3518bb075ffc1876fa81deaa4898 (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
84
85
86
87
88
clear;
clc;
function [A,B,C,D,Vs] = trmlnper(r,L,g,CC,l,Vr,Pr,pf,pftype);
    Vs=zeros(2,1);
    z=r+%i*2*%pi*50*L;
    y=g+%i*2*%pi*50*CC;
    gammma=sqrt(z*y);
    Zc=sqrt(z/y);
    mprintf("Line 1 for distributed and 2 for lumped(pi equivalent) , 2 for medium lines, 3 for short line\n");
    type1=input ('Type of line');
    if type1==0;
        A=cosh(gammma*l);
        B=Zc*sinh(gammma*l);
        C=sinh(gammma*l)/Zc;
        D=A;
        else
    end
    if type1==1;
        Zd=(z*l*sinh(gammma*l))/(gammma*l);
        Yd=(y*l*tanh(gammma*l/2))/(gammma*l/2);
        A=(1+(Yd*Zd/2));
        B=Zd;
        C=Yd*(1+(Yd*Zd/4));
        D=A;
        else
    end
    if type1==2;
        Z=z*l;
        Y=y*l;
        A=(1+(Y*Z/2));
        B=Z;
        C=Y*(1+(Y*Z/4));
        D=A;
        else
        
    end
    if type1==3;
        Z=z*l;
        A=1;
        B=Z
        C=0;
        D=A;
        else
    end
    Ir=Pr/(sqrt(3)*Vr*pf);
    Vr=Vr/sqrt(3);
    phi=acosd(pf);
    if pftype==0;
        phi=-phi;
        else
    end
    Ir=Ir*(cosd(phi)+%i*sind(phi));
    [Vs]=[A B;C D]*[Vr;Ir];
    vS=abs(Vs(1));
    deltaVs=atand(imag(Vs(1))/real(Vs(1)));
    Is=abs(Vs(2));
    deltaIs=atand(imag(Vs(2))/real(Vs(2)));
    ps=(Vs(1)*(Vs(2))');
    pS=real(ps)*3;
    inlos=3*(pS-Pr);
    effy=(1-inlos/pS)*100;
    reg=(vS-abs(Vr))/(abs(Vr));
    vS=sqrt(3)*vS;
    mprintf("Sending end per phase voltage %.4f+%.4f kV\n",real(Vs(1)),imag(Vs(1)));
mprintf("Ending end line to line voltage %4f kV\n",vS);
mprintf("Sending end current %.4f%.4fj A\n.",real(Vs(2)),imag(Vs(2)));
mprintf("three phase sending power %.4f MW\n",pS);
mprintf("total line loss %.4f MW\n",inlos);
mprintf("efficincy %.4f\n",effy);
mprintf("Regulation %.4f",reg);
    
endfunction

r=.0781;
L=.746*(10^-3);
g=0;
CC=.00995*(10^-6);
Vr=66;
l=130;
Pr=24;
pf=.8;
pftype=0;
[A,B,C,D,Vs] = trmlnper(r,L,g,CC,l,Vr,Pr,pf,pftype);