summaryrefslogtreecommitdiff
path: root/3793
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3793
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3793')
-rw-r--r--3793/CH1/EX1.1/Exp1_1.sce25
-rw-r--r--3793/CH10/EX10.1/exp_10_1.sce8
-rw-r--r--3793/CH10/EX10.10/exp_10_10.sce62
-rw-r--r--3793/CH10/EX10.2/exp_10_2.sce8
-rw-r--r--3793/CH10/EX10.3/exp_10_3.sce10
-rw-r--r--3793/CH10/EX10.4/exp_10_4.sce63
-rw-r--r--3793/CH10/EX10.5/exp_10_5.sce33
-rw-r--r--3793/CH10/EX10.6/exp_10_6.sce60
-rw-r--r--3793/CH10/EX10.7/exp_10_7.sce57
-rw-r--r--3793/CH10/EX10.8/exp_10_8.sce31
-rw-r--r--3793/CH10/EX10.9/exp_10_9.sce41
-rw-r--r--3793/CH11/EX11.1/exp_11_1.sce25
-rw-r--r--3793/CH11/EX11.2/exp_11_2.sce17
-rw-r--r--3793/CH11/EX11.3/exp_11_3.sce47
-rw-r--r--3793/CH11/EX11.4/exp_11_4.sce38
-rw-r--r--3793/CH11/EX11.5/exp_11_5.sce21
-rw-r--r--3793/CH11/EX11.9/exp_11_9.sce24
-rw-r--r--3793/CH12/EX12.1/exp_12_1.sce22
-rw-r--r--3793/CH12/EX12.2/exp_12_2.sce27
-rw-r--r--3793/CH12/EX12.3/exp_12_3.sce18
-rw-r--r--3793/CH13/EX13.1/exp_13_1.sce23
-rw-r--r--3793/CH13/EX13.2/exp_13_2.sce53
-rw-r--r--3793/CH13/EX13.3/exp_13_3.sce61
-rw-r--r--3793/CH13/EX13.4/exp_13_4.sce10
-rw-r--r--3793/CH13/EX13.6/exp_13_6.sce62
-rw-r--r--3793/CH13/EX13.7/exp_13_7.sce69
-rw-r--r--3793/CH13/EX13.8/exp_13_8.sce58
-rw-r--r--3793/CH13/EX13.9/exp_13_9.sce68
-rw-r--r--3793/CH14/EX14.1/exp_14_1.sce32
-rw-r--r--3793/CH14/EX14.2/exp_14_2.sce38
-rw-r--r--3793/CH14/EX14.3/exp_14_3.sce31
-rw-r--r--3793/CH14/EX14.4/exp_14_4.sce63
-rw-r--r--3793/CH15/EX15.1/exp_15_1.sce11
-rw-r--r--3793/CH15/EX15.2/exp_15_2.sce17
-rw-r--r--3793/CH15/EX15.3/exp_15_3.sce12
-rw-r--r--3793/CH15/EX15.4/exp_15_4.sce12
-rw-r--r--3793/CH15/EX15.5/exp_15_5.sce13
-rw-r--r--3793/CH15/EX15.6/exp_15_6.sce8
-rw-r--r--3793/CH2/EX2.2/exp_2_2.sce25
-rw-r--r--3793/CH2/EX2.3/exp_2_3.sce26
-rw-r--r--3793/CH2/EX2.5/exp_2_5.sce47
-rw-r--r--3793/CH3/EX3.1/exp_3_1.sce9
-rw-r--r--3793/CH3/EX3.10/exp_3_10.sce19
-rw-r--r--3793/CH3/EX3.11/exp_3_11.sce7
-rw-r--r--3793/CH3/EX3.2/exp_3_2.sce22
-rw-r--r--3793/CH3/EX3.3/exp_3_3.sce22
-rw-r--r--3793/CH3/EX3.4/exp_3_4.sce14
-rw-r--r--3793/CH3/EX3.5/exp_3_5.sce20
-rw-r--r--3793/CH3/EX3.6/exp_3_6.sce20
-rw-r--r--3793/CH3/EX3.8/exp_3_8.sce12
-rw-r--r--3793/CH3/EX3.9/exp_3_9.sce19
-rw-r--r--3793/CH4/EX4.1/exp_4_1.sce25
-rw-r--r--3793/CH4/EX4.10/exp_.sce22
-rw-r--r--3793/CH4/EX4.11/exp_4_11.sce37
-rw-r--r--3793/CH4/EX4.12/exp_4_12.sce16
-rw-r--r--3793/CH4/EX4.13/exp_4_13.sce23
-rw-r--r--3793/CH4/EX4.14/exp_4_14.sce26
-rw-r--r--3793/CH4/EX4.15/exp_4_15.sce43
-rw-r--r--3793/CH4/EX4.16/exp_4_16.sce25
-rw-r--r--3793/CH4/EX4.4/exp_4_4.sce13
-rw-r--r--3793/CH4/EX4.5/exp_4_5.sce23
-rw-r--r--3793/CH4/EX4.6/exp_4_6.sce32
-rw-r--r--3793/CH4/EX4.7/exp_4_7.sce13
-rw-r--r--3793/CH4/EX4.8/exp_4_8.sce27
-rw-r--r--3793/CH4/EX4.9/exp_4_9.sce88
-rw-r--r--3793/CH5/EX5.1/exp_5_1.sce18
-rw-r--r--3793/CH5/EX5.2/exp_5_2.sce42
-rw-r--r--3793/CH5/EX5.3/exp_5_3.sce54
-rw-r--r--3793/CH5/EX5.4/exp_5_4.sce39
-rw-r--r--3793/CH5/EX5.5/exp_5_5.sce19
-rw-r--r--3793/CH5/EX5.6/exp_5_6.sce20
-rw-r--r--3793/CH5/EX5.7/exp_5_7.sce17
-rw-r--r--3793/CH5/EX5.8/exp_5_8.sce18
-rw-r--r--3793/CH5/EX5.9/exp_5_9.sce33
-rw-r--r--3793/CH6/EX6.1/exp_6_1.sce17
-rw-r--r--3793/CH6/EX6.3/exp_6_3.sce31
-rw-r--r--3793/CH6/EX6.4/exp_6_4.sce18
-rw-r--r--3793/CH6/EX6.5/exp_6_5.sce62
-rw-r--r--3793/CH6/EX6.6/exp_6_6.sce52
-rw-r--r--3793/CH6/EX6.7/exp_6_7.sce67
-rw-r--r--3793/CH6/EX6.8/exp_6_8.sce71
-rw-r--r--3793/CH8/EX8.3/exp_8_3.sce15
-rw-r--r--3793/CH8/EX8.4/exp_8_4.sce15
-rw-r--r--3793/CH8/EX8.5/exp_8_5.sce14
-rw-r--r--3793/CH8/EX8.6/exp_8_6.sce23
-rw-r--r--3793/CH8/EX8.7/exp_8_7.sce34
-rw-r--r--3793/CH8/EX8.8/exp_8_8.sce11
-rw-r--r--3793/CH9/EX9.1/exp_9_1.sce33
-rw-r--r--3793/CH9/EX9.2/exp_9_2.sce76
-rw-r--r--3793/CH9/EX9.3/exp_9_3.sce46
90 files changed, 2798 insertions, 0 deletions
diff --git a/3793/CH1/EX1.1/Exp1_1.sce b/3793/CH1/EX1.1/Exp1_1.sce
new file mode 100644
index 000000000..f77c629b2
--- /dev/null
+++ b/3793/CH1/EX1.1/Exp1_1.sce
@@ -0,0 +1,25 @@
+//Chapter 1 Example 1
+//Daily Variation of Load
+L = [1 0 6 4
+ 2 6 9 8
+ 3 9 11 12
+ 4 11 14 18
+ 5 14 18 15
+ 6 18 20 12
+ 7 20 22 8
+ 9 22 24 4];
+
+t_int = length(L(:,1));
+
+//Calculate the energy
+energy = 0;
+for i = 1:t_int
+ energy = energy + (L(i,3) - L(i,2))*L(i,4);
+end
+davg = energy/24; ///Daily Average power
+mload = max(L(:,4)); ///Max Load
+LF = davg/mload; ///Load Factor
+plot2d2(L(:,2), L(:,4));
+title('Daily Load Curve')
+xlabel('Time in hours')
+ylabel('Load in MW')
diff --git a/3793/CH10/EX10.1/exp_10_1.sce b/3793/CH10/EX10.1/exp_10_1.sce
new file mode 100644
index 000000000..a2cc2b3f7
--- /dev/null
+++ b/3793/CH10/EX10.1/exp_10_1.sce
@@ -0,0 +1,8 @@
+clear;
+clc;
+v=[complex(100,0);complex(-75,129.90);complex(-105,-181.865)];
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+vs=inv(A)*v;
+mprintf("symmetrical components of phase voltages are \n");
+disp(vs);
diff --git a/3793/CH10/EX10.10/exp_10_10.sce b/3793/CH10/EX10.10/exp_10_10.sce
new file mode 100644
index 000000000..07622ccf9
--- /dev/null
+++ b/3793/CH10/EX10.10/exp_10_10.sce
@@ -0,0 +1,62 @@
+clear;
+clc;
+Sb=30;
+vb=11;
+sg=20;
+p=10;
+R=6.6;
+//generator
+X1=complex(0,.1);
+X2=complex(0,.1);
+X0=complex(0,.15);
+x1=X1*(Sb/sg);
+x2=X2*(Sb/sg);
+x0=X0*(Sb/sg);
+//transformer12
+xt1=complex(0,.12);
+xt2=complex(0,.12);
+xt0=complex(0,.12);
+//transmission line
+vtr=22;
+Ztr=vtr^2/Sb;
+Z=complex(1,5);
+Zpu=Z/Ztr;
+//transformer34
+Xt1=complex(0,.05);
+Xt2=complex(0,.05);
+Xt0=complex(0,.05);
+xtt1=Xt1*(Sb/sg);
+xtt2=Xt2*(Sb/sg);
+xtt0=Xt0*(Sb/sg);
+Vf3=1;
+Rpu=((Vf3^2)*Sb)/p;
+Rf=(R*Sb)/vtr^2;
+Il=p/Sb;
+Vf4=Vf3+(Il*xtt1);
+Zfp=((x1+xt1+Zpu)*(Rpu+xtt1))/(x1+xt1++Zpu+Rpu+xtt1);
+Zfn=Zfp;
+zf0=Zpu+xt1;
+Ia1=Vf3/complex(1.611,1.5); //from figure
+Ia0=Ia1;
+Ia2=Ia1;
+Ia=3*Ia1;
+Ip23=(Rpu+xtt1)*Ia1/((x1+xt1+Zpu)+Rpu+xtt1);
+Ip34=Ia1-Ip23;
+In23=Ip23;
+In34=Ip34;
+Iz23=Ia1;
+Iz34=0;
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+I23=[Iz23;Ip23;In23];
+II=A*I23;
+mprintf("Current for node 2-3 is Ia=%f%f A Ib=%f+%f A Ic=%f+%f A\n",real(II(1,1)),imag(II(1,1)),real(II(2,1)),imag(II(2,1)),real(II(3,1)),imag(II(3,1)));
+I34=[Iz34;Ip34;In34];
+III=A*I34;
+mprintf("Current for node 3-4 is Ia=%f+%f A Ib=%f%f A Ic=%f%f A\n",real(III(1,1)),imag(III(1,1)),real(III(2,1)),imag(III(2,1)),real(III(3,1)),imag(III(3,1)));
+Vp2=Vf3+(Zpu*Ip23);
+Vn2=Zpu*Ip23;
+Vz2=Zpu*Ia1;
+Vz=[Vz2;Vp2;Vn2];
+V=A*Vz;
+mprintf("Phase voltages at node 2 are Va=%f+%f Kv Vb=%f%f Kv Vc=%f+%f Kv",real(V(1,1)),imag(V(1,1)),real(V(2,1)),imag(V(2,1)),real(V(3,1)),imag(V(3,1)));
diff --git a/3793/CH10/EX10.2/exp_10_2.sce b/3793/CH10/EX10.2/exp_10_2.sce
new file mode 100644
index 000000000..8610c3784
--- /dev/null
+++ b/3793/CH10/EX10.2/exp_10_2.sce
@@ -0,0 +1,8 @@
+clear;
+clc;
+I=[complex(0,0);complex(5.006,-2.89);complex(4.087,4.087)];
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+Ip=A*I;
+mprintf("line currents are \n");
+disp(Ip);
diff --git a/3793/CH10/EX10.3/exp_10_3.sce b/3793/CH10/EX10.3/exp_10_3.sce
new file mode 100644
index 000000000..463404ddd
--- /dev/null
+++ b/3793/CH10/EX10.3/exp_10_3.sce
@@ -0,0 +1,10 @@
+clear;
+clc;
+Zabc=[4 1 1;1 4 1;1 1 4];
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+Z012=inv(A)*Zabc*A;
+mprintf("Sequence impedence matrix\n");
+disp(Z012);
+
+
diff --git a/3793/CH10/EX10.4/exp_10_4.sce b/3793/CH10/EX10.4/exp_10_4.sce
new file mode 100644
index 000000000..75707c17e
--- /dev/null
+++ b/3793/CH10/EX10.4/exp_10_4.sce
@@ -0,0 +1,63 @@
+clear;
+clc;
+Sb=100;
+//generator 1
+x0=complex(0,.08);
+s=100;
+v=11;
+z=3;
+Zb=v^2/s;
+X=z/Zb;
+x=z*X;
+mprintf("Magnitutde of grounding reactor for G1 %.3f\n",x);
+//generator 2
+s1=50;
+x1=complex(0,.05);
+sm=25;
+xm=complex(0,.05);
+z1=x1*(Sb/s1);
+zm=xm*(Sb/sm);
+mprintf("pu reactance for G2 is %.3f\n",imag(z1));
+mprintf("pu reactance for M is %.3f\n",imag(zm));
+//transformers
+s12=100;
+x12=.1;
+z12=x12*(Sb/s12);
+mprintf("pu reactance for T12 is %.3f\n",imag(z12));
+s34=50;
+x34=complex(0,.075);
+z34=x34*(Sb/s34);
+mprintf("pu reactance for T34 is %.3f\n",imag(z34));
+s45=50;
+x45=complex(0,.08);
+z45=x45*(Sb/s45);
+mprintf("pu reactance for T45 is %.3f\n",imag(z45));
+s67=50;
+x67=complex(0,.076);
+z67=x67*(Sb/s67);
+mprintf("pu reactance for T67 is %.3f\n",imag(z67));
+s78=75;
+x78=complex(0,.06);
+z78=x78*(Sb/s78);
+mprintf("pu reactance for T78 is %.3f\n",imag(z78));
+vb=132;
+zb=vb^2/s;
+X11=z/zb;
+x11=z*X11;
+mprintf("pu reactance for zero sequence is %.3f\n",x11);
+Zt23=vb^2/s;
+xt23=complex(0,300);
+zt23=xt23/Zt23;
+mprintf("pu reactance for Tr23 is %.3f\n",imag(zt23));
+Zt28=vb^2/s;
+xt28=complex(0,250);
+zt28=xt28/Zt28;
+mprintf("pu reactance for Tr28 is %.3f\n",imag(zt28));
+vt=66;
+Zt56=vt^2/s;
+xt56=complex(0,200);
+zt56=xt56/Zt56;
+mprintf("pu reactance for Tr56 is %.3f\n",imag(zt56));
+
+
+
diff --git a/3793/CH10/EX10.5/exp_10_5.sce b/3793/CH10/EX10.5/exp_10_5.sce
new file mode 100644
index 000000000..62c8e4af8
--- /dev/null
+++ b/3793/CH10/EX10.5/exp_10_5.sce
@@ -0,0 +1,33 @@
+clear;
+clc;
+s=30;
+v=11;
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+xs=complex(0,.5);
+xn=complex(0,.3);
+xz=complex(0,.08);
+Z=5;
+X=(Z*s)/v^2;
+Xn=complex(0,3*X);
+Ea=complex(1,0);
+Ia1=Ea/(Xn+xn+xs+xz);
+Ia=3*Ia1;
+Va0=-Ia1*(xz+Xn);
+Va1=Ea-(Ia1*xs);
+Va2=-Ia1*xn;
+V1=[Va0;Va1;Va2];
+V=A*V1;
+Vab=V(1,1)-V(2,1);
+Vbc=V(2,1)-V(3,1);
+Vca=V(3,1)-V(1,1);
+Ibase=(s*1000)/(sqrt(3)*v);
+If=Ia1*Ibase;
+Vab1=Vab*(v/sqrt(3));
+Vbc1=Vbc*(v/sqrt(3));
+Vca1=Vca*(v/sqrt(3));
+mprintf("Sub transient fault current is %.3f A \n",imag(If));
+mprintf("Actual Line Voltages are Vab=%f+%f Kv Vbc=%f%f Kv Vca=%f+%f Kv",real(Vab1),imag(Vab1),real(Vbc1),imag(Vbc1),real(Vca1),imag(Vca1));
+
+
+
diff --git a/3793/CH10/EX10.6/exp_10_6.sce b/3793/CH10/EX10.6/exp_10_6.sce
new file mode 100644
index 000000000..e0b2e8bf7
--- /dev/null
+++ b/3793/CH10/EX10.6/exp_10_6.sce
@@ -0,0 +1,60 @@
+clear;
+clc;
+Sb=30;
+vb=11;
+sg=20;
+p=10;
+R=6.6;
+//generator
+X1=complex(0,.1);
+X2=complex(0,.1);
+X0=complex(0,.15);
+x1=X1*(Sb/sg);
+x2=X2*(Sb/sg);
+x0=X0*(Sb/sg);
+//transformer12
+xt1=complex(0,.12);
+xt2=complex(0,.12);
+xt0=complex(0,.12);
+//transmission line
+vtr=22;
+Ztr=vtr^2/Sb;
+Z=complex(1,5);
+Zpu=Z/Ztr;
+//transformer34
+Xt1=complex(0,.05);
+Xt2=complex(0,.05);
+Xt0=complex(0,.05);
+xtt1=Xt1*(Sb/sg);
+xtt2=Xt2*(Sb/sg);
+xtt0=Xt0*(Sb/sg);
+Vf3=1;
+Rpu=((Vf3^2)*Sb)/p;
+Rf=(R*Sb)/vtr^2;
+Il=p/Sb;
+Vf4=Vf3+(Il*xtt1);
+Zfp=((x1+xt1+Zpu)*(Rpu+xtt1))/(x1+xt1++Zpu+Rpu+xtt1);
+Zfn=Zfp;
+zf0=Zpu+xt1;
+Ia1=Vf3/complex(1.611,1.5); //from figure
+Ia0=Ia1;
+Ia=3*Ia1;
+Va0=-zf0*Ia0;
+Va1=Vf3-(Zfn*Ia1);
+Va2=-(Zfn*Ia1);
+Ibase=(Sb*1000)/(sqrt(3)*vtr);
+If=Ibase*Ia;
+mprintf("fault current is %f%f A \n",real(If),imag(If));
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+V1=[Va0;Va1;Va2];
+V=A*V1;
+Vab=V(1,1)-V(2,1);
+Vbc=V(2,1)-V(3,1);
+Vca=V(3,1)-V(1,1);
+mprintf("Actual Line Voltages are Vab=%f+%f Kv Vbc=%f%f Kv Vca=%f+%f Kv",real(Vab),imag(Vab),real(Vbc),imag(Vbc),real(Vca),imag(Vca));
+
+
+
+
+
diff --git a/3793/CH10/EX10.7/exp_10_7.sce b/3793/CH10/EX10.7/exp_10_7.sce
new file mode 100644
index 000000000..39e02844a
--- /dev/null
+++ b/3793/CH10/EX10.7/exp_10_7.sce
@@ -0,0 +1,57 @@
+clear;
+clc;
+Sb=30;
+vb=11;
+sg=20;
+p=10;
+R=6.6;
+Ea=1;
+//generator
+X1=complex(0,.1);
+X2=complex(0,.1);
+X0=complex(0,.15);
+x1=X1*(Sb/sg);
+x2=X2*(Sb/sg);
+x0=X0*(Sb/sg);
+//transformer12
+xt1=complex(0,.12);
+xt2=complex(0,.12);
+xt0=complex(0,.12);
+//transmission line
+vtr=22;
+Ztr=vtr^2/Sb;
+Z=complex(1,5);
+Zpu=Z/Ztr;
+//transformer34
+Xt1=complex(0,.05);
+Xt2=complex(0,.05);
+Xt0=complex(0,.05);
+xtt1=Xt1*(Sb/sg);
+xtt2=Xt2*(Sb/sg);
+xtt0=Xt0*(Sb/sg);
+Vf3=1;
+Rpu=((Vf3^2)*Sb)/p;
+Rf=(R*Sb)/vtr^2;
+Il=p/Sb;
+Vf4=Vf3+(Il*xtt1);
+Zfp=((x1+xt1+Zpu)*(Rpu+xtt1))/(x1+xt1++Zpu+Rpu+xtt1);
+Zfn=Zfp;
+zf0=Zpu+xt1;
+Ia1=Vf3/(Zfp+Zfn+Rf);
+Ia2=-Ia1;
+Va0=0;
+Va1=Ea-(Zfn*Ia1);
+Va2=-Zfn*Ia2;
+Ibase=(Sb*1000)/(sqrt(3)*vtr);
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+V1=[Va0;Va1;Va2];
+V=A*V1;
+Vab=V(1,1)-V(2,1);
+Vbc=V(2,1)-V(3,1);
+Vca=V(3,1)-V(1,1);
+mprintf("Actual Line Voltages are Vab=%f+%f Vbc=%f%f Vca=%f+%f \n",real(Vab),imag(Vab),real(Vbc),imag(Vbc),real(Vca),imag(Vca));
+
+Ib1=complex(0,-sqrt(3))*Ia1;
+Ib=Ib1*Ibase;
+mprintf("Phase current is %f%f A",real(Ib),imag(Ib));
diff --git a/3793/CH10/EX10.8/exp_10_8.sce b/3793/CH10/EX10.8/exp_10_8.sce
new file mode 100644
index 000000000..973e0229f
--- /dev/null
+++ b/3793/CH10/EX10.8/exp_10_8.sce
@@ -0,0 +1,31 @@
+clear;
+clc;
+s=30;
+v=22;
+E=1;
+Zf=6.6;
+Zg=13.2;
+Z0=complex(.062,.43);
+Z1=complex(.161,.535);
+Z2=Z1;
+Zff=.409;
+Zgp=(Zg*s)/v^2;
+Ia1=E/(Z1+Zff+((Z2+Zff)*(Z0+Zff+3*Zgp)/(Z2+Z0+2*Zff+3*Zgp)));
+Ia2=-((Z0+Zff+3*Zgp)/(Z2+Z0+2*Zff+3*Zgp))*(Ia1);
+Ia0=-((Z2+Zff)/(Z2+Z0+2*Zff+3*Zgp))*(Ia1);
+a=complex(-.5,.866);
+A=[1 1 1;1 a^2 a;1 a a^2];
+I=[Ia0;Ia1;Ia2];
+Ia=A*I;
+Va0=-Z0*Ia0;
+Va1=E-Z1*Ia1;
+Va2=-Z1*Ia2;
+V1=[Va0;Va1;Va2];
+V=A*V1;
+Vab=V(1,1)-V(2,1);
+Vbc=V(2,1)-V(3,1);
+Vca=V(3,1)-V(1,1);
+mprintf("Actual Phase Voltages are Va0=%f+%f Va1=%f%f Va2=%f+%f \n",real(Va0),imag(Va0),real(Va1),imag(Va1),real(Va2),imag(Va2));
+mprintf("Actual Phase currents are \n");
+
+disp(Ia);
diff --git a/3793/CH10/EX10.9/exp_10_9.sce b/3793/CH10/EX10.9/exp_10_9.sce
new file mode 100644
index 000000000..2c39d58a6
--- /dev/null
+++ b/3793/CH10/EX10.9/exp_10_9.sce
@@ -0,0 +1,41 @@
+clear;
+clc;
+s=30;
+v=22;
+E=1;
+Zf=6.6;
+Zg=13.2;
+Z0=complex(.062,.43);
+Z1=complex(.161,.535);
+Z2=Z1;
+Zff=.409;
+Zgp=(Zg*s)/v^2;
+Ia=E/(Z1+Zff);
+absIa=abs(Ia);
+mprintf("Absolute Ia=%.3f\n",absIa);
+angleIa=atand(imag(Ia)/real(Ia));
+mprintf("Abngle of Ia=%.3f\n",angleIa);
+a=complex((-.5),.866);
+aa=a^2;
+anglea=atand(imag(aa)/real(aa));
+angleaa=atand(imag(a)/real(a));
+angleIb=angleIa+(anglea);
+disp(anglea)
+
+mprintf("Angle of Ib=%.3f\n",angleIb);
+angleIc=angleIa+(angleaa);
+
+mprintf("Angle of Ic=%.3f\n",angleIc);
+Va=E-(Zff*Ia);
+absVa=abs(Va);
+mprintf("Absolute Va=%.3f\n",absVa);
+angleVa=atand(imag(Va)/real(Va));
+mprintf("Angle of Va=%.3f\n",angleVa);
+angleVb=angleVa+(anglea);
+mprintf("Angle of Vb=%.3f\n",angleVb);
+angleVc=angleVa+(angleaa);
+mprintf("Angle of Vc=%.3f",angleVc);
+
+
+
+
diff --git a/3793/CH11/EX11.1/exp_11_1.sce b/3793/CH11/EX11.1/exp_11_1.sce
new file mode 100644
index 000000000..628114475
--- /dev/null
+++ b/3793/CH11/EX11.1/exp_11_1.sce
@@ -0,0 +1,25 @@
+clear;
+clc;
+f=50;
+s=100;
+H=3.5;
+p=.16;
+sb=500;
+ip=.18;
+Pole=4;
+K=H*s;
+mprintf("Kinetic energy stored is %.3f MJ\n",K);
+Pa=(ip-p)*sb;
+A=(Pa*360*f)/(2*H*s);
+mprintf("acceleration of generator is %.3f degree electrical per second sqr\n",A);
+a=7.5;
+accp=a/f;
+Ns=120*f/Pole;
+rotora=(2.996*accp)^2; //change in rotor angle equation obtained with the help of eq11.1.1 and integrating it
+
+mprintf("change in rotor angle is %.3f rad \n",rotora);
+del=.202;
+rv=2.996*sqrt(del);
+vel=(rv*120)/(3.14*Pole);
+NN=Ns+vel;
+mprintf("Speed is %.3f rpm",NN);
diff --git a/3793/CH11/EX11.2/exp_11_2.sce b/3793/CH11/EX11.2/exp_11_2.sce
new file mode 100644
index 000000000..5aa5422d2
--- /dev/null
+++ b/3793/CH11/EX11.2/exp_11_2.sce
@@ -0,0 +1,17 @@
+clear;
+clc;
+pole=2;
+s=50;
+v=11;
+pf=.8;
+H=6;
+Ns=3000;
+inpinc=62000;
+K=H*s;
+mprintf("Kinetic energy stored is %.3f MJ\n",K);
+po=s*pf;
+pi=inpinc*735.5/10^6;
+f=50;
+Ap=pi-po;
+A=(Ap*360*f)/(2*H*s);
+mprintf("acceleration of generator is %.3f degree electrical per second sqr\n",A);
diff --git a/3793/CH11/EX11.3/exp_11_3.sce b/3793/CH11/EX11.3/exp_11_3.sce
new file mode 100644
index 000000000..8c608bc74
--- /dev/null
+++ b/3793/CH11/EX11.3/exp_11_3.sce
@@ -0,0 +1,47 @@
+clear;
+clc;
+function [S,pin,deltam,itr,delta1]=pinstab (V,X1,Xt,Xd,pf,typee,tolr);
+ Xtot=X1+Xt+Xd;
+ Pu=input('Generator output power');
+ phi=acosd(pf);
+ Qu=Pu*tand(phi);
+ if typee==0
+ S=Pu+%i*Qu;
+ else
+ S=Pu-%i*Qu;
+ end
+ I=conj(S)/conj(V);
+ Edash=V+I*(%i*Xtot);
+ Edash=abs(Edash);
+ delta0=asin(Pu*Xtot/(Edash*V));
+ itr=0;
+ deltam=input('initial estimate of deltam');
+ ndeltam=0;
+ difff=abs(ndeltam-deltam);
+ while difff > tolr;
+ itr=itr+1;
+ fdeltam=cos(delta0)-(deltam-delta0)*sin(deltam)-cos(deltam);
+ dfdeltam=(deltam-delta0)*cos(deltam);
+ ndeltam=deltam+fdeltam/dfdeltam;
+ difff=abs(ndeltam-deltam);
+ deltam=ndeltam;
+
+ end
+ delta1=%pi-deltam;
+ pin=(Edash*V/Xtot)*sin(delta1);
+ deltam=deltam*180/%pi;
+ delta1=delta1*180/%pi;
+ mprintf("Magnitude of power input without loosing synchronism is %.4f",pin);
+
+
+
+
+endfunction
+V=1;
+X1=.15;
+Xt=.2;
+Xd=.15;
+pf=.8;
+typee=0;
+tolr=.001;
+[S,pin,deltam,itr,delta1]=pinstab (V,X1,Xt,Xd,pf,typee,tolr);
diff --git a/3793/CH11/EX11.4/exp_11_4.sce b/3793/CH11/EX11.4/exp_11_4.sce
new file mode 100644
index 000000000..d3d458f24
--- /dev/null
+++ b/3793/CH11/EX11.4/exp_11_4.sce
@@ -0,0 +1,38 @@
+clear;
+clc;
+function [deltam]=stabnr (tolr);
+ itr=0;
+ ndeltam=0;
+ deltam=input('Initial estimate of deltam');
+ difff=abs(ndeltam-deltam);
+ while difff>tolr;
+ itr=itr+1;
+ fdeltam=2.7202*cos(deltam)+.8*deltam-2.8247;
+ dfdeltam=2.7202*sin(deltam);
+ ndeltam=deltam+fdeltam/dfdeltam;
+ difff=abs(ndeltam-deltam);
+ deltam=ndeltam;
+
+ end
+ deltam=deltam*180/%pi;
+ mprintf("Maximum swing of the rotor angle is %.4f degree, since it is less than(pi-delta0) therefore system will remain stable\n",deltam);
+endfunction
+phi=-acosd(.8);
+S=complex(.8,.6);
+pu=.8;
+V=1;
+I=conj(S)/conj(V);
+Xtot=.5;
+E=V+%i*I*Xtot;
+E=abs(E);
+delta0=asin(pu*Xtot/(E*V));
+mprintf("Deta0=%.4f radian\n",delta0);
+tolr=.001;
+[deltam]=stabnr (tolr);
+deltac=acos(-.0866/(2.7202));
+H=6;
+M=H/(%pi*50);
+pi=.8;
+t=sqrt(2*M*(deltac-delta0)/pi);
+mprintf("Critical angle is %.4f radian and time is %.4f seconds",deltac,t);
+
diff --git a/3793/CH11/EX11.5/exp_11_5.sce b/3793/CH11/EX11.5/exp_11_5.sce
new file mode 100644
index 000000000..eeda6a7fc
--- /dev/null
+++ b/3793/CH11/EX11.5/exp_11_5.sce
@@ -0,0 +1,21 @@
+clear;
+clc;
+Xtf=.2+.2+(.3*.6/0.9);
+pi=0.9;
+po=pi;
+del1=asin(Xtf*pi/(1.2*1));
+
+Pm=1.2*1/Xtf;
+//fault condition
+Xtf1=(.4*.3+.3*.3+.3*.4)/.3;
+Pm1=1.2*1/Xtf1;
+//post fault condition
+Xtf2=.2+.2+.3;
+Pm2=1.2*1/Xtf2;
+delm=(%pi-(asin(pi/Pm2)));
+
+delc=acos((pi*(delm-del1)+Pm2*cos(delm)-Pm1*cos(del1))/(Pm2-Pm1));
+
+
+mprintf("rotor angle is %.3f radian \n",del1);
+mprintf("Critical clearing angle is %.3f radian",delc);
diff --git a/3793/CH11/EX11.9/exp_11_9.sce b/3793/CH11/EX11.9/exp_11_9.sce
new file mode 100644
index 000000000..86d29a0e0
--- /dev/null
+++ b/3793/CH11/EX11.9/exp_11_9.sce
@@ -0,0 +1,24 @@
+clear;
+clc;
+pf=.8;
+f=50;
+rp=.8;
+X=.4;
+Xd=.2;
+H=10;
+v=1;
+Xeq=Xd+X;
+Ig=rp/(v*pf);
+angle=acosd(pf);
+E=sqrt(((v+Ig*Xd*Xeq)^2)+((Ig*Xd*pf)^2));
+del=atand((Ig*Xd*pf)/(v+Ig*Xd*Xeq));
+P=(E*v)/Xeq;
+mprintf("Steady state power limit is %.3f pu\n",P);
+Pc=cosd(del)*P;
+mprintf("Synchronizing power coefficient is %.3f pu\n",Pc);
+M=H/(3.14*f);
+gaama=sqrt(Pc/M);
+fre=gaama/(2*%pi);
+mprintf("frequency of free oscillation is %.3f Hz\n",fre);
+T=1/fre;
+mprintf("time period of free oscillation is %.3f s\n",T);
diff --git a/3793/CH12/EX12.1/exp_12_1.sce b/3793/CH12/EX12.1/exp_12_1.sce
new file mode 100644
index 000000000..7aca342f3
--- /dev/null
+++ b/3793/CH12/EX12.1/exp_12_1.sce
@@ -0,0 +1,22 @@
+clear;
+clc;
+Vs=1.05;//in pu
+Vr=1.0;
+//for del 10 degree
+X=1;
+del=10;
+Qs=((Vs^2)/X)-(Vs*Vr*cosd(del)/X);
+Qr=(-(Vr^2)/X)+(Vs*Vr*cosd(del)/X);
+mprintf("for 10 degree Qs = %.3f and Qr = %.3f\n",Qs,Qr);
+del=20;
+Qs=((Vs^2)/X)-(Vs*Vr*cosd(del)/X);
+Qr=(-(Vr^2)/X)+(Vs*Vr*cosd(del)/X);
+mprintf(" for 20 degree Qs = %.3f and Qr = %.3f\n",Qs,Qr);
+del=30;
+Qs=((Vs^2)/X)-(Vs*Vr*cosd(del)/X);
+Qr=(-(Vr^2)/X)+(Vs*Vr*cosd(del)/X);
+mprintf(" for 30 degree Qs = %.3f and Qr = %.3f\n",Qs,Qr);
+del=40;
+Qs=((Vs^2)/X)-(Vs*Vr*cosd(del)/X);
+Qr=(-(Vr^2)/X)+(Vs*Vr*cosd(del)/X);
+mprintf(" for 40 degree Qs = %.3f and Qr = %.3f",Qs,Qr);
diff --git a/3793/CH12/EX12.2/exp_12_2.sce b/3793/CH12/EX12.2/exp_12_2.sce
new file mode 100644
index 000000000..faa4876ab
--- /dev/null
+++ b/3793/CH12/EX12.2/exp_12_2.sce
@@ -0,0 +1,27 @@
+clear;
+clc;
+
+phi=38.74;//in degree
+k=0.8;
+vs=220;
+
+a=gca();
+a.auto_scale="off";
+a.data_bounds=[0,0;.3,1];
+xlabel("Voltage");
+ylabel("Power");
+
+p=[0:.1:1];
+v1=( 0.5-(p*0.8)+((.25-(p*0.8)-(p^2))^(1/2)))^(1/2);
+v2=( 0.5-(p*0.8)-((.25-(p*0.8)-(p^2))^(1/2)))^(1/2);
+//change the axis boundary of x axis to 0.3
+plot(p,v1,p,v2);
+cp=.24;//from graph
+cv=.55;//from graph
+x=60;
+Pr=(cp*(vs^2))/x;
+Vr=cv*vs;
+mprintf("Critical power = %.3f MW and Critical voltage = %.3f KV",Pr,Vr);
+
+
+
diff --git a/3793/CH12/EX12.3/exp_12_3.sce b/3793/CH12/EX12.3/exp_12_3.sce
new file mode 100644
index 000000000..72f0e1563
--- /dev/null
+++ b/3793/CH12/EX12.3/exp_12_3.sce
@@ -0,0 +1,18 @@
+clear;
+clc;
+Pr=.24;
+Vr=.55;
+del=asind(Pr/Vr);
+a=gca();
+a.auto_scale="off";
+a.data_bounds=[0,0.3;1.5,1];
+xlabel("Voltage");
+ylabel(" ReactivePower");
+V=[0:.01:5];
+Q=((V)^2)+(V*cosd(del));
+plot(V,Q);
+q=.38;
+v=.95;
+Qr=((220^2)*q)/60;
+Vrr=v*220;
+mprintf("Critical power = %.3f MVAR and Critical voltage = %.3f KV",Qr,Vrr);
diff --git a/3793/CH13/EX13.1/exp_13_1.sce b/3793/CH13/EX13.1/exp_13_1.sce
new file mode 100644
index 000000000..6d1e5e86f
--- /dev/null
+++ b/3793/CH13/EX13.1/exp_13_1.sce
@@ -0,0 +1,23 @@
+clear;
+clc;
+Yb=[complex(1.14,-4.19) complex(-.59,2.35) complex(0,0) complex(-0.55,1.83);complex(-0.59,2.35) complex(3.76,-9.4) complex(-.77,3.85) complex(-2.4,3.2);complex(0,0) complex(-0.77,3.85) complex(1.77,-6.85) complex(-1,3);complex(-.55,1.83) complex(-2.4,3.2) complex(-1,3) complex(4.19,-8.03)];
+v=[1.02 1 .98 1.04]';
+
+Zb=inv(Yb);
+Zbus=imag(Zb);
+
+Z12={Zbus(1,1)-Zbus(1,2)-(Zbus(2,1)-Zbus(2,2))};
+Z34={Zbus(3,3)-Zbus(3,4)-(Zbus(4,3)-Zbus(4,4))};
+z11=Zbus(1,1)-Zbus(1,2)-(Zbus(2,1)-Zbus(2,2))+0.4;
+z12=Zbus(1,3)-Zbus(1,4)-(Zbus(2,3)-Zbus(2,4));
+z21=Zbus(3,1)-Zbus(3,2)-(Zbus(4,1)-Zbus(4,2));
+z22=Zbus(3,3)-Zbus(3,4)-(Zbus(4,3)-Zbus(4,4))+0.3;
+z=[z11 z12;z21 z22];
+V=[(v(1,1)-v(2,1));(v(3,1)-v(4,1))];
+Ic=inv(z)*V;
+A=[1 -1 0 0;0 0 1 -1];
+delV=-Zbus*A'*Ic;
+VV=v+delV;
+mprintf("Thevenin impedences are Z12=%f Z34=%f\n",Z12,Z34);
+mprintf("New Bus voltages are\n");
+disp(VV);
diff --git a/3793/CH13/EX13.2/exp_13_2.sce b/3793/CH13/EX13.2/exp_13_2.sce
new file mode 100644
index 000000000..c64c08433
--- /dev/null
+++ b/3793/CH13/EX13.2/exp_13_2.sce
@@ -0,0 +1,53 @@
+clear;
+clc;
+Yb=[complex(1.14,-4.19) complex(-.59,2.35) complex(0,0) complex(-0.55,1.83);complex(-0.59,2.35) complex(3.76,-9.4) complex(-.77,3.85) complex(-2.4,3.2);complex(0,0) complex(-0.77,3.85) complex(1.77,-6.85) complex(-1,3);complex(-.55,1.83) complex(-2.4,3.2) complex(-1,3) complex(4.19,-8.03)];
+v=[1.02 1 .98 1.04]';
+
+Zb=inv(Yb);
+Zbus=imag(Zb);
+
+Z12={Zbus(1,1)-Zbus(1,2)-(Zbus(2,1)-Zbus(2,2))};
+Z34={Zbus(3,3)-Zbus(3,4)-(Zbus(4,3)-Zbus(4,4))};
+//case1
+z11=Z12-.4;
+z12=Zbus(1,3)-Zbus(1,4)-(Zbus(2,3)-Zbus(2,4));
+z21=Zbus(3,1)-Zbus(3,2)-(Zbus(4,1)-Zbus(4,2));
+z22=Z34-.3;
+z=[z11 z12;z21 z22];
+V=[(v(1,1)-v(2,1));(v(3,1)-v(4,1))];
+Ic=inv(z)*V;
+A=[1 -1 0 0;0 0 1 -1];
+delV=-Zbus*A'*Ic;
+VV=v+delV;
+disp(z)
+
+mprintf(" Bus voltages for case1 are\n");
+disp(VV);
+//case2
+z11=Z12-.4;
+z12=Zbus(1,3)-Zbus(1,4)-(Zbus(2,3)-Zbus(2,4));
+z21=Zbus(3,1)-Zbus(3,2)-(Zbus(4,1)-Zbus(4,2));
+z22=Z34+.3
+z=[z11 z12;z21 z22];
+V=[(v(1,1)-v(2,1));(v(3,1)-v(4,1))];
+Ic=inv(z)*V;
+A=[1 -1 0 0;0 0 1 -1];
+delV=-Zbus*A'*Ic;
+VV=v+delV;
+
+mprintf(" Bus voltages for case2 are\n");
+disp(VV);
+//case3
+z11=Z12+.4;
+z12=Zbus(1,3)-Zbus(1,4)-(Zbus(2,3)-Zbus(2,4));
+z21=Zbus(3,1)-Zbus(3,2)-(Zbus(4,1)-Zbus(4,2));
+z22=Z34-.3;
+z=[z11 z12;z21 z22];
+V=[(v(1,1)-v(2,1));(v(3,1)-v(4,1))];
+Ic=inv(z)*V;
+A=[1 -1 0 0;0 0 1 -1];
+delV=-Zbus*A'*Ic;
+VV=v+delV;
+
+mprintf(" Bus voltages for case3 are\n");
+disp(VV);
diff --git a/3793/CH13/EX13.3/exp_13_3.sce b/3793/CH13/EX13.3/exp_13_3.sce
new file mode 100644
index 000000000..988ad844d
--- /dev/null
+++ b/3793/CH13/EX13.3/exp_13_3.sce
@@ -0,0 +1,61 @@
+clear;
+clc;
+Ybusa=zeros(4,4);
+Ybusb=zeros(4,4);
+Ybusa(1,1)=1/(complex(0,4))+1/(complex(0,.8))+1/(complex(0,.5))+1/(complex(0,.4));
+Ybusa(1,2)=-1/(complex(0,.8));
+Ybusa(2,1)=Ybusa(1,2);
+Ybusa(1,3)=-1/(complex(0,.5));
+Ybusa(3,1)=Ybusa(1,3);
+Ybusa(1,4)=-1/(complex(0,.4));
+Ybusa(4,1)=Ybusa(1,4);
+Ybusa(2,2)=1/(complex(0,.8));
+Ybusa(3,3)=1/(complex(0,.5))+1/(complex(0,.1));
+Ybusa(3,4)=-1/(complex(0,.1));
+Ybusa(4,3)=Ybusa(3,4);
+Ybusa(4,4)=1/(complex(0,.1))+1/(complex(0,.4));
+Ybusb(1,1)=1/(complex(0,.2))+1/(complex(0,.4));
+Ybusb(1,2)=-1/(complex(0,.2));
+Ybusb(2,1)=Ybusb(1,2);
+Ybusb(2,3)=-1/(complex(0,.5));
+Ybusb(3,2)=Ybusb(2,3);
+Ybusb(1,4)=-1/(complex(0,.4));
+Ybusb(4,1)=Ybusb(1,4);
+Ybusb(2,2)=1/(complex(0,.2))+1/(complex(0,.5));
+Ybusb(3,3)=1/(complex(0,5))+1/(complex(0,.5))+1/(complex(0,.25));
+Ybusb(3,4)=-1/(complex(0,.25));
+Ybusb(4,3)=Ybusb(3,4);
+Ybusb(4,4)=1/(complex(0,.25))+1/(complex(0,.4));
+Zbusa=inv(Ybusa);
+Zbusb=inv(Ybusb);
+
+Zbusa(1,:)=[];
+Zbusa(:,1)=[];
+Zbusb(4,:)=[];
+Zbusb(:,4)=[];
+Zbusb(3,:)=[];
+Zbusb(:,3)=[];
+
+AA=[1 0 0;1 0 0;0 0 1];
+Zbounda=AA*Zbusa*AA';
+AB=[-1 0;0 -1;0 -1];
+Zboundb=AB*Zbusb*AB';
+Ztie=[complex(0,.1) 0 0;0 complex(0,.2) 0; 0 0 complex(0,.3)];
+Z=Zbounda+Ztie+Zboundb;
+Va=[complex(1,0); complex(1.0086,-.0529); complex(.9794,-.0342);complex(.999,-.0436)];
+Vb=[complex(.994,-0.0349); complex(1.0047,-.0263); complex(1,0);complex(.9898,.0173)];
+Vdiff=[Va(2)-Vb(1);Va(2)-Vb(2);Va(4)-Vb(2)];
+Itie=inv(Z)*Vdiff;
+Abusa=[0 1 0 0;0 1 0 0;0 0 0 1];
+Vadash=Va-inv(Ybusa)*Abusa'*(-Itie);
+Abusb=[ -1 0 0 0;0 -1 0 0;0 -1 0 0];
+Vbdash=Vb-inv(Ybusb)*Abusb'*(-Itie);
+mprintf("Bus voltages of A power system are");
+disp(Vadash);
+mprintf("Bus voltages of B power system are");
+disp(Vbdash);
+
+
+
+
+
diff --git a/3793/CH13/EX13.4/exp_13_4.sce b/3793/CH13/EX13.4/exp_13_4.sce
new file mode 100644
index 000000000..722bc2901
--- /dev/null
+++ b/3793/CH13/EX13.4/exp_13_4.sce
@@ -0,0 +1,10 @@
+clear;
+clc;
+a=[complex(0,4.8) complex(0,4);complex(0,4) complex(0,4.24)];
+b=[complex(0,5.337) complex(0,5.2407);complex(0,5.2407) complex(0,5.3148)];
+wa=inv(a);
+wb=inv(b);
+mprintf("Ward eqiwalents for power system A is");
+disp(wa);
+mprintf("Ward equivalent for power system B is");
+ disp(wb);
diff --git a/3793/CH13/EX13.6/exp_13_6.sce b/3793/CH13/EX13.6/exp_13_6.sce
new file mode 100644
index 000000000..69407faaf
--- /dev/null
+++ b/3793/CH13/EX13.6/exp_13_6.sce
@@ -0,0 +1,62 @@
+clear;
+clc;
+Ybus=zeros(4,4);
+Za=%i*.1;
+Z12=%i*.25;
+Z14=%i*.4;
+Z43=%i*.1;
+Z42=%i*.2;
+Z32=%i*.1;
+Z13=%i*.5;
+Zg=%i*4;
+
+V1=1;
+V2=complex(.9787,-.0513);
+V3=complex(1.019,.0445);
+V4=complex(1.0098,-.0176);
+Ybus(1,1)=1/Zg+1/Z12+1/Z13+1/Z14;
+Ybus(1,2)=-1/Z12;
+Ybus(2,1)=Ybus(1,2);
+Ybus(1,3)=-1/Z13;
+Ybus(3,1)=Ybus(1,3);
+Ybus(1,4)=-1/Z14;
+Ybus(4,1)=Ybus(1,4);
+Ybus(2,2)=1/Z12+1/Z32+1/Z42;
+Ybus(2,3)=-1/Z32;
+Ybus(3,2)=Ybus(2,3);
+Ybus(2,4)=-1/Z42;
+Ybus(4,2)=Ybus(2,4);
+Ybus(3,3)=1/Z13+1/Z43+1/Z32;
+Ybus(3,4)=-1/Z43;
+Ybus(4,3)=Ybus(3,4);
+Ybus(4,4)=1/Z14+1/Z43+1/Z42;
+Z=inv(Ybus);
+Zt34=Z(3,3)+Z(4,4)-2*Z(3,4);
+V=[V1;V2;V3;V4];
+I12=(V1-V2)/Z12;
+I13=(V1-V3)/Z13;
+I14=(V1-V4)/Z14;
+I23=(V2-V3)/Z32;
+I24=(V2-V4)/Z42;
+I34=(V3-V4)/Z43;
+Zaa=-Za;
+Zden=Zt34-Zaa;
+L1234=Zaa/Z12*((Z(1,3)-Z(1,4))-(Z(2,3)-Z(2,4)))/Zden;
+L1334=Zaa/Z13*((Z(1,3)-Z(1,4))-(Z(3,3)-Z(3,4)))/Zden;
+L1434=Zaa/Z14*((Z(1,3)-Z(1,4))-(Z(4,3)-Z(4,4)))/Zden;
+L2334=Zaa/Z32*((Z(2,3)-Z(2,4))-(Z(3,3)-Z(3,4)))/Zden;
+L2434=Zaa/Z42*((Z(2,3)-Z(2,4))-(Z(4,3)-Z(4,4)))/Zden;
+I112=I12+L1234*I34;
+I113=I13+L1334*I34;
+I114=I14+L1434*I34;
+I223=I23+L2334*I34;
+I224=I24+L2434*I34;
+L12=abs(I112)/(4*abs(I12))*100;
+L13=abs(I113)/(4*abs(I13))*100;
+L14=abs(I114)/(4*abs(I14))*100;
+L23=abs(I223)/(1.3333*abs(I23))*100;
+L24=abs(I224)/(1.3333*abs(I24))*100;
+mprintf(" Line-outage distribution factors are L1234=%.3f, L1334=%.3f, L1434=%.3f, L2334=%.3f and L2434=%.3f\n",L1234,L1334,L1434,L2334,L2434);
+mprintf("New values of line current are I12=%.3f %.3f, I13=%.3f+%.3f, I14=%.3f+%.3f, I23=%.3f+%.3f and I24=%.3f+%.3f\n",real(I112),imag(I112),real(I113),imag(I113),real(I114),imag(I114),real(I223),imag(I223),real(I224),imag(I224));
+mprintf("Loading after tripping in percentage is L12=%.3f percent,L13=%.3f percent, L14=%.3f percent, L23=%.3f percent and L24=%.3f percent",L12,L13,L14,L23,L24);
+
diff --git a/3793/CH13/EX13.7/exp_13_7.sce b/3793/CH13/EX13.7/exp_13_7.sce
new file mode 100644
index 000000000..d90293d80
--- /dev/null
+++ b/3793/CH13/EX13.7/exp_13_7.sce
@@ -0,0 +1,69 @@
+clear;
+clc;
+Ybus=zeros(4,4);
+Za=%i*.1;
+Z12=%i*.25;
+Z14=%i*.4;
+Z43=%i*.1;
+Z42=%i*.2;
+Z32=%i*.1;
+Z13=%i*.5;
+Zg=%i*4;
+
+V1=1;
+V2=complex(.9787,-.0513);
+V3=complex(1.019,.0445);
+V4=complex(1.0098,-.0176);
+Ybus(1,1)=1/Zg+1/Z12+1/Z13+1/Z14;
+Ybus(1,2)=-1/Z12;
+Ybus(2,1)=Ybus(1,2);
+Ybus(1,3)=-1/Z13;
+Ybus(3,1)=Ybus(1,3);
+Ybus(1,4)=-1/Z14;
+Ybus(4,1)=Ybus(1,4);
+Ybus(2,2)=1/Z12+1/Z32+1/Z42;
+Ybus(2,3)=-1/Z32;
+Ybus(3,2)=Ybus(2,3);
+Ybus(2,4)=-1/Z42;
+Ybus(4,2)=Ybus(2,4);
+Ybus(3,3)=1/Z13+1/Z43+1/Z32;
+Ybus(3,4)=-1/Z43;
+Ybus(4,3)=Ybus(3,4);
+Ybus(4,4)=1/Z14+1/Z43+1/Z42;
+Z=inv(Ybus);
+Zt34=Z(3,3)+Z(4,4)-2*Z(3,4);
+V=[V1;V2;V3;V4];
+I12=(V1-V2)/Z12;
+I13=(V1-V3)/Z13;
+I14=(V1-V4)/Z14;
+I23=(V2-V3)/Z32;
+I24=(V2-V4)/Z42;
+I34=(V3-V4)/Z43;
+Zaa=-Za;
+Zden=Zt34-Zaa;
+L1234=Zaa/Z12*((Z(1,3)-Z(1,4))-(Z(2,3)-Z(2,4)))/Zden;
+L1334=Zaa/Z13*((Z(1,3)-Z(1,4))-(Z(3,3)-Z(3,4)))/Zden;
+L1434=Zaa/Z14*((Z(1,3)-Z(1,4))-(Z(4,3)-Z(4,4)))/Zden;
+L2334=Zaa/Z32*((Z(2,3)-Z(2,4))-(Z(3,3)-Z(3,4)))/Zden;
+L2434=Zaa/Z42*((Z(2,3)-Z(2,4))-(Z(4,3)-Z(4,4)))/Zden;
+I112=I12+L1234*I34;
+I113=I13+L1334*I34;
+I114=I14+L1434*I34;
+I223=I23+L2334*I34;
+I224=I24+L2434*I34;
+Iinj=Ybus*V;
+S1=V(1)*conj(Iinj(1));
+S2=V(2)*conj(Iinj(2));
+S3=V(3)*conj(Iinj(3));
+S4=V(4)*conj(Iinj(4));
+K321=(Z(3,1)-Z(2,1))/Z32;
+K323=(Z(3,3)-Z(2,3))/Z32;
+delIinj1=.8340;
+delIinj3=-delIinj1;
+delI32=K321*delIinj1+K323*delIinj3;
+I32d=I23+delI32;
+In=[(Iinj(1,1)+delIinj1);Iinj(2,1);(Iinj(3,1)+delIinj3);Iinj(4,1)];
+Vnew=inv(Ybus)*In;
+I32n=(Vnew(3)-Vnew(2))/Z32;
+mprintf("Power at each bus are S1=%.4f+%.4f, S2=%.4f%.4f, S3=%.4f+%.4f and S4=%.4f+%.4f\n",real(S1),imag(S1),real(S2),imag(S2),real(S3),imag(S3),real(S4),imag(S4));
+mprintf("Change in current is I32=%.4f%.4f",real(I32n),imag(I32n));
diff --git a/3793/CH13/EX13.8/exp_13_8.sce b/3793/CH13/EX13.8/exp_13_8.sce
new file mode 100644
index 000000000..91072a828
--- /dev/null
+++ b/3793/CH13/EX13.8/exp_13_8.sce
@@ -0,0 +1,58 @@
+clear;
+clc;
+Ybus=zeros(4,4);
+Za=%i*.1;
+Z12=%i*.25;
+Z14=%i*.4;
+Z43=%i*.1;
+Z42=%i*.2;
+Z32=%i*.1;
+Z13=%i*.5;
+Zg=%i*4;
+
+V1=1;
+V2=complex(.9787,-.0513);
+V3=complex(1.019,.0445);
+V4=complex(1.0098,-.0176);
+Ybus(1,1)=1/Zg+1/Z12+1/Z13+1/Z14;
+Ybus(1,2)=-1/Z12;
+Ybus(2,1)=Ybus(1,2);
+Ybus(1,3)=-1/Z13;
+Ybus(3,1)=Ybus(1,3);
+Ybus(1,4)=-1/Z14;
+Ybus(4,1)=Ybus(1,4);
+Ybus(2,2)=1/Z12+1/Z32+1/Z42;
+Ybus(2,3)=-1/Z32;
+Ybus(3,2)=Ybus(2,3);
+Ybus(2,4)=-1/Z42;
+Ybus(4,2)=Ybus(2,4);
+Ybus(3,3)=1/Z13+1/Z43+1/Z32;
+Ybus(3,4)=-1/Z43;
+Ybus(4,3)=Ybus(3,4);
+Ybus(4,4)=1/Z14+1/Z43+1/Z42;
+Z=inv(Ybus);
+Zt34=Z(3,3)+Z(4,4)-2*Z(3,4);
+V=[V1;V2;V3;V4];
+I12=(V1-V2)/Z12;
+I13=(V1-V3)/Z13;
+I14=(V1-V4)/Z14;
+I23=(V2-V3)/Z32;
+I24=(V2-V4)/Z42;
+I34=(V3-V4)/Z43;
+Zaa=-Za;
+Zden=Zt34-Zaa;
+L1234=Zaa/Z12*((Z(1,3)-Z(1,4))-(Z(2,3)-Z(2,4)))/Zden;
+L1334=Zaa/Z13*((Z(1,3)-Z(1,4))-(Z(3,3)-Z(3,4)))/Zden;
+L1434=Zaa/Z14*((Z(1,3)-Z(1,4))-(Z(4,3)-Z(4,4)))/Zden;
+L2334=Zaa/Z32*((Z(2,3)-Z(2,4))-(Z(3,3)-Z(3,4)))/Zden;
+L2434=Zaa/Z42*((Z(2,3)-Z(2,4))-(Z(4,3)-Z(4,4)))/Zden;
+Zb=-Za;
+Zt23=Z(2,2)+Z(3,3)-2*Z(2,3);
+Zden1=Zt23-Zb;
+L1423=Zb/Z14*((Z(1,2)-Z(1,3))-(Z(4,2)-Z(4,3)))/Zden1;
+L3423=Zb/Z43*((Z(3,2)-Z(3,3))-(Z(4,2)-Z(4,3)))/Zden1;
+L11=(L1423+L1434*L3423)/(1-L2334*L3423);
+L12=(L1434+L1423*L2334)/(1-L2334*L3423);
+I14d=I14+(L11*I23+L12*I34);
+mprintf("Change in current line connected buses 1-4 is %.4f+%.4f",real(I14d),imag(I14d));
+
diff --git a/3793/CH13/EX13.9/exp_13_9.sce b/3793/CH13/EX13.9/exp_13_9.sce
new file mode 100644
index 000000000..994cb6333
--- /dev/null
+++ b/3793/CH13/EX13.9/exp_13_9.sce
@@ -0,0 +1,68 @@
+clear;
+clc;
+Ybus=zeros(4,4);
+Za=%i*.1;
+Z12=%i*.25;
+Z14=%i*.4;
+Z43=%i*.1;
+Z42=%i*.2;
+Z32=%i*.1;
+Z13=%i*.5;
+Zg=%i*4;
+
+V1=1;
+V2=complex(.9787,-.0513);
+V3=complex(1.019,.0445);
+V4=complex(1.0098,-.0176);
+Ybus(1,1)=1/Zg+1/Z12+1/Z13+1/Z14;
+Ybus(1,2)=-1/Z12;
+Ybus(2,1)=Ybus(1,2);
+Ybus(1,3)=-1/Z13;
+Ybus(3,1)=Ybus(1,3);
+Ybus(1,4)=-1/Z14;
+Ybus(4,1)=Ybus(1,4);
+Ybus(2,2)=1/Z12+1/Z32+1/Z42;
+Ybus(2,3)=-1/Z32;
+Ybus(3,2)=Ybus(2,3);
+Ybus(2,4)=-1/Z42;
+Ybus(4,2)=Ybus(2,4);
+Ybus(3,3)=1/Z13+1/Z43+1/Z32;
+Ybus(3,4)=-1/Z43;
+Ybus(4,3)=Ybus(3,4);
+Ybus(4,4)=1/Z14+1/Z43+1/Z42;
+Z=inv(Ybus);
+Zt34=Z(3,3)+Z(4,4)-2*Z(3,4);
+V=[V1;V2;V3;V4];
+I12=(V1-V2)/Z12;
+I13=(V1-V3)/Z13;
+I14=(V1-V4)/Z14;
+I23=(V2-V3)/Z32;
+I24=(V2-V4)/Z42;
+I34=(V3-V4)/Z43;
+Zaa=-Za;
+Zden=Zt34-Zaa;
+L1234=Zaa/Z12*((Z(1,3)-Z(1,4))-(Z(2,3)-Z(2,4)))/Zden;
+L1334=Zaa/Z13*((Z(1,3)-Z(1,4))-(Z(3,3)-Z(3,4)))/Zden;
+L1434=Zaa/Z14*((Z(1,3)-Z(1,4))-(Z(4,3)-Z(4,4)))/Zden;
+L2334=Zaa/Z32*((Z(2,3)-Z(2,4))-(Z(3,3)-Z(3,4)))/Zden;
+L2434=Zaa/Z42*((Z(2,3)-Z(2,4))-(Z(4,3)-Z(4,4)))/Zden;
+I112=I12+L1234*I34;
+I113=I13+L1334*I34;
+I114=I14+L1434*I34;
+I223=I23+L2334*I34;
+I224=I24+L2434*I34;
+Iinj=Ybus*V;
+S1=V(1)*conj(Iinj(1));
+S2=V(2)*conj(Iinj(2));
+S3=V(3)*conj(Iinj(3));
+S4=V(4)*conj(Iinj(4));
+L3234=Zaa/Z43*((Z(3,3)-Z(3,4))-(Z(2,3)-Z(2,4)))/Zden;
+K323=(Z(3,3)-Z(2,3))/Z43;
+K321=(Z(3,1)-Z(2,1))/Z43;
+K341=(Z(3,1)-Z(4,1))/Z43;
+K343=(Z(3,3)-Z(4,3))/Z43;
+K323d=K323+L3234*K343;
+K321d=K321+L3234*K341;
+delP32=K323d*(-1.6760/2)+K321d*(1.670/2);
+mprintf("Change in power flow is %.4f",delP32);
+
diff --git a/3793/CH14/EX14.1/exp_14_1.sce b/3793/CH14/EX14.1/exp_14_1.sce
new file mode 100644
index 000000000..4d3845488
--- /dev/null
+++ b/3793/CH14/EX14.1/exp_14_1.sce
@@ -0,0 +1,32 @@
+clear;
+clc;
+z1=2.00;
+z2=(-.250);
+z3=1.200;
+z4=11.00;
+z5=(-1.00);
+//z1,z2,z3 are currents and z4,z5 is voltage
+//if v2 is short circuited
+z11=(1/(2+(24/10)));
+z22=(6/10)*z11;
+z33=(4/10)*z11;
+z44=z33*6;
+z55=z22*4;
+//when v1 is short ckted;
+z2a=(1/(4+(12/8)));
+z1a=(6/8)*z2a;
+z3a=(2/8)*z2a;
+z4v=z3a*6;
+z5v=z2a*4;
+H=[z11 -z22; -z22 z2a; z33 z3a; z55 z4v; -z55 z5v];
+mprintf("H = " );
+disp(H);
+H1=[H]';
+W=[100 0 0 0 0; 0 100 0 0 0; 0 0 75 0 0; 0 0 0 75 0; 0 0 0 0 75;]
+G=H1*W*H;
+mprintf("G = ");
+disp(G);
+z=[z1;z2;z3;z4;z5];
+x=(inv(G))*H1*W*z;
+mprintf("x = ");
+disp(x);
diff --git a/3793/CH14/EX14.2/exp_14_2.sce b/3793/CH14/EX14.2/exp_14_2.sce
new file mode 100644
index 000000000..1e5287b65
--- /dev/null
+++ b/3793/CH14/EX14.2/exp_14_2.sce
@@ -0,0 +1,38 @@
+clear;
+clc;
+z12=complex(.05,.20);
+z23=complex(.075,.25);
+c1=.025;
+c2=.005;
+w1= (.1568*10^(-4));
+w2= (.1679*10^(-4));
+w3= (.0668*10^(-4));
+w4= (.0702*10^(-4));
+W=[w1 0 0 0; 0 w2 0 0; 0 0 w3 0; 0 0 0 w4];
+v1=1.05;
+v2=1.05;
+v3=(1.05);
+h1=(v1/z12);
+h2=(v2/z12);
+h3=(v2/z23);
+h4=(v3/z23);
+H=[h1 0 0 0; 0 h2 0 0; 0 0 h3 0; 0 0 0 h4];
+H1=conj(H);
+D=H1*W*H;
+D1=real(D);
+A=[1 -1 0; -1 1 0; 0 1 -1; 0 -1 1];
+B=[-1 0; 1 0; 1 -1; -1 1];
+b=[1;-1;0;0];
+E=(B')*D;
+f=E*B;
+s1=complex(.50,-.12);
+s2=complex(-.48,.10);
+s3=complex(.80,-.40);
+s4=complex(-.78,.38);
+S=[s1;s2;s3;s4];
+vm=(inv(H))*(conj(S));
+vb=inv(f)*E*(vm-(b*v1));
+V=[v1;vb];
+printf("V = ")
+disp(V);
+
diff --git a/3793/CH14/EX14.3/exp_14_3.sce b/3793/CH14/EX14.3/exp_14_3.sce
new file mode 100644
index 000000000..73322be44
--- /dev/null
+++ b/3793/CH14/EX14.3/exp_14_3.sce
@@ -0,0 +1,31 @@
+clear;
+clc;
+z1=2.00;
+z2=(-.250);
+z3=1.200;
+z4=11.00;
+z5=(-1.00);
+//z1,z2,z3 are currents and z4,z5 is voltage
+//if v2 is short circuited
+z11=(1/(2+(24/10)));
+z22=(6/10)*z11;
+z33=(4/10)*z11;
+z44=z33*6;
+z55=z22*4;
+//when v1 is short ckted;
+z2a=(1/(4+(12/8)));
+z1a=(6/8)*z2a;
+z3a=(2/8)*z2a;
+z4v=z3a*6;
+z5v=z2a*4;
+H=[z11 -z22; -z22 z2a; z33 z3a; z55 z4v; -z55 z5v];
+H1=[H]';
+W=[100 0 0 0 0; 0 100 0 0 0; 0 0 75 0 0; 0 0 0 75 0; 0 0 0 0 75;]
+G=H1*W*H;
+R=[.0100 0 0 0 0; 0 .0100 0 0 0; 0 0 .0133 0 0; 0 0 0 .0133 0; 0 0 0 0 .0133];
+F=H*inv(G)*(H')*inv(R);
+Rtemp=[diag(F)];
+fun=(1-F(1,1))+(1-F(2,2))+(1-F(3,3))+(1-F(4,4))+(1-F(5,5));
+mprintf("Performance function is %3.f",fun);
+
+
diff --git a/3793/CH14/EX14.4/exp_14_4.sce b/3793/CH14/EX14.4/exp_14_4.sce
new file mode 100644
index 000000000..e4de23a44
--- /dev/null
+++ b/3793/CH14/EX14.4/exp_14_4.sce
@@ -0,0 +1,63 @@
+clear;
+clc;
+z1=2.00;
+z2=(-.250);
+z3=1.200;
+z4=11.00;
+z5=(-1.00);
+//z1,z2,z3 are currents and z4,z5 is voltage
+//if v2 is short circuited
+z11=(1/(2+(24/10)));
+z22=(6/10)*z11;
+z33=(4/10)*z11;
+z44=z33*6;
+z55=z22*4;
+//when v1 is short ckted;
+z2a=(1/(4+(12/8)));
+z1a=(6/8)*z2a;
+z3a=(2/8)*z2a;
+z4v=z3a*6;
+z5v=z2a*4;
+H=[z11 -z22; -z22 z2a; z33 z3a; z55 z4v; -z55 z5v];
+
+H1=[H]';
+W=[100 0 0 0 0; 0 100 0 0 0; 0 0 75 0 0; 0 0 0 75 0; 0 0 0 0 75;]
+G=H1*W*H;
+
+z=[z1;z2;z3;z4;z5];
+x=(inv(G))*H1*W*z;
+zh=H*x;
+z=[z1;z2;z3;z4;z5];
+eh=z-zh;
+fh=100*eh(1)^2+100*eh(2)^2+75*eh(3)^2+75*eh(4)^2+75*eh(5)^2;
+k=3;
+alphha=.01;
+R=[.0100 0 0 0 0; 0 .0100 0 0 0; 0 0 .0133 0 0; 0 0 0 .0133 0; 0 0 0 0 .0133];
+F=H*inv(G)*(H')*inv(R);
+Rtemp=[diag(F)];
+
+er1=eh(1)/sqrt((1-F(1,1))*100);
+er2=eh(2)/sqrt((1-F(2,2))*100);
+er3=eh(3)/sqrt((1-F(3,3))*75);
+er4=eh(4)/sqrt((1-F(4,4))*75);
+er5=eh(5)/sqrt((1-F(5,5))*75);
+mprintf("for k=3 and alpha=.001 estimated value of function f is %f, which is greater than critical value of 11.35. therefore it contains some bad data\n",fh);
+mprintf("standardized error are er1=%f , er2=%f, er3=%f, er4=%f, er5=%f and we can see that er4 is greater so it should be rejected\n ",er1,er2,er3,er4,er5);
+H(4,:)=[];
+R(4,:)=[];;
+R(:,4)=[];
+W(4,:)=[];
+W(:,4)=[];
+G1=H'*W*H;
+z(4)=[];
+xh1=inv(G1)*H'*W*z;
+zh1=H*xh1;
+eh1=z-zh1;
+fh1=100*eh1(1)^2+100*eh1(2)^2+75*eh1(3)^2+75*eh1(4)^2;
+mprintf("for k=2 and alpha=.001 estimated value of function f is %f, which is greater than critical value of 9.21. therefore the measurement data is inaccurate and need to be more precise\n",fh1);
+
+
+
+
+
+
diff --git a/3793/CH15/EX15.1/exp_15_1.sce b/3793/CH15/EX15.1/exp_15_1.sce
new file mode 100644
index 000000000..d9c5bbce3
--- /dev/null
+++ b/3793/CH15/EX15.1/exp_15_1.sce
@@ -0,0 +1,11 @@
+clear;
+clc;
+Pdc=1;
+Pac=1;
+phi=acosd(.9428);
+mprintf(" power factor angle in degree is %.3f ",phi);
+p=[0.7:0.1:1];
+Pd=(.9428/(p));
+disp(Pd);
+disp(p);
+plot(p,Pd);
diff --git a/3793/CH15/EX15.2/exp_15_2.sce b/3793/CH15/EX15.2/exp_15_2.sce
new file mode 100644
index 000000000..2b4cdccad
--- /dev/null
+++ b/3793/CH15/EX15.2/exp_15_2.sce
@@ -0,0 +1,17 @@
+clear;
+clc;
+E_ll=110;
+U=12;
+V_o=(3*sqrt(2)*E_ll)/%pi;
+X=0;
+V_d1=(V_o*(cosd(X)+cosd(U+X)))/2;
+printf("\nthe dc output voltage when (X=0) = %.3f kV",V_d1);
+X1=25;
+V_d2=(V_o*(cosd(X1)+cosd(U+X1)))/2;
+printf("\nthe dc output voltage when (X1=25) = %.3f kV",V_d2);
+X2=90;
+V_d3=(V_o*(cosd(X2)+cosd(U+X2)))/2;
+printf("\nthe dc output voltage when (X2=90) = %.3f kV",V_d3);
+X3=120;
+V_d4=(V_o*(cosd(X3)+cosd(U+X3)))/2;
+printf("\nthe dc output voltage when (X3=120) = %.3f kV",V_d4);
diff --git a/3793/CH15/EX15.3/exp_15_3.sce b/3793/CH15/EX15.3/exp_15_3.sce
new file mode 100644
index 000000000..3730a1454
--- /dev/null
+++ b/3793/CH15/EX15.3/exp_15_3.sce
@@ -0,0 +1,12 @@
+clear;
+clc;
+E_ll=110;
+X=10;
+V_o=(3*sqrt(2)*E_ll)/%pi;
+U1=15;
+V_d1=(V_o*(cosd(X)+cosd(U1+X)))/2;
+printf("\nthe dc output voltage when (U1=15) = %.3f kV",V_d1);
+
+U2=20;
+V_d2=(V_o*(cosd(X)+cosd(U2+X)))/2;
+printf("\nthe dc output voltage when (U2=20) = %.3f kV",V_d2);
diff --git a/3793/CH15/EX15.4/exp_15_4.sce b/3793/CH15/EX15.4/exp_15_4.sce
new file mode 100644
index 000000000..5d242b931
--- /dev/null
+++ b/3793/CH15/EX15.4/exp_15_4.sce
@@ -0,0 +1,12 @@
+clear;
+clc;
+V_d=90;
+V_i=220;
+V_o=110'
+X=25;
+U=20;
+M=cosd(X)+cosd(X+U);
+E_ln=(2*%pi*V_d)/(3*sqrt(2)*M);
+printf("the effective voltage will be = %.3f kV",E_ln);
+D_s=E_ln/V_o;
+printf("\ndesired tap setting of transformer = %.3f",D_s);
diff --git a/3793/CH15/EX15.5/exp_15_5.sce b/3793/CH15/EX15.5/exp_15_5.sce
new file mode 100644
index 000000000..f4c084711
--- /dev/null
+++ b/3793/CH15/EX15.5/exp_15_5.sce
@@ -0,0 +1,13 @@
+clear;
+clc;
+V_0=100; //Six -pulse bridge rectifier voltage;
+V_1=110;//Line to Line Voltages;
+w=314;
+X=25;//Firing Angle in Degrees;
+I_r=1.2; //Rectifier Current in milli amperes;
+F=50;
+V_d0=(3*sqrt(2)*V_1)/%pi;
+V_o=V_d0*cosd(X);//open circuit Voltage;
+printf("the open circuuit voltage is = %.7f kv",V_o);
+L_c=(%pi*(V_o*cosd(X)-V_0))/(3*w*I_r);
+printf("\nthe inductance of the rectifier is = %.7f mH",L_c*10^3);
diff --git a/3793/CH15/EX15.6/exp_15_6.sce b/3793/CH15/EX15.6/exp_15_6.sce
new file mode 100644
index 000000000..05344a014
--- /dev/null
+++ b/3793/CH15/EX15.6/exp_15_6.sce
@@ -0,0 +1,8 @@
+clear;
+clc;
+v=600;
+betta=22;
+gammma=10;
+Vd=(2*v)/(cosd(betta)+cosd(gammma));
+El=(Vd*%pi)/(3*sqrt(2));
+mprintf("RMS value of voltage is %.3f KV",El);
diff --git a/3793/CH2/EX2.2/exp_2_2.sce b/3793/CH2/EX2.2/exp_2_2.sce
new file mode 100644
index 000000000..a185fff41
--- /dev/null
+++ b/3793/CH2/EX2.2/exp_2_2.sce
@@ -0,0 +1,25 @@
+clear;
+clc;
+function [r,th]=rect2pol(x,y)
+//rectangle to polar coordinate conversion
+ r=sqrt(x^2+y^2);
+ th = atan(y,x)*180/%pi;
+endfunction
+ // linear cominations
+ // 1 part (1+a)
+ a=complex((-0.5),0.866);
+ b=1+a;
+ [r,th]=rect2pol(real(b),imag(b));
+ mprintf("a) magnitude = %f, Angle = %f\n",r,th);
+ // 2 part (a^2 - 1)
+c=((a^2)-1)
+[r,th]=rect2pol(real(c),imag(c));
+ mprintf(" b) magnitude = %f, Angle = %f\n",r,th);
+ // 3 part (a^2 + a)
+d=((a^2)+a)
+[r,th]=rect2pol(real(d),imag(d));
+ mprintf(" c) magnitude = %f, Angle = %f\n",r,th);
+ // 4 part (a^2 + a + 1)
+e=((a^2)+a+1)
+[r,th]=rect2pol(real(e),imag(e));
+ mprintf(" d) magnitude = %f, Angle = %f",r,th);
diff --git a/3793/CH2/EX2.3/exp_2_3.sce b/3793/CH2/EX2.3/exp_2_3.sce
new file mode 100644
index 000000000..004c054d7
--- /dev/null
+++ b/3793/CH2/EX2.3/exp_2_3.sce
@@ -0,0 +1,26 @@
+clear;
+clc;
+ p=50; //power transmits in MW
+ pf=0.8; //power factor lagging
+ va=132 //actual voltage in kV
+ v=132; //KV base
+ m=100; // MVA base
+ z=complex(40,100); // transmision impedence
+ //calculate pu values
+ zb=(v^2)/m; //impedence base
+ i=(m*1000)/(sqrt(3)*va); //base current in KA
+ s=p/(pf*m);
+ ppu=p/m;
+ q=(((p/pf)*0.6)/m);
+ mprintf(" complex power pu= %.3f , active power pu= %.3f , reactive power pu=%.3f \n",s,ppu,q);
+ vpu=va/v;
+ mprintf(" kV pu= %.3f\n",vpu);
+ ia=(p*1000)/(sqrt(3)*va*pf);
+ ipu=ia/i;
+ mprintf(" current pu=%.3f \n",ipu);
+ za=sqrt(((real(z))^2) + ((imag(z))^2));
+ zpu=za/zb;
+ rpu=(real(z))/zb;
+ xpu=(imag(z))/zb;
+ mprintf(" Impedence pu= %.3f , resistance pu= %.3f , reactance pu=%.3f ",zpu,rpu,xpu);
+
diff --git a/3793/CH2/EX2.5/exp_2_5.sce b/3793/CH2/EX2.5/exp_2_5.sce
new file mode 100644
index 000000000..3259ae740
--- /dev/null
+++ b/3793/CH2/EX2.5/exp_2_5.sce
@@ -0,0 +1,47 @@
+clear;
+clc;
+ // parameters for generator g1
+ mva1=20;
+ kv1=6.6;
+ x1=0.1; // in pu
+ mvab=50; //mva base
+ kv11=6.6;
+ xg1=(x1*(((kv11^2)*mvab)/((kv1^2)*mva1)))
+ mprintf("Xg1=%.3f pu\n",xg1);
+ //parameters for generator g2
+ mva2=25;
+ kv2=11;
+ x2=0.2; // in pu
+ kv22=11;
+xg2=(x2*(((kv22^2)*mvab)/((kv2^2)*mva2)))
+ mprintf(" Xg2=%.3f pu\n",xg2);
+ //parameters for transformer t1
+ mva3=25;
+ kv3=132;
+ x3=0.08; // in pu
+ kv33=132;
+xt3=(x3*(((kv33^2)*mvab)/((kv3^2)*mva3)))
+ mprintf(" Xt3=%.3f pu\n",xt3);
+ //parameters for transformer t2
+ mva4=30;
+ kv4=132;
+ x4=0.10; // in pu
+ kv44=132;
+xt4=(x4*(((kv44^2)*mvab)/((kv4^2)*mva4)))
+ mprintf(" Xt4=%.3f pu\n",xt4);
+ //parameters for transmission line
+ kvb=132;
+ Z=complex(30,120);
+ Zpu=((Z*50))/(kvb^2);
+ mprintf(" Zpu=%.3f + j%.3f\n",real(Zpu),imag(Zpu));
+ //for load
+ s1=(10*(complex(0.8,0.6)));
+ s1pu=(s1/mvab);
+ mprintf(" S1pu=%.3f + j%.3f\n",real(s1pu),imag(s1pu));
+ s2=(25*(complex(0.9,0.436)));
+ s2pu=(s2/mvab);
+ mprintf(" S2pu=%.3f + j%.3f\n",real(s2pu),imag(s2pu));
+
+
+
+
diff --git a/3793/CH3/EX3.1/exp_3_1.sce b/3793/CH3/EX3.1/exp_3_1.sce
new file mode 100644
index 000000000..34ae376bd
--- /dev/null
+++ b/3793/CH3/EX3.1/exp_3_1.sce
@@ -0,0 +1,9 @@
+clear;
+clc;
+//there are 9 distances and self GMD of conducto will be the ninth root of the product of the nine distance
+d12=2;//consider 2 as 2r r=radius
+d23=2;//consider 2 as 2r r=radius
+d13=2; //consider 2 as 2r r=radius
+r1=.7788; // onsider .7788 as .7788r
+SGMD=((((.7788)^3)*(d12^2)*(d23^2)*(d13^2))^(1/9))
+mprintf("Self-GMD = %.4fr",SGMD);
diff --git a/3793/CH3/EX3.10/exp_3_10.sce b/3793/CH3/EX3.10/exp_3_10.sce
new file mode 100644
index 000000000..227a4e800
--- /dev/null
+++ b/3793/CH3/EX3.10/exp_3_10.sce
@@ -0,0 +1,19 @@
+clear;
+clc;
+//geometric constants
+a=sqrt((5^2)+1);
+b=sqrt(((4+1)^2)+(5^2));
+h=10;
+r=.02;
+s1=4;
+s2=6;
+c=10.773;
+ca=4*%pi*8.854*(10^(-12+9))*150;
+cb=(((a^2)*(b^2)*10*4)/((r^3)*(c^2)*s2))^(1/3);
+Cn=ca/log(cb);
+mprintf(" capacitance to neutral is %.3f microF\n",Cn);
+I=(2*%pi*50*Cn*10^(-3)*220)/(3^(1/2));
+mprintf(" Line Charging Current is %.3f A\n",I);
+Ip=I/2;
+mprintf("Charging Current per conductor is %.3f A",Ip);
+
diff --git a/3793/CH3/EX3.11/exp_3_11.sce b/3793/CH3/EX3.11/exp_3_11.sce
new file mode 100644
index 000000000..03405cdcd
--- /dev/null
+++ b/3793/CH3/EX3.11/exp_3_11.sce
@@ -0,0 +1,7 @@
+clear;
+clc;
+D=(6*6*12)^(1/3);
+ca=2*%pi*8.854*10^(-9);
+cb=log(D/sqrt(.013*.25));
+Cn=ca/cb;
+mprintf("Capacitance to neutral is %.14f F/Km",Cn);
diff --git a/3793/CH3/EX3.2/exp_3_2.sce b/3793/CH3/EX3.2/exp_3_2.sce
new file mode 100644
index 000000000..f4454aba7
--- /dev/null
+++ b/3793/CH3/EX3.2/exp_3_2.sce
@@ -0,0 +1,22 @@
+clear;
+clc;
+Aln=6;
+Dacsr=6;
+f=50;
+DAl=2;
+d1=120//distance
+Dst=(Dacsr-(2*DAl));
+d12=2;
+d16=2
+d=2;
+d13=sqrt(3)*d;
+d15=sqrt(3)*d;
+d14=2*d;
+Ds=((((.7788*d)*(d^2)*((sqrt(3)*d)^2)*(2*d))^6)^(1/36));// in book answer is misprinted of ds
+L=(((2*(10^(-7)))*(log1p(d1/Ds)))*(10^6));
+mprintf("L=%.5f mH/km\n",L);
+Li=2*L;
+mprintf(" Loop inductance = %.5f mH/km\n",Li);
+Xl=(2*(3.14)*(f*Li)*(10^(-3)))
+mprintf(" Inductive Reactance= %.5f ohm/km",Xl);
+
diff --git a/3793/CH3/EX3.3/exp_3_3.sce b/3793/CH3/EX3.3/exp_3_3.sce
new file mode 100644
index 000000000..6e0c9b12a
--- /dev/null
+++ b/3793/CH3/EX3.3/exp_3_3.sce
@@ -0,0 +1,22 @@
+clear;
+clc;
+D=1.200;
+r=.75*(10^2);
+rd=.7788*r;
+Ir=complex(25,-30);
+Iy=complex(35,-50);
+Ib=complex(-60,80);
+fln=2*(10^(-7))*(Ir*log(1/(3*D))+Iy*log(1/(2*D))+Ib*log(1/D));
+mprintf("flux linkage of the neutral = %.9f + i%.9f Wb-T/m\n",real(fln),imag(fln));
+Dn=%i*2*%pi*50*fln*10000;
+LMAT=zeros(3);
+LMAT(1,1)=log((2*D)/rd);
+LMAT(1,2)=log(2);
+LMAT(2,2)=log(D/rd);
+LMAT(3,2)=log(2);
+LMAT(3,3)=LMAT(1,1);
+I=[Ir;Iy;Ib];
+Vryb= %i*200*%pi*(10^(-7))*LMAT*I;
+mprintf(" Voltage drop per unit length = ");
+disp(Vryb);
+
diff --git a/3793/CH3/EX3.4/exp_3_4.sce b/3793/CH3/EX3.4/exp_3_4.sce
new file mode 100644
index 000000000..4bb4f4649
--- /dev/null
+++ b/3793/CH3/EX3.4/exp_3_4.sce
@@ -0,0 +1,14 @@
+clear;
+clc;
+
+//given parameter
+r=1; //radius
+d=3
+h=300;
+p=500;
+q=(100*sqrt((6^2)+(5^2)));
+l=(2*(10^-7)*log(((2^(1/6))*((d/(.7788*r))^(1/2))*((p/q)^(2/3)))));
+L=l*h*1000*1000;
+Xl= 2*%pi*50*L*(10^-3);
+mprintf(" Inductance = %.3f mH\n",L);
+mprintf(" Rectance = %.3f ohm",Xl);
diff --git a/3793/CH3/EX3.5/exp_3_5.sce b/3793/CH3/EX3.5/exp_3_5.sce
new file mode 100644
index 000000000..b49c3ad49
--- /dev/null
+++ b/3793/CH3/EX3.5/exp_3_5.sce
@@ -0,0 +1,20 @@
+clear;
+clc;
+
+f=50;
+d=.05; //Diameter Of each Conductor in m
+r=d/2; //radius Of each conductor
+D=.5; //Space Between Two Conductor in m
+ln=200; //Distance Of the Line in km
+Dsb=sqrt(.7788*r*D);
+Dyb=10;
+Dry=10;
+Dbr=20;
+D_eq=((Dyb*Dry*Dbr)^(1/3));
+L=(2*(10^-7)*log(D_eq/Dsb)*(10^(6)));
+mprintf(" Inductaance = %.3f mH/Km \n",L);
+l=L*ln*(10^-3)
+ mprintf("the Inductaance of the line= %.3f H\n",l);
+Xl=2*%pi*l*f;
+mprintf("the reactance of the line= %.3f ohm",Xl);
+
diff --git a/3793/CH3/EX3.6/exp_3_6.sce b/3793/CH3/EX3.6/exp_3_6.sce
new file mode 100644
index 000000000..a0dee9de9
--- /dev/null
+++ b/3793/CH3/EX3.6/exp_3_6.sce
@@ -0,0 +1,20 @@
+clear;
+clc;
+pe=(%pi*(8.85*10^(-12)));
+v=33000;
+d=1.5//distance
+r=.005 //radius in m
+h=5;
+l=5;
+Cab= ((.01206)/log10((d/r)))*(l);
+Cn=2*Cab;
+I=(2*%pi*50*Cab*v*10^(-6));
+ab=sqrt(1+((d^2)/(4*(h^2))))
+f=log(d/.050559);
+Cbb=((pe/f)*((10^9)*5)/2);
+
+mprintf(" capacitance = %.3f microF\n",Cab);
+mprintf(" capacitance to neutral = %.3f microF\n",Cn);
+mprintf(" charing current = j%.3f A\n",I);
+mprintf(" capacitance with earth cnsideration = %.3f microF\n",Cbb);// capacitance when effect of earth is considered
+
diff --git a/3793/CH3/EX3.8/exp_3_8.sce b/3793/CH3/EX3.8/exp_3_8.sce
new file mode 100644
index 000000000..1dc63a9d4
--- /dev/null
+++ b/3793/CH3/EX3.8/exp_3_8.sce
@@ -0,0 +1,12 @@
+clear;
+clc;
+D=6;
+r=.015;
+e=8.85*10^(-12);
+a=complex(0.5,-0.866);
+ca=log(r/(2*D))-(log(D/(2*r))*a);
+cb=(log((D^2)/(r^2))*log(r/(2*D)))-(log((2*D)/r)*log(D/(2*r)));
+Cyr= (2*%pi*e*(10^9)*ca)/cb;
+mprintf(" capacitance in microF/Km is %.3f %.3fi\n",real(Cyr),imag(Cyr));
+I=%i*2*%pi*50*Cyr*110000*10^-6;
+mprintf(" Current is %.3f+%.3fi A",real(I),imag(I));
diff --git a/3793/CH3/EX3.9/exp_3_9.sce b/3793/CH3/EX3.9/exp_3_9.sce
new file mode 100644
index 000000000..35dd1bca8
--- /dev/null
+++ b/3793/CH3/EX3.9/exp_3_9.sce
@@ -0,0 +1,19 @@
+clear;
+clc;
+Hr1y=15.93;
+Hyb1=12.65;
+Hbr1=15.93;
+Hrr1=18.93;
+Hyy1=12;
+Hbb1=12;
+Deq=4;
+Cb=(2*%pi*(8.854*10^(-12)));
+
+cb1=log(Deq/.02);
+cb2=log(((Hr1y*Hyb1*Hbr1)^(1/3))/((Hrr1*Hyy1*Hbb1)^(1/3)));
+Cn=(Cb/(cb1-cb2));
+
+Cln=Cn*100*10^(9);
+I=((2*%pi*50*Cln*(10^(-3))*220)/sqrt(3));
+mprintf("line capacitance to neutral = %.3f microF\n",Cln);
+mprintf("line current = %.3f A",I);
diff --git a/3793/CH4/EX4.1/exp_4_1.sce b/3793/CH4/EX4.1/exp_4_1.sce
new file mode 100644
index 000000000..dc020b3cc
--- /dev/null
+++ b/3793/CH4/EX4.1/exp_4_1.sce
@@ -0,0 +1,25 @@
+clear;
+clc;
+R=.11;
+L=1.5;
+c=.01;
+l=150;
+P=50;
+V=complex(72128.8,0);
+z=complex(.11,.471);
+Y=complex(0,(3.14*10^(-6)));
+Zc=complex(389.9,-44.925)
+gama=sqrt(Y*z);
+Ir=complex(230.94,-173.21);
+a=gama*l;
+sine=complex(.0148,.179);
+cosi=complex(.9838,.0027);
+Vs=(V*cosi)+(Zc*sine*Ir);
+mprintf("sending end voltage is = ")
+disp(Vs);
+Is=((V*sine)/Zc)+(cosi*Ir);
+mprintf("sending end current is = ")
+disp(Is);
+S=Vs*conj(Is)*10^(-6);
+effi=(P/(3*real(S)))*100;
+mprintf("efiiciency is = %f percentage",effi)
diff --git a/3793/CH4/EX4.10/exp_.sce b/3793/CH4/EX4.10/exp_.sce
new file mode 100644
index 000000000..19007ba94
--- /dev/null
+++ b/3793/CH4/EX4.10/exp_.sce
@@ -0,0 +1,22 @@
+clear;
+clc;
+v=400;
+Xl=.30;
+Xc=3.75*10^(-6);
+l=300;
+L=Xl/(2*%pi*50);
+C=Xc/(2*%pi*50);
+Zc=sqrt(L/C);
+mprintf(" surge impedence is %.3f ohm\n",Zc);
+phase=2*%pi*50*sqrt(L*C);
+pconstant=%i*phase;
+mprintf("propagation constant is %.4f\n",imag(pconstant));
+A=cos(phase*l);
+D=A;
+B=%i*Zc*sin(phase*l);
+C=(%i*sin(phase*l))/Zc;
+lamda=(3*10^(8))/50;
+SIL=v^(2)/Zc;
+mprintf("A,B,C and D parameters are respectively\n")
+disp(A,B,C,D);
+mprintf("Lamda and SIL is %.5fm and %.5fMW",lamda,SIL);
diff --git a/3793/CH4/EX4.11/exp_4_11.sce b/3793/CH4/EX4.11/exp_4_11.sce
new file mode 100644
index 000000000..78b7ca280
--- /dev/null
+++ b/3793/CH4/EX4.11/exp_4_11.sce
@@ -0,0 +1,37 @@
+clear;
+clc;
+L=.35/(2*%pi*50);
+C=4.2*10^(-6)/(2*%pi*50);
+Zc=sqrt(L/C);
+bet=2*%pi*50*sqrt(L*C);
+disp(bet);
+V=1;
+X=1;
+step=600/20;
+x=600:-step:0;
+y=(((cos(bet*x))+(%i*(sin(bet*x))/X)))*V;
+
+plot(x,abs(y),'k');
+set(gca(),"auto_clear","off");
+X=.25;
+y=(((cos(bet*x))+(%i*(sin(bet*x))/X)))*V;
+
+plot(x,abs(y),'-k');
+
+X=.5;
+y=(((cos(bet*x))+(%i*(sin(bet*x))/X)))*V;
+
+plot(x,abs(y),'k.');
+X=1.25;
+y=(((cos(bet*x))+(%i*(sin(bet*x))/X)))*V;
+
+plot(x,abs(y),'k*');
+X=1.5;
+y=(((cos(bet*x))+(%i*(sin(bet*x))/X)))*V;
+
+plot(x,abs(y),'kdiamond');
+
+xlabel('Distance from receiving end in km' );
+ylabel('Sending end voltage in pu');
+title("Voltage profile of a three phase tramsmission line");
+set(gca(),"auto_clear","on");
diff --git a/3793/CH4/EX4.12/exp_4_12.sce b/3793/CH4/EX4.12/exp_4_12.sce
new file mode 100644
index 000000000..f2ed3a0f9
--- /dev/null
+++ b/3793/CH4/EX4.12/exp_4_12.sce
@@ -0,0 +1,16 @@
+clear;
+clc;
+v=33;
+s=10;
+z=complex(0,20);
+vs=v/sqrt(3);
+vr=vs;
+Pm=(vr^2)/imag(z);
+del=asind(s/Pm);
+Qr=-((vr^2)/imag(z))+((vr^2)/imag(z)*cosd(del));
+mprintf("Power angle is %.4f degree and reactive power is %.4f MVAR\n",del,Qr);
+P=sqrt((vs^4)/(4*400));
+V=vr^2/2;
+Vr=sqrt(V);
+del1=asind((P*imag(z))/(vr*Vr));
+mprintf("Power angle when capacitance removed is %.4f degree and maximum real power is %.4f MW\n",del1,P);
diff --git a/3793/CH4/EX4.13/exp_4_13.sce b/3793/CH4/EX4.13/exp_4_13.sce
new file mode 100644
index 000000000..c53ceaa77
--- /dev/null
+++ b/3793/CH4/EX4.13/exp_4_13.sce
@@ -0,0 +1,23 @@
+clear;
+clc;
+Vs=1.02;
+Vr=0.9;
+Z=.1;
+anglez=80;
+Cs=(Vs^2)/Z*exp(complex(0,80));
+Cr=-(Vr^2)/Z*exp(complex(0,80));
+radius=Vs*Vr/Z;
+Pms=((Vs^2)/Z*cosd(anglez))+(Vs*Vr/Z);
+dels=180-anglez;
+Pmr=-(((Vr^2)/Z*cosd(anglez))-(Vs*Vr/Z));
+Ps=((Vs^2)/Z*cosd(anglez))-(Vs*Vr/Z*cosd(anglez+15));
+Pr=-(((Vr^2)/Z*cosd(anglez))-(Vs*Vr/Z*cosd(anglez-15)));
+loss=Ps-Pr;
+mprintf("Sending end maximum power is %.3f pu\n",Pms);
+mprintf("Receiving end maximum power is %.3f pu\n",Pmr);
+mprintf("Sending end maximum power angle is %.3f pu\n",dels);
+mprintf("Receiving end maximum power angle is %.3f pu\n",anglez);
+mprintf("Line loss is %.3f pu\n",loss);
+
+
+
diff --git a/3793/CH4/EX4.14/exp_4_14.sce b/3793/CH4/EX4.14/exp_4_14.sce
new file mode 100644
index 000000000..cc18aa3f6
--- /dev/null
+++ b/3793/CH4/EX4.14/exp_4_14.sce
@@ -0,0 +1,26 @@
+clear;
+clc;
+v=400;
+Xl=.30;
+Xc=3.75*10^(-6);
+l=300;
+L=Xl/(2*%pi*50);
+C=Xc/(2*%pi*50);
+Zc=sqrt(L/C);
+phase=2*%pi*50*sqrt(L*C);
+pconstant=%i*phase;
+Vs=v/sqrt(3);
+//case a open ckt
+Ir=0;
+Vr=Vs/(cos(phase*l));
+
+
+//terminated by surge impedence
+VR=Vs/(exp(%i*phase*l));
+//carries a load
+ld=.6;
+Vr1=Vs/(cos(phase*l)+((%i*sin(phase*l))/ld));
+vv=abs(Vr1);
+mprintf("Receiving end voltage when ckt is open %.4f kV\n ",Vr);
+mprintf("Receiving end voltage when line is terminated by surge impedence is open %.4f%.4f kV\n ",real(VR),imag(VR));
+mprintf("Receiving end voltage when load carries 60 percent load is open %.4f kV\n ",vv);
diff --git a/3793/CH4/EX4.15/exp_4_15.sce b/3793/CH4/EX4.15/exp_4_15.sce
new file mode 100644
index 000000000..563da9fb7
--- /dev/null
+++ b/3793/CH4/EX4.15/exp_4_15.sce
@@ -0,0 +1,43 @@
+clear;
+clc;
+v=400;
+Xl=.30;
+Xc=3.75*10^(-6);
+l=300;
+L=Xl/(2*%pi*50);
+C=Xc/(2*%pi*50);
+Zc=sqrt(L/C);
+phase=2*%pi*50*sqrt(L*C);
+pconstant=%i*phase;
+Vs=v/sqrt(3);
+Vr=Vs/(cos(phase*l));
+betal=18.9076;
+Xl=(Zc*sind(betal))/(1-cosd(betal));
+Xr=(3*(Vs^2))/Xl;
+mprintf("Reactance and rating of inductive shunt reactor are %.4f ohm and %.4f MVAR\n",Xl,Xr);
+//case b
+l=800;
+pf=.8;
+del12=asind((l*pf*91.6532)/v^2);
+Q12=((Vs^2/91.6532)*cosd(betal))-((Vs^2/91.6532)*cosd(del12));
+Cr=complex(0,3*Q12)-complex(0,800*.6);
+XC=v^2/Cr;
+cc=10^6/(2*%pi*50*(imag(XC)));
+mprintf("Rating and capacitance of capacitor are %.4f MVAR AND %.4f microF\n",imag(Cr),cc);
+//case c
+XX=Zc*sind(betal);
+com=.5;
+Xcs=com*XX;
+Ir=l/(sqrt(3)*v*pf);
+zz=complex(0,XX-Xcs);
+yy=complex(0,(2/Zc*tand(betal/2)));
+A=(1+(zz*yy/2));
+B=zz;
+Irr=Ir*complex(.8,-.6);
+Vsss=(.9519*Vs)+(zz*Irr);
+Vss=sqrt(3)*Vsss;
+Reg=((abs(Vss)-v)/v)*100;
+mprintf("Sending end voltage is %.4f+j%.4f kV\n",real(Vss),imag(Vss));
+mprintf("regulation is %.4f percent",Reg);
+disp(Irr)
+
diff --git a/3793/CH4/EX4.16/exp_4_16.sce b/3793/CH4/EX4.16/exp_4_16.sce
new file mode 100644
index 000000000..e9927f29a
--- /dev/null
+++ b/3793/CH4/EX4.16/exp_4_16.sce
@@ -0,0 +1,25 @@
+clear;
+clc;
+Rl=400;
+sl=300;
+Rs=80;
+sb=900;
+Rsb=400;
+va=300;
+vb=150;
+ta=sl/vb;
+tb=sb/va;
+reflectionca=(Rs-Rsb)/(Rs+Rsb);
+
+refractionca=(2*Rs)/(Rs+Rsb);
+reflectionca=-reflectionca;
+reflectionca1=-reflectionca;
+reflectioncb1=reflectionca;
+refractioncb=refractionca;
+refractioncb1=(2*Rsb)/(Rs+Rsb);
+refractionca1=refractioncb1;
+reflectionend=1;
+refractionend=0;
+v1=(reflectionend - reflectionca+.37+.163);//using bewley lattice diagram
+mprintf("From the diagram the voltage at 10 micros is %.4f pu",v1);
+
diff --git a/3793/CH4/EX4.4/exp_4_4.sce b/3793/CH4/EX4.4/exp_4_4.sce
new file mode 100644
index 000000000..9626f618a
--- /dev/null
+++ b/3793/CH4/EX4.4/exp_4_4.sce
@@ -0,0 +1,13 @@
+clear;
+clc;
+v=400;
+z=complex(.032,.30);
+y=complex(0,(3.5*(10^-6)));
+l=250;
+Zc=sqrt(z/y);
+g=sqrt(y*z);
+A=cosh(g*l);
+B=Zc*sinh(g*l);
+C=sinh(g*l)/Zc;
+D=A;
+mprintf("A B C D parameters are A=%f+j%f, B=%f+j%f ohm, C=%f+j%f S, D=%f+j%f",real(A),imag(A),real(B),imag(B),real(C),imag(C),real(D),imag(D));
diff --git a/3793/CH4/EX4.5/exp_4_5.sce b/3793/CH4/EX4.5/exp_4_5.sce
new file mode 100644
index 000000000..96cd5fc16
--- /dev/null
+++ b/3793/CH4/EX4.5/exp_4_5.sce
@@ -0,0 +1,23 @@
+clear;
+clc;
+phi=-36.87;
+v=33;
+l=1000;
+pf=0.8;
+r=20;
+xl=50;
+i=(l/(sqrt(3)*v*pf));
+
+Vr=v/sqrt(3);
+Ir=i*complex(.8,-.6);
+
+Vs=(Vr+((complex(r,xl)*Ir)/1000))*sqrt(3);
+reg=(((sqrt((real(Vs)^2)+(imag(Vs)^2)))-v)/v)*100;
+loss=((real(Ir)^2)+(imag(Ir)^2))*r;
+Ps=(l*1000)+loss;
+eff=((l*1000)/Ps)*100;
+mprintf("sending end voltage=%f+j%f V, sending end real power=%f W, efficiency=%f percent, regulation=%f percent and loss=%f W",real(Vs),imag(Vs),Ps,eff,reg,loss);
+
+
+
+
diff --git a/3793/CH4/EX4.6/exp_4_6.sce b/3793/CH4/EX4.6/exp_4_6.sce
new file mode 100644
index 000000000..8b71ee1e7
--- /dev/null
+++ b/3793/CH4/EX4.6/exp_4_6.sce
@@ -0,0 +1,32 @@
+clear;
+clc;
+l=60;
+v=66;
+load1=25;
+pf=.8;
+r=.08;
+l=1.25;
+f=50;
+Z=complex(.08,(2*%pi*f*1.25*(10^-3)))*60;
+Vr=(v/sqrt(3));
+I=((25*1000)/(sqrt(3)*66*0.8))*complex(.8,-.6);
+A=1;
+D=1;
+C=0;
+B=Z;
+M=[A Z;C D]*[Vr*1000;I];
+Vs=M(1,:)*(10^-3);
+Vs1=Vs*sqrt(3);
+mprintf("Vs=%f+j%f Kv\n",real(Vs1),imag(Vs1));
+Is=M(2,:);
+mprintf("Is=%f+j%f A\n",real(Is),imag(Is));
+reg=(((sqrt((real(Vs)^2)+(imag(Vs)^2)))-Vr)/Vr)*100;
+mprintf("Regulation=%f percent\n",reg);
+yy=-(atan(imag(I)/real(I))*180)/%pi;
+xx=(atan(imag(Vs)/real(Vs))*180)/%pi;
+PhiS=yy + xx ;
+PS=((3*(sqrt((real(Vs)^2)+(imag(Vs)^2)))*(sqrt((real(Is)^2)+(imag(Is)^2)))*cosd(PhiS))/1000);
+
+eff=(load1/PS)*100;
+mprintf("Efficiency=%f percent",eff);
+
diff --git a/3793/CH4/EX4.7/exp_4_7.sce b/3793/CH4/EX4.7/exp_4_7.sce
new file mode 100644
index 000000000..edc1eae0d
--- /dev/null
+++ b/3793/CH4/EX4.7/exp_4_7.sce
@@ -0,0 +1,13 @@
+clear;
+clc;
+l=250;
+z=complex(.032,.30);
+y=complex(0,3.5*10^(-6));
+Z=z*l;
+Y=y*l;
+A=1+((Y*Z)/2);
+B=Z;
+C=Y*(1+(Y*Z)/4);
+D=A;
+mprintf("A,B,C and D parameters are respectively");
+disp(A,B,C,D);
diff --git a/3793/CH4/EX4.8/exp_4_8.sce b/3793/CH4/EX4.8/exp_4_8.sce
new file mode 100644
index 000000000..d9692680c
--- /dev/null
+++ b/3793/CH4/EX4.8/exp_4_8.sce
@@ -0,0 +1,27 @@
+clear;
+clc;
+R=15;
+L=.2;
+C=0.5*10^(-6);
+P=1000;
+V=22;
+pf=0.71;
+Z=complex(15,(2*%pi*50*L));
+Y=complex(0,(2*%pi*50*C));
+A=1+((Y*Z)/2);
+D=A;
+B=Z;
+C=Y*(1+(Y*Z/4));
+Ir=(P/V)*complex(.71,-.70421);
+Vs=[A B; C D]*[22000;Ir];
+Vss=sqrt(((real(Vs(1,1)))^2)+((imag(Vs(1,1)))^2))*(10^(-3));
+Iss=sqrt(((real(Vs(2,1)))^2)+((imag(Vs(2,1)))^2));
+mprintf("Sending End Voltage is %.3f KV\n",Vss);
+mprintf("Sending End Current is %.3f A\n",Iss);
+del1=atand(imag(Vs(1,1)/real(Vs(1,1))));
+del2=atand(imag(Vs(2,1)/real(Vs(2,1))));
+pf1=cosd(del1-del2);
+mprintf("power factor at sending End is %.3f\n ",pf1);
+Vrnl=Vss/real(A);
+mprintf("No load Receiving End Voltage is %.3f A",Vrnl);
+
diff --git a/3793/CH4/EX4.9/exp_4_9.sce b/3793/CH4/EX4.9/exp_4_9.sce
new file mode 100644
index 000000000..469b84243
--- /dev/null
+++ b/3793/CH4/EX4.9/exp_4_9.sce
@@ -0,0 +1,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);
+
+
+
+
+
diff --git a/3793/CH5/EX5.1/exp_5_1.sce b/3793/CH5/EX5.1/exp_5_1.sce
new file mode 100644
index 000000000..b0ff219b9
--- /dev/null
+++ b/3793/CH5/EX5.1/exp_5_1.sce
@@ -0,0 +1,18 @@
+clear;
+clc;
+S=250;
+V=3330;
+r=.25;
+x=3.5;
+pf=0.8;
+i=(S*1000)/(sqrt(3)*V);
+Il=i;
+Vp=(V/sqrt(3));
+z=complex(r,x);
+Ia=complex(34.99,-26.24);
+E=Vp+(Ia*z);
+
+Vv=sqrt((real(E)^2)+(imag(E)^2));
+reg=((Vv-Vp)/Vp)*100;
+
+mprintf("regulation=%f percent",reg);
diff --git a/3793/CH5/EX5.2/exp_5_2.sce b/3793/CH5/EX5.2/exp_5_2.sce
new file mode 100644
index 000000000..64302f117
--- /dev/null
+++ b/3793/CH5/EX5.2/exp_5_2.sce
@@ -0,0 +1,42 @@
+clear;
+clc;
+V=33;
+S=45;
+pf=0.8;
+x=10;
+P=S*pf;
+z=complex(0,10);
+I=(P*1000)/(sqrt(3)*V*pf);
+Vp=V/sqrt(3);
+Ia=I*(complex(0.8,-0.6));
+E=(Vp*1000)+(z*Ia);
+mprintf("Excitation voltage per phase %.3f + %.3f\n",real(E),imag(E));
+Vv=sqrt((real(E)^2)+(imag(E)^2));
+del=asind((10*10)/((Vv*10^(-3))*Vp));
+x=Vv*cosd(del);
+y=Vv*sind(del);
+VV=complex(x,y);
+II=(VV-(Vp*1000))/complex(0,10);
+pf1=cosd(atand(imag(II)/real(II)));
+mprintf("Armature current %.3f + %.3f\n",real(II),imag(II));
+mprintf("load angle %f\n",del);
+mprintf("power factor %f\n",pf1);
+maxdel=90;
+x1=Vv*cosd(maxdel);
+y1=Vv*sind(maxdel);
+VV1=complex(x1,y1);
+II1=(VV1-(Vp*1000))/complex(0,10);
+pf2=cosd(atand(imag(II1)/real(II1)));
+
+Pmax=(3*Vp*(Vv*10^(-3)))/10;
+mprintf("Maximum power %f",Pmax);
+p=P/3; // at minimum excitation pf is unity there fore power is per phase
+
+E1=(p*10)/Vp;
+x2=E1*cosd(maxdel);
+y2=E1*sind(maxdel);
+VV2=complex(x2,y2);
+II2=((VV2-(Vp))*1000)/complex(0,10);
+pf3=cosd(atand(imag(II2)/real(II2)));
+
+
diff --git a/3793/CH5/EX5.3/exp_5_3.sce b/3793/CH5/EX5.3/exp_5_3.sce
new file mode 100644
index 000000000..c59f88723
--- /dev/null
+++ b/3793/CH5/EX5.3/exp_5_3.sce
@@ -0,0 +1,54 @@
+clear;
+clc;
+function [Ecom,Emag]=vcurves(Prtd,Xs,Vt,Phi,K);
+ index=1;
+ if index==1;
+ X= input('percentage load');
+ Pg=X*Prtd;
+ Vt=Vt/sqrt(3);
+ pfang=Phi*%pi/180;
+ x=pfang:-.005:-pfang;
+ Pg=Pg*ones(1,length(x));
+ Ia=Pg./(3*abs(Vt)*cos(x));
+ Iacom=Ia.*(cos(x)+%i*sin(x));
+ Ecom=Vt+%i*Xs*Iacom;
+ Emag=abs(Ecom);
+ Ifld=Emag*1000/K;
+ plot(Ifld,Ia,'k');
+
+ set(gca(),"auto_clear","off");
+ return;
+
+ plot(Ifld,Ia,'k-');
+ return;
+
+ plot(Ifld,Ia,'k-.');
+ return;
+
+ plot(Ifld,Ia,'k.');
+ return;
+
+ set(gca(),"auto_clear","on");
+
+
+
+ else
+
+ end
+endfunction
+Prtd=36;
+Vt=33;
+Xs=10;
+Phi=70;
+K=1500;
+
+[Ecom,Emag]=vcurves(Prtd,Xs,Vt,Phi,K);
+[Ecom,Emag]=vcurves(Prtd,Xs,Vt,Phi,K);
+[Ecom,Emag]=vcurves(Prtd,Xs,Vt,Phi,K);
+[Ecom,Emag]=vcurves(Prtd,Xs,Vt,Phi,K);
+index=0;
+
+xlabel('Field current in amperes');
+ylabel('Armature current in amp');
+title('Plot of V-curves of a Synchronous machine');
+
diff --git a/3793/CH5/EX5.4/exp_5_4.sce b/3793/CH5/EX5.4/exp_5_4.sce
new file mode 100644
index 000000000..cf76dda7b
--- /dev/null
+++ b/3793/CH5/EX5.4/exp_5_4.sce
@@ -0,0 +1,39 @@
+clear;
+clc;
+E=1;
+Ig=.8;
+pf=.8;
+Xd=1.1;
+Xq=.8;
+p=E+complex(0,Xq)*Ig*complex(.8,-.6);
+angle=atand(imag(p)/real(p));
+dell=acosd(pf);
+Iq=Xq*cosd(dell+angle);
+Id=Xq*sind(dell+angle);
+function [A] = p2z(R,Theta)
+ if argn(2) <> 2 then
+ error("incorrect number of arguments.");
+ end
+ if ~and(size(R) == size(Theta)) then
+ error("arguments must be of the same dimension.");
+ end
+ A = R.*exp(%i*%pi*Theta/180.);
+endfunction
+Iqq=p2z(Iq,(20.3015));
+Idd=p2z(Id,(-69.685));
+
+EE=E+complex(0,Xd)*Idd+complex(0,Xq)*Iqq;
+mprintf("Excitation voltage and load angles are %.4f+%.4f pu and %.4f degree\n",real(EE),imag(EE),angle);
+step=2*%pi/100;
+delta=0:step:%pi;
+PP=(1.6673*E/Xd)*sin(delta);
+plot(delta,PP,'-k');
+set(gca(),"auto_clear","off")
+PP1=.5*(1/Xq-1/Xd)*sin(2*delta);
+plot(delta,PP1,'k.');
+PP2=PP+PP1;
+plot(delta,PP2,'k');
+xlabel('power angle in radians');
+ylabel('Power output in per unit');
+title('Plot of power generated vs power angle');
+set(gca(),"auto_clear","on")
diff --git a/3793/CH5/EX5.5/exp_5_5.sce b/3793/CH5/EX5.5/exp_5_5.sce
new file mode 100644
index 000000000..a57e5c163
--- /dev/null
+++ b/3793/CH5/EX5.5/exp_5_5.sce
@@ -0,0 +1,19 @@
+clear;
+clc;
+//case1
+V2=2300;
+S=150;
+V1=11500+V2;
+a=(V1-V2)/V2; //two winding transformer ratio
+
+aa=a+1; //autotransformer ratio
+output=((1+a)/a)*S;
+mprintf("output for 1 case %f KVA\n",output);
+//case 2
+V11=13.8;
+V22=11.5;
+a1=(V11-V22)/V22;
+
+output1=((1+a1)/a1)*S;
+mprintf("output for 2 case %f KVA\n",output1);
+
diff --git a/3793/CH5/EX5.6/exp_5_6.sce b/3793/CH5/EX5.6/exp_5_6.sce
new file mode 100644
index 000000000..78ff89fb0
--- /dev/null
+++ b/3793/CH5/EX5.6/exp_5_6.sce
@@ -0,0 +1,20 @@
+clear;
+clc;
+v1=66;
+v2=11;
+v3=6.6;
+s1=20;
+s2=10;
+s3=5;
+Xps=0.1;
+Xpt=0.12;
+Xst=.08;
+//now these rectance in pu and converted into 50 MVA base
+xps=Xps*(50/s1);
+xpt=Xpt*(50/s1);
+xst=Xst*(50/s2);
+Xp=complex(0,((xps+xpt-xst)/2));
+Xs=complex(0,((xps-xpt+xst)/2));
+Xs1=complex(0,((-xps+xpt+xst)/2));
+mprintf(" pu leakage reactances are %f, %f and %f",imag(Xp),imag(Xs),imag(Xs1));
+
diff --git a/3793/CH5/EX5.7/exp_5_7.sce b/3793/CH5/EX5.7/exp_5_7.sce
new file mode 100644
index 000000000..0be71feab
--- /dev/null
+++ b/3793/CH5/EX5.7/exp_5_7.sce
@@ -0,0 +1,17 @@
+clear;
+clc;
+v=220;
+s=5;
+z=4.5;
+Vb=11;
+sb=50;
+Zb=(Vb^2)/s;
+Zpu=z/Zb;
+mprintf("pu leakage reactance is %f\n",Zpu);
+a=Vb/v;
+Zs=z/(a^2);
+//case2
+vb1=220;
+Zb1=(vb1^2)/s;
+Zpu1=Zs/Zb1;
+mprintf("Ratio of pu leakage reactances are %f",Zpu1);
diff --git a/3793/CH5/EX5.8/exp_5_8.sce b/3793/CH5/EX5.8/exp_5_8.sce
new file mode 100644
index 000000000..194e3d102
--- /dev/null
+++ b/3793/CH5/EX5.8/exp_5_8.sce
@@ -0,0 +1,18 @@
+clear;
+clc;
+s=5;
+v1=11;
+v2=66;
+X1=.08;
+xm=75;
+Z1=(v1^2)/s;
+X11=X1*Z1;
+Xmm=xm*Z1;
+mprintf(" Actual reactance for primary X1=%f ohm and Xm=%f ohm\n",X11,Xmm);
+//case2
+Z2=(v2^2)/s;
+X2=X1*Z2;
+X2m=xm*Z2;
+mprintf(" Actual reactance for secondary X1=%f ohm and Xm=%f ohm\n",X2,X2m);
+mprintf("The pu values are independent of the side to which they are refeered. Therefore the pu values of X1 and Xm remain unchanged for all types of 3 phase transformer connections.")
+
diff --git a/3793/CH5/EX5.9/exp_5_9.sce b/3793/CH5/EX5.9/exp_5_9.sce
new file mode 100644
index 000000000..6d6734f8d
--- /dev/null
+++ b/3793/CH5/EX5.9/exp_5_9.sce
@@ -0,0 +1,33 @@
+clear;
+clc;
+s=50;
+vt=150;
+Sg1=50;
+vg1=11;
+Xg1=0.1;
+Sg2=40;
+vg2=6.6;
+xg2=.12;
+St1=100;
+Xt1=.15;
+St2=50;
+xt2=.1;
+vt1=220;
+l=75;
+pf=0.8;
+Z34=complex(30,150);
+Z35=complex(20,40);
+Z45=complex(25,60);
+Zb=(vt1^2)/100;
+z34=Z34/Zb;
+z35=Z35/Zb;
+z45=Z45/Zb;
+mprintf("reactances in pu are Z34=%f+j%f pu, Z35=%f+j%f pu and Z45=%f+j%f pu\n",real(z34),imag(z34),real(z35),imag(z35),real(z45),imag(z45));
+vbg1=11;
+vbg2=6.313;
+Xg11=Xg1*(vt/Sg1)*((vbg1/vbg2)^2);
+Xt11=Xt1*(vt/St1)*((vbg1/vbg2)^2);
+Xg22=xg2*(vt/Sg2)*((vg2/vbg2)^2);
+Xt22=xt2*(vt/St2)*((vg2/vbg2)^2);
+l1=(l/vt)*complex(.8,.6);
+mprintf("reactance of transformer and generator in pu are Xg1=%f pu, Xg2=%f pu, Xt1=%f pu, Xt2=%f pu and load=%f+j%f pu ",Xg11,Xg22,Xt11,Xt22,real(l1),imag(l1));
diff --git a/3793/CH6/EX6.1/exp_6_1.sce b/3793/CH6/EX6.1/exp_6_1.sce
new file mode 100644
index 000000000..8ada421e5
--- /dev/null
+++ b/3793/CH6/EX6.1/exp_6_1.sce
@@ -0,0 +1,17 @@
+clear;
+clc;
+A=[-1 0 0; 0 0 -1; 1 -1 0; 0 -1 1; -1 0 1];
+B=(A');
+z=diag([.05;.10;.5;.40;.25]);
+y=pinv(z);
+Yb=(B*y*A);
+mprintf("Ybus matrix without coupling\n");
+disp(Yb);
+
+//case2
+z1=[.05 0 0 0 0; 0 .10 0 0 0; 0 0 .5 0 0; 0 0 0 .4 .2;0 0 0 .2 .25];
+y1=pinv(z1);
+Y1b=B*y1*A;
+mprintf("\nYbus matrix with coupling\n");
+disp(Y1b);
+Zb=pinv(Y1b);
diff --git a/3793/CH6/EX6.3/exp_6_3.sce b/3793/CH6/EX6.3/exp_6_3.sce
new file mode 100644
index 000000000..52097172a
--- /dev/null
+++ b/3793/CH6/EX6.3/exp_6_3.sce
@@ -0,0 +1,31 @@
+clear;
+clc;
+y12=complex(.0059,-.0235);
+y14=complex(.0055,-.0183);
+y23=complex(.0077,-.0385);
+y24=complex(.0240,-.0320);
+y34=complex(.0100,-.0300);
+y40=complex(.0100,-.0200);
+Y11=y12+y14;
+Y22=y12+y23+y24;
+Y33=y23+y34;
+Y44=y14+y24+y34+y40;
+Y13=0;
+Y31=0;
+Y12=-y12;
+Y21=-y12;
+Y14=-y14;
+Y41=-y14;
+Y23=-y23;
+Y32=-y23;
+Y24=-y24;
+Y42=-y24;
+Y34=-y34;
+Y43=-y34;
+Yb=[Y11 Y12 Y13 Y14; Y21 Y22 Y23 Y24; Y31 Y32 Y33 Y34; Y41 Y42 Y43 Y44];
+mprintf(" Ybus matrix is\n");
+disp(Yb);
+
+
+
+
diff --git a/3793/CH6/EX6.4/exp_6_4.sce b/3793/CH6/EX6.4/exp_6_4.sce
new file mode 100644
index 000000000..82907e511
--- /dev/null
+++ b/3793/CH6/EX6.4/exp_6_4.sce
@@ -0,0 +1,18 @@
+clear;
+clc;
+y=[4 3 6;2 8 5;1 5 9];
+nbus=3;
+l11=4;
+disp(y(1,2));
+u12=(1/l11)*y(1,2);
+u13=(1/l11)*y(1,3);
+l21=2;
+l22=y(2,2)-(l21*u12);
+u23=(1/l22)*(y(2,3)-(l21*u13));
+l31=1;
+l32=y(3,2)-(l31*u12);
+l21=2;
+l33=y(3,3)-(l31*u13)-(l32*u23);
+Yb=[l11 u12 u13; l21 l22 u23;l31 l32 l33];
+mprintf("matrix for table of factor is\n")
+disp(Yb);
diff --git a/3793/CH6/EX6.5/exp_6_5.sce b/3793/CH6/EX6.5/exp_6_5.sce
new file mode 100644
index 000000000..519654d61
--- /dev/null
+++ b/3793/CH6/EX6.5/exp_6_5.sce
@@ -0,0 +1,62 @@
+clear;
+clc;
+
+function[Ybus,I]=fbsub(Ybus,nbus,I);
+ for k=1:nbus;
+ if k==1;
+ for j=2:nbus;
+ Ybus(k,j)=Ybus(k,j)/Ybus(k,k);
+ end
+else
+ for j=2:nbus;
+ if j<=k;
+ for m=1:j-1;
+ Ybus(k,j)=Ybus(k,j)-Ybus(k,m)*Ybus(m,j);
+
+ end
+else
+ for m=1:k-1;
+ Ybus(k,j)=Ybus(k,j)-Ybus(k,m)*Ybus(m,j);
+
+ end
+ Ybus(k,j)=Ybus(k,j)/Ybus(k,k);
+end
+end
+end
+end
+for k=1:nbus;
+ if k==1;
+ I(k)=I(k)/Ybus(k,k);
+ else
+ for j=1:k-1;
+ I(k)=I(k)-Ybus(k,j)*I(j);
+end
+I(k)=I(k)/Ybus(k,k);
+end
+end
+for k=nbus:-1:1;
+ if k==nbus;
+ disp('node voltages');
+ disp(Ybus);
+
+
+ else
+ for j=nbus:-1:k+1;
+ I(k)=I(k)-Ybus(k,j)*I(j);
+end
+end
+end
+endfunction
+Ybus=[4 3 6;2 8 5;1 5 9];
+nbus=3;
+I=[1;1;1];
+[Ybus,I]=fbsub(Ybus,nbus,I);
+V1=1/Ybus(1,1);
+V2=(1/Ybus(2,2))*(1-2*V1);
+V3=(1/Ybus(3,3))*(1-1*V1-4.25*V2);
+VV3=V3;
+VV2=(V2-Ybus(2,3)*V3);
+VV1=(V1-Ybus(1,2)*VV2-Ybus(1,3)*V3);
+V=[VV1 ; VV2 ;VV3]
+disp("V is");
+disp(V);
diff --git a/3793/CH6/EX6.6/exp_6_6.sce b/3793/CH6/EX6.6/exp_6_6.sce
new file mode 100644
index 000000000..5a4c85cb4
--- /dev/null
+++ b/3793/CH6/EX6.6/exp_6_6.sce
@@ -0,0 +1,52 @@
+clear;
+clc;
+Zb=complex(0,.20);
+Z1b=complex(0,.25);
+V1=Z1b;
+
+Z2b=[Z1b 0;0 Z1b];
+//p=2,q=3
+Zbn=complex(0,.10);
+Z22=complex(0,.25);
+Z33=Z22+Zbn;
+Z13=complex(0,0);
+Z31=Z13;
+Z32=complex(0,.25);
+Z23=Z32;
+
+Z2bn=[Z1b 0 Z13;0 Z22 Z23;Z31 Z32 Z33];
+//p=1,q=4
+Z44=Z1b+Zb;
+Z14=complex(0,.25);
+Z41=Z14;
+Z24=complex(0,0);
+Z42=complex(0,0);
+Z34=complex(0,0);
+Z43=Z34;
+Z4b=[Z1b 0 Z13 Z14;0 Z22 Z23 Z24;Z31 Z32 Z33 Z34;Z41 Z42 Z43 Z44];
+//p=3,q=4
+Zbb=complex(0,.3);
+y=1/((Zbb+Z33)-(2*Z34)+Z44);
+Z=[Z13-Z14;Z23-Z24;Z33-Z34;Z43-Z44];
+Z5b=Z4b-((-y)*Z*(Z'));
+//p=0,q=3
+y1=1/(Zbn+Z5b(3,3));
+ZZ=[-Z5b(1,3);-Z5b(2,3);-Z5b(3,3);-Z5b(4,3)];
+Z6b=Z5b-((-y1)*ZZ*(ZZ'));
+mprintf("Z1b = \n");
+disp(Z1b);
+mprintf("Z2b = \n");
+disp(Z2bn);
+
+mprintf("Z4b = \n");
+disp(Z4b);
+mprintf("Z5b = \n");
+disp(Z5b);
+mprintf("Z6b = \n");
+disp(Z6b);
+
+
+
+
+
+
diff --git a/3793/CH6/EX6.7/exp_6_7.sce b/3793/CH6/EX6.7/exp_6_7.sce
new file mode 100644
index 000000000..b97351b7c
--- /dev/null
+++ b/3793/CH6/EX6.7/exp_6_7.sce
@@ -0,0 +1,67 @@
+clear;
+clc;
+function [Zbus]=zeebus(nelemnt,ind,node);
+ if ind==1;
+ Zbus=input('Partial matrix Zbus');
+ ind=0;
+ else
+ end
+ if ind==0;
+ for l=1:nelemnt;
+ p=input('bus number p');
+ q=input('bus number q');
+ zb=input('impedence');
+ typee=input('type of bus');
+ if typee==1;
+ for k=1:q;
+ if k==q;
+ Zbus(k,k)=zb;
+ else
+ Zbus(k,q)=0;
+ end
+ end
+ end
+ if typee==2;
+ for k=1:q;
+ if k==q;
+ Zbus(q,q)=zb+Zbus(p,p);
+ else
+ if k==p;
+ Zbus(p,q)=Zbus(p,p);
+ Zbus(q,p)=Zbus(p,q);
+ else
+ Zbus(k,q)=0;
+ Zbus(q,k)=0;
+ end
+ end
+ end
+ end
+ if typee==3;
+ y=1/(zb+Zbus(p,p)-2*Zbus(p,q)+Zbus(q,q));
+ for k=1:node;
+ X(k,1)=Zbus(k,p)-Zbus(k,q);
+ Xt(1,k)=(k:1);
+ end
+ Zbus=Zbus-(-y)*X*X';
+ end
+ if typee==4;
+ y=1/(zb+Zbus(q,q));
+ for k=1:node;
+ X(k,1)=-Zbus(k,q);
+ Xt(1,k)=(k:1);
+ end
+ Zbus=Zbus-(-y)*X*X';
+ end
+ end
+ else
+
+
+ end
+
+endfunction
+nelemnt=7;
+ind=0;
+node=4;
+[Zbus]=zeebus(nelemnt,ind,node);
+mprintf("Zbus = \n");
+disp(Zbus);
diff --git a/3793/CH6/EX6.8/exp_6_8.sce b/3793/CH6/EX6.8/exp_6_8.sce
new file mode 100644
index 000000000..7bda4e775
--- /dev/null
+++ b/3793/CH6/EX6.8/exp_6_8.sce
@@ -0,0 +1,71 @@
+clear;
+clc;
+function [Zbus]=zeebus(nelemnt,ind,node);
+ if ind==1;
+ Zbus=input('Partial matrix Zbus');
+ ind=0;
+ else
+ end
+ if ind==0;
+ for l=1:nelemnt;
+ p=input('bus number p');
+ q=input('bus number q');
+ zb=input('impedence');
+ typee=input('type of bus');
+ if typee==1;
+ for k=1:q;
+ if k==q;
+ Zbus(k,k)=zb;
+ else
+ Zbus(k,q)=0;
+ end
+ end
+ end
+ if typee==2;
+ for k=1:q;
+ if k==q;
+ Zbus(q,q)=zb+Zbus(p,p);
+ else
+ if k==p;
+ Zbus(p,q)=Zbus(p,p);
+ Zbus(q,p)=Zbus(p,q);
+ else
+ Zbus(k,q)=0;
+ Zbus(q,k)=0;
+ end
+ end
+ end
+ end
+ if typee==3;
+ y=1/(zb+Zbus(p,p)-2*Zbus(p,q)+Zbus(q,q));
+ for k=1:node;
+ X(k,1)=Zbus(k,p)-Zbus(k,q);
+ Xt(1,k)=(k:1);
+ end
+ Zbus=Zbus-(-y)*X*X';
+ end
+ if typee==4;
+ y=1/(zb+Zbus(q,q));
+ for k=1:node;
+ X(k,1)=-Zbus(k,q);
+ Xt(1,k)=(k:1);
+ end
+ Zbus=Zbus-(-y)*X*X';
+ end
+ end
+ else
+
+
+ end
+
+endfunction
+nelemnt=7;
+ind=0;
+node=4;
+[Zbus]=zeebus(nelemnt,ind,node);
+mprintf("Zbus = \n");
+disp(Zbus);
+nelemnt=1;
+ind=1;
+[Zbus]=zeebus(nelemnt,ind,node);
+disp(Zbus);
diff --git a/3793/CH8/EX8.3/exp_8_3.sce b/3793/CH8/EX8.3/exp_8_3.sce
new file mode 100644
index 000000000..d10ed7e31
--- /dev/null
+++ b/3793/CH8/EX8.3/exp_8_3.sce
@@ -0,0 +1,15 @@
+clear;
+clc;
+S=110;
+ff=.1;
+sg=.05;
+f=50;
+//supplying to infinite work
+mprintf("since power is supplied to infinite work frequency changes are independent of output\n");
+mprintf("Since DelPg(0) is proportional to DelP(ref) therefore turbine generation can be reduced by giving a command to servometer of the speed changer to lower the turbine generation by 10 MW\n");
+//network is finite
+R=(sg*f)/S;
+Pg=-(1/R)*(-ff);
+mprintf("The drop in hertz per megawatt is %.3f Hz/MW\n",R);
+mprintf("Increase in turbine power is %.3f MW",Pg);
+
diff --git a/3793/CH8/EX8.4/exp_8_4.sce b/3793/CH8/EX8.4/exp_8_4.sce
new file mode 100644
index 000000000..d37fbfc7f
--- /dev/null
+++ b/3793/CH8/EX8.4/exp_8_4.sce
@@ -0,0 +1,15 @@
+clear;
+clc;
+g1=200;
+g2=300;
+f=50;
+fr=.5;
+dl=150;
+lg1=g1/(g1+g2)*dl;
+lg2=g2/(g1+g2)*dl;
+Rg1=-fr/lg1;
+Rg2=-fr/lg2;
+Rpu1=(fr*g1)/(f*lg1);
+Rpu2=(fr*g2)/(f*lg1);
+mprintf("Drop for G1 and G2 is Rg1=%.4f Hz/MW and Rg2=%.4f Hz/MW\n",Rg1,Rg2);
+mprintf("Drop in pu is Rg1=%.4f pu ad Rg2=%.4f pu",Rpu1,Rpu2);
diff --git a/3793/CH8/EX8.5/exp_8_5.sce b/3793/CH8/EX8.5/exp_8_5.sce
new file mode 100644
index 000000000..d16657c9f
--- /dev/null
+++ b/3793/CH8/EX8.5/exp_8_5.sce
@@ -0,0 +1,14 @@
+clear;
+clc;
+Rc=2500;
+il=1500;
+H=4;
+rg=2;
+f=50;
+D=il/f;
+Dpu=D/Rc;
+Kps=1/Dpu;
+Tps=(2*H)/(Dpu*f);
+mprintf("The initial area load freq dependence parameter in MW/Hz and in pu are %.3f MW/Hz and %.3f pu\n",D,Dpu);
+mprintf("gain=%.3f Hz/pu MW\n",Kps);
+mprintf("Time Constant=%.3f s",Tps);
diff --git a/3793/CH8/EX8.6/exp_8_6.sce b/3793/CH8/EX8.6/exp_8_6.sce
new file mode 100644
index 000000000..35bdd0c56
--- /dev/null
+++ b/3793/CH8/EX8.6/exp_8_6.sce
@@ -0,0 +1,23 @@
+clear;
+clc;
+Rc=2500;
+il=1500;
+H=4;
+rg=2;
+f=50;
+D=il/f;
+Dpu=D/Rc;
+Kps=1/Dpu;
+Tps=(2*H)/(Dpu*f);
+Dl=Dpu*Rc;
+delP=-(Dl/Rc);
+mprintf("Constant step change in load is %.3f pu MW\n",delP);
+c=Dpu+1/rg;
+delf=-(delP/(Dpu+1/rg));
+mprintf("change in frequency and increase in frequency are %.4f pu MW/Hz and %.4f Hz\n",c,delf);
+delpl=1;
+delf1=-(delpl/(Dpu+1/rg));
+mprintf("Drop in frequency is %.4f Hz\n",delf1);
+delf2=-(Dl/Dpu);
+perf=-delP/f*100;
+mprintf("Change in percentage of frequency is %.2f",perf);
diff --git a/3793/CH8/EX8.7/exp_8_7.sce b/3793/CH8/EX8.7/exp_8_7.sce
new file mode 100644
index 000000000..858da3130
--- /dev/null
+++ b/3793/CH8/EX8.7/exp_8_7.sce
@@ -0,0 +1,34 @@
+clear;
+clc;
+S=3000;
+l=2000;
+f=50;
+//for case a
+D=l/f;
+Dpu=D/S;
+mprintf("load frequency parameter is %.3f MW/Hz\n",D);
+r=2;
+betaa=Dpu+1/r;
+mprintf("ARFC Parameter is %.4f pu MW/Hz\n",betaa);
+ld=25;
+ldemand=ld/S;
+fd=-(ldemand/betaa);
+mprintf("Static Frequency Drop is %.4f Hz\n",fd);
+//for case b
+s1=5000;
+beta1=betaa/S*s1;
+mprintf("ARFC Parameter on base of 5000MW is %.4f pu MW/Hz\n",beta1);
+sb=10000;
+delp1=ld/sb;
+delp2=0;
+beeta=betaa/S*sb;
+beeta1=beta1/s1*sb;
+sf=-(delp1/(beeta+beeta1));
+tp=-(beeta1*delp1*sb)/(beeta+beeta1);
+mprintf("Static frequency drop for command base of 10000MW is %.5f Hz\n",sf);
+mprintf("Tie line power in %.4f MW\n",tp);
+perf=sf/fd*100;
+mprintf("Static frequency drop in control area 1 in pool operation is %.3f percentage\n",perf);
+mprintf("Control area 2 supplies 50 percent of the load increase");
+
+
diff --git a/3793/CH8/EX8.8/exp_8_8.sce b/3793/CH8/EX8.8/exp_8_8.sce
new file mode 100644
index 000000000..002ca6974
--- /dev/null
+++ b/3793/CH8/EX8.8/exp_8_8.sce
@@ -0,0 +1,11 @@
+clear;
+clc;
+R=4;
+f=50;
+H=4;
+tc=.2;
+angle=50;
+T12=tc*cosd(angle);
+
+FF=(1/(2*%pi))*sqrt((2*%pi*f*T12/H)-((f/(4*R*H))^2));
+mprintf("Oscillating Frequency is %.2f Hz ",FF);
diff --git a/3793/CH9/EX9.1/exp_9_1.sce b/3793/CH9/EX9.1/exp_9_1.sce
new file mode 100644
index 000000000..78bfc7043
--- /dev/null
+++ b/3793/CH9/EX9.1/exp_9_1.sce
@@ -0,0 +1,33 @@
+clear;
+clc;
+S=100;
+p=50;
+pf=.95;
+v=11;
+Z=complex(0,(.15*.5)/(.15+.5));
+disp(Z);
+V=1;
+If=V/Z;
+
+mprintf("Subtransient fault currnt is %.4f pu\n",imag(If));
+Ig=If*(.15/(.15+.5));
+Im=If*(.5/(.15+.5));
+mprintf("Subtransient fault currnt in motor is %.4f pu\n",imag(Im));
+mprintf("Subtransient fault currnt in generator is %.4f pu\n",imag(Ig));
+Ibm=(S)/(sqrt(3)*v);
+
+function [A] = p2z(R,Theta)
+ if argn(2) <> 2 then
+ error("incorrect number of arguments.");
+ end
+ if ~and(size(R) == size(Theta)) then
+ error("arguments must be of the same dimension.");
+ end
+ A = R.*exp(%i*%pi*Theta/180.);
+endfunction
+Ipm=p2z((p)/(sqrt(3)*v*pf*Ibm),-(acosd(pf)));
+disp(Ipm);
+Igg=complex(0,-2)+Ipm;
+Imm=Im-Ipm;
+mprintf("Subtransient fault currnt in generator including pre fault is %f%f pu\n",real(Igg),imag(Igg));
+mprintf("Subtransient fault currnt in motor including pre fault is %f%f pu\n",real(Imm),imag(Imm));
diff --git a/3793/CH9/EX9.2/exp_9_2.sce b/3793/CH9/EX9.2/exp_9_2.sce
new file mode 100644
index 000000000..fd8852cb7
--- /dev/null
+++ b/3793/CH9/EX9.2/exp_9_2.sce
@@ -0,0 +1,76 @@
+clear;
+clc;
+function [Zbus]=zeebus(nelemnt,ind,node);
+ if ind==1;
+ Zbus=input('Partial matrix Zbus');
+ ind=0;
+ else
+ end
+ if ind==0;
+ for l=1:nelemnt;
+ p=input('bus number p');
+ q=input('bus number q');
+ zb=input('impedence');
+ typee=input('type of bus');
+ if typee==1;
+ for k=1:q;
+ if k==q;
+ Zbus(k,k)=zb;
+ else
+ Zbus(k,q)=0;
+ end
+ end
+ end
+ if typee==2;
+ for k=1:q;
+ if k==q;
+ Zbus(q,q)=zb+Zbus(p,p);
+ else
+ if k==p;
+ Zbus(p,q)=Zbus(p,p);
+ Zbus(q,p)=Zbus(p,q);
+ else
+ Zbus(k,q)=0;
+ Zbus(q,k)=0;
+ end
+ end
+ end
+ end
+ if typee==3;
+ y=1/(zb+Zbus(p,p)-2*Zbus(p,q)+Zbus(q,q));
+ for k=1:node;
+ X(k,1)=Zbus(k,p)-Zbus(k,q);
+ Xt(1,k)=(k:1);
+ end
+ Zbus=Zbus-(-y)*X*X';
+ end
+ if typee==4;
+ y=1/(zb+Zbus(q,q));
+ for k=1:node;
+ X(k,1)=-Zbus(k,q);
+ Xt(1,k)=(k:1);
+ end
+ Zbus=Zbus-(-y)*X*X';
+ end
+ end
+ else
+
+
+ end
+
+endfunction
+nelemnt=3;
+ind=0;
+node=2;
+[Zbus]=zeebus(nelemnt,ind,node);
+mprintf("Zbus = \n");
+disp(imag(Zbus));
+V=1.02;
+X21=complex(0,.31);
+If=V/Zbus(1,1);
+V1=(1-(Zbus(1,1)/Zbus(1,1)))*V;
+V2=(1-(Zbus(2,1)/Zbus(1,1)))*V;
+I21=(V2-V1)/X21;
+mprintf("Fault current is %.3f j pu\n",imag(If));
+mprintf("Transmission current is %.3f j pu\n",imag(I21));
+
diff --git a/3793/CH9/EX9.3/exp_9_3.sce b/3793/CH9/EX9.3/exp_9_3.sce
new file mode 100644
index 000000000..e1157047f
--- /dev/null
+++ b/3793/CH9/EX9.3/exp_9_3.sce
@@ -0,0 +1,46 @@
+clear;
+clc;
+function fault3faze (Zbus,nfbuses,loc,elemz,col,locs,Zf);
+ for n=1:nfbuses
+ p=input('number of bus to be faulted');
+ Vf=input('fault bus voltage');
+ If=Vf/(Zbus(p,p)+Zf);
+ mprintf("Bus no. Fault current\n");
+ mprintf("%2i\",p);
+ mprintf(" %15.4f\",real(If));
+ mprintf(" %15.4f\n",imag(If));
+ for k=1:3
+ V(k)=Vf-Zbus(k,p)*If;
+ mprintf("Bus no. Bus Voltage\n");
+ mprintf("%2i\",k);
+ mprintf(" %15.4f\",real(V(k)));
+ mprintf(" %15.4f\n",imag(V(k)));
+ end
+ kk=1;
+ for k=1:locs-1
+ add=loc(k+1)-loc(k);
+ for m=1:add
+ j=col(kk);
+ I(k,j)=(V(k)-V(j))/elemz(kk);
+ kk=kk+1;
+ mprintf("Bus no. Bus No. Current\n");
+ mprintf("%2i\",k);
+ mprintf("......%10i\",j);
+ mprintf(" %15.4f\",real(I(k,j)));
+ mprintf(" %15.4f\n",imag(I(k,j)));
+ end
+ end
+
+
+
+ end
+endfunction
+nfbuses=2;
+loc=[1 3 4];
+elemz=[.2 .3 .25]*%i;
+col=[2 3 3];
+locs=3;
+Zf=%i*.2;
+Zbus=[.0776 .0448 .0597;.0448 .1104 .0806;.0597 .0806 .2075]*%i;
+
+fault3faze (Zbus,nfbuses,loc,elemz,col,locs,Zf);