summaryrefslogtreecommitdiff
path: root/Working_Examples/83/CH12
diff options
context:
space:
mode:
Diffstat (limited to 'Working_Examples/83/CH12')
-rwxr-xr-xWorking_Examples/83/CH12/EX12.1/example_12_1.sce26
-rwxr-xr-xWorking_Examples/83/CH12/EX12.1/result_example_12_1.txt9
-rwxr-xr-xWorking_Examples/83/CH12/EX12.10/example_12_10.sce170
-rwxr-xr-xWorking_Examples/83/CH12/EX12.10/result_example_12_10.txt53
-rwxr-xr-xWorking_Examples/83/CH12/EX12.10/result_example_12_10_img.jpegbin0 -> 91217 bytes
-rwxr-xr-xWorking_Examples/83/CH12/EX12.11/example_12_11.sce173
-rwxr-xr-xWorking_Examples/83/CH12/EX12.11/result_example_12_11.txt38
-rwxr-xr-xWorking_Examples/83/CH12/EX12.11/result_example_12_11_img.jpegbin0 -> 116961 bytes
-rwxr-xr-xWorking_Examples/83/CH12/EX12.12/example_12_12.sce97
-rwxr-xr-xWorking_Examples/83/CH12/EX12.12/result_12_12.jpegbin0 -> 105998 bytes
-rwxr-xr-xWorking_Examples/83/CH12/EX12.2/example_12_2.sce45
-rwxr-xr-xWorking_Examples/83/CH12/EX12.2/result_example_12_2.txt7
-rwxr-xr-xWorking_Examples/83/CH12/EX12.3/example_12_3.sce62
-rwxr-xr-xWorking_Examples/83/CH12/EX12.3/result_example_12_3.txt20
-rwxr-xr-xWorking_Examples/83/CH12/EX12.3/result_example_12_3_img.jpegbin0 -> 56560 bytes
-rwxr-xr-xWorking_Examples/83/CH12/EX12.4/example_12_4.sce20
-rwxr-xr-xWorking_Examples/83/CH12/EX12.4/result_example_12_4.txt7
-rwxr-xr-xWorking_Examples/83/CH12/EX12.5/example_12_5.sce35
-rwxr-xr-xWorking_Examples/83/CH12/EX12.5/result_example_12_5.txt15
-rwxr-xr-xWorking_Examples/83/CH12/EX12.6/example_12_6.sce23
-rwxr-xr-xWorking_Examples/83/CH12/EX12.6/result_example_12_6.txt10
-rwxr-xr-xWorking_Examples/83/CH12/EX12.7/example_12_7.sce45
-rwxr-xr-xWorking_Examples/83/CH12/EX12.7/result_example_12_7.txt12
-rwxr-xr-xWorking_Examples/83/CH12/EX12.7/result_example_12_7_img.jpegbin0 -> 47889 bytes
-rwxr-xr-xWorking_Examples/83/CH12/EX12.8/example_12_8.sce50
-rwxr-xr-xWorking_Examples/83/CH12/EX12.8/result_example_12_8.jpegbin0 -> 68072 bytes
-rwxr-xr-xWorking_Examples/83/CH12/EX12.8/result_example_12_8.txt16
-rwxr-xr-xWorking_Examples/83/CH12/EX12.9/example_12_9.sce19
-rwxr-xr-xWorking_Examples/83/CH12/EX12.9/result_example_12_9.txt11
29 files changed, 963 insertions, 0 deletions
diff --git a/Working_Examples/83/CH12/EX12.1/example_12_1.sce b/Working_Examples/83/CH12/EX12.1/example_12_1.sce
new file mode 100755
index 0000000..dcc72ab
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.1/example_12_1.sce
@@ -0,0 +1,26 @@
+//Chapter 12
+//Example 12.1
+//page 439
+//To find stored kinetic energy,rotor acceleration,change in torque angle and rotor speed
+clear;clc;
+G=100; //base machine rating
+H=8.0; //inertia constant
+P=4; //no of poles
+//(a)To find stored energy in rotor at synchronous speed
+stored_energy=G*H;
+printf('\nStored energy = %d MJ',stored_energy);
+
+//(b)To find rotor acceleration when mechanical input is raised 80MW for an electrical load of 50MW
+Pa=30; //nett power
+f=50; //frequency
+M=stored_energy/(180*f);
+alpha=Pa/M; //rotor acceleration
+printf('\n\nRotor acceleration = %0.1f elect deg/s^2 ',alpha);
+
+//(c)To calculate change in torque angle and rotor speed when the above acceleration is maintained for 10 cycles
+change_angle=0.5*alpha*(10*20*10^(-3));
+printf('\n\nChange in torque angle = %0.2f elect degrees',change_angle);
+change_angle=60*alpha/(2*360);
+printf('\nChange in torque angle = %0.3f rpm/s',change_angle);
+speed=(120*f/P)+(change_angle*0.2);
+printf('\n\nRoor speed at the end of 10 cycles = %0.3f rpm',speed);
diff --git a/Working_Examples/83/CH12/EX12.1/result_example_12_1.txt b/Working_Examples/83/CH12/EX12.1/result_example_12_1.txt
new file mode 100755
index 0000000..b8ab028
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.1/result_example_12_1.txt
@@ -0,0 +1,9 @@
+
+Stored energy = 800 MJ
+
+Rotor acceleration = 337.5 elect deg/s^2
+
+Change in torque angle = 33.75 elect degrees
+Change in torque angle = 28.125 rpm/s
+
+Roor speed at the end of 10 cycles = 1505.625 rpm
diff --git a/Working_Examples/83/CH12/EX12.10/example_12_10.sce b/Working_Examples/83/CH12/EX12.10/example_12_10.sce
new file mode 100755
index 0000000..79310e8
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.10/example_12_10.sce
@@ -0,0 +1,170 @@
+//Chapter 12
+//Example 12.10
+//page 482
+//To plot swing curves for sustained fault and fault cleared at 2.5 and 6.25 cycles
+clear;clc;
+P_delivered=18;
+MVA_base=20;
+Xd=0.35;E=1.1;
+Xl=0.2;
+V=1;
+
+H=2.52;
+f=50;
+M=H/(180*f);
+
+/////////Prefault//////////////////////////
+X1=Xd+Xl/2;
+delta=0:0.1:180;
+Pe1=E*V*sind(delta)/X1;
+P_initial=P_delivered/MVA_base;Pm=P_initial;
+delta0=asind(P_initial/max(Pe1));
+
+
+//////during fault////////
+X2=1.25; //from delta to star conversion
+Pe2=E*V*sind(delta)/X2;
+
+//////postfault:with faulted line switched off/////////
+X3=Xd+Xl;
+Pe3=E*V*sind(delta)/X3;
+
+Pa_0minus=0;
+Pa_0plus=Pm-max(Pe2)*sind(delta0);
+Pa_avg=(Pa_0minus+Pa_0plus)/2;
+
+
+/////for a sustained fault///////////
+P_max=max(Pe2);
+delta_delta=0; //initially
+delta=21.64; //initially
+delta_old=21.64;
+delta_t=0.05;
+z1=21.64
+n=10;
+T=0;
+printf('Point-by-point calculation of swing curve for sustained fault delta_t=0.05sec\n');
+printf('_______________________________________________________________________________________________\n');
+printf('t\t\tPmax\t\t sin(delta)\t\tPa\t\t y\t\tdelta\n');
+printf('_______________________________________________________________________________________________\n');
+printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',0.000,P_max,sind(delta),(0.9-P_max*sind(delta))/2,8.929*(0.9-P_max*sind(delta))/2,delta);
+for i=1:n
+ t=i*delta_t;
+ if i==1 then
+ Pa=(0.9-P_max*sind(delta_old))/2;
+ else
+ Pa=0.9-P_max*sind(delta_old);
+ end
+
+ y=(delta_t^2)*Pa/M;
+ delta_delta=delta_delta+y;
+ delta=delta+delta_delta;
+ z1=[z1,delta];T=[T,t];
+ printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',t,P_max,sind(delta),0.9-P_max*sind(delta),8.929*(0.9-P_max*sind(delta)),delta);
+ delta_old=delta;
+end
+
+
+//////Fault cleared in 2.5 cycles(time to clear fault=0.05sec)/////
+
+P_max1=max(Pe2);
+P_max2=max(Pe3);
+delta_delta=0; //initially
+delta=21.64; //initially
+delta_old=21.64;
+delta_t=0.05;
+z2=21.64
+n=10;
+T=0;
+printf('\n\nComputations of swing curves for fault cleared at 2.5 cycles(0.05sec)\n');
+printf('______________________________________________________________________________________________\n');
+printf('t\t\tPmax\t\t sin(delta)\t\tPa\t\t y\t\tdelta\n');
+printf('______________________________________________________________________________________________\n');
+printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',0.000,P_max,sind(delta),(0.9-P_max*sind(delta))/2,8.929*(0.9-P_max*sind(delta))/2,delta);
+for i=1:n
+ t=i*delta_t;
+ if i==1 then
+ Pa=(0.9-P_max*sind(delta_old))/2;
+ P_max=P_max1;
+ elseif i==2 then
+ Pa=((0.9-P_max2*sind(delta_old))+((0.9-P_max1*sind(delta_old))))/2;
+ P_max=P_max2;
+ else
+ Pa=0.9-P_max2*sind(delta_old);
+ P_max=P_max2;
+ end
+
+ y=(delta_t^2)*Pa/M;
+ delta_delta=delta_delta+y;
+ delta=delta+delta_delta;
+ z2=[z2,delta];T=[T,t];
+
+ if i==1 then
+ delta_old=delta;
+ printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',t,P_max,sind(delta),((0.9-P_max2*sind(delta_old))+((0.9-P_max1*sind(delta_old))))/2,8.929*((0.9-P_max2*sind(delta_old))+((0.9-P_max1*sind(delta_old))))/2,delta);
+ else
+ printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',t,P_max,sind(delta),0.9-P_max*sind(delta),8.929*(0.9-P_max*sind(delta)),delta);
+ delta_old=delta;
+ end
+
+end
+
+
+
+//////Fault cleared in 6.25 cycles(time to clear fault=0.125sec)/////
+
+P_max1=max(Pe2);
+P_max2=max(Pe3);
+P_max=P_max1;
+delta_delta=0; //initially
+delta=21.64; //initially
+delta_old=21.64;
+delta_t=0.05;
+z3=21.64
+n=10;
+T=0;
+printf('\n\nComputations of swing curves for fault cleared at 6.25 cycles(0.125sec)\n');
+printf('______________________________________________________________________________________________\n');
+printf('t\t\tPmax\t\t sin(delta)\t\tPa\t\t y\t\tdelta\n');
+printf('______________________________________________________________________________________________\n');
+printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',0.000,P_max,sind(delta),(0.9-P_max*sind(delta))/2,8.929*(0.9-P_max*sind(delta))/2,delta);
+for i=1:n
+ t=i*delta_t;
+ if i==1 then
+ Pa=(0.9-P_max1*sind(delta_old))/2;
+ P_max=P_max1;
+ elseif i==2 then
+ Pa=(0.9-P_max1*sind(delta_old));
+ P_max=P_max1;
+ elseif i==3 then
+ Pa=(0.9-P_max1*sind(delta_old));
+ P_max=P_max2;
+ else
+ Pa=0.9-P_max2*sind(delta_old);
+ P_max=P_max2;
+ end
+
+ y=(delta_t^2)*Pa/M;
+ delta_delta=delta_delta+y;
+ delta=delta+delta_delta;
+ z3=[z3,delta];
+ T=[T,t];
+ printf('%0.3f sec\t%0.3f\t\t %0.3f\t\t\t%0.3f\t\t%0.3f\t\t%0.3f\n',t,P_max,sind(delta),0.9-P_max*sind(delta),8.929*(0.9-P_max*sind(delta)),delta);
+ delta_old=delta;
+
+end
+
+plot(T,z1,T,z2,T,z3);
+set(gca(),"grid",[1 1]);
+legend('Sustained Fault','Fault cleared at 2.5 cycles','Fault cleared at 6.25 cycles',[,2]);
+
+title('Swing Curves for Example 12.10 for a sustained fault and for clearing in 2.5 and 6.25 cycles','fontsize',2.4);
+xlabel('Time (in seconds)----->');
+ylabel('Torque Angle (delta,deg)----->');
+f=get("current_figure")
+f.figure_position=[0,15]
+f.figure_size=[645,1000]
+
+
+
+
diff --git a/Working_Examples/83/CH12/EX12.10/result_example_12_10.txt b/Working_Examples/83/CH12/EX12.10/result_example_12_10.txt
new file mode 100755
index 0000000..51afab7
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.10/result_example_12_10.txt
@@ -0,0 +1,53 @@
+
+
+Point-by-point calculation of swing curve for sustained fault delta_t=0.05sec
+_______________________________________________________________________________________________
+t Pmax sin(delta) Pa y delta
+_______________________________________________________________________________________________
+0.000 sec 0.880 0.369 0.288 2.569 21.640
+0.050 sec 0.880 0.410 0.539 4.814 24.209
+0.100 sec 0.880 0.524 0.439 3.920 31.592
+0.150 sec 0.880 0.681 0.301 2.688 42.894
+0.200 sec 0.880 0.838 0.163 1.455 56.885
+0.250 sec 0.880 0.953 0.062 0.549 72.330
+0.300 sec 0.880 1.000 0.020 0.182 88.324
+0.350 sec 0.880 0.968 0.048 0.429 104.500
+0.400 sec 0.880 0.856 0.147 1.308 121.105
+0.450 sec 0.880 0.656 0.323 2.883 139.019
+0.500 sec 0.880 0.345 0.596 5.325 159.815
+
+
+Computations of swing curves for fault cleared at 2.5 cycles(0.05sec)
+______________________________________________________________________________________________
+t Pmax sin(delta) Pa y delta
+______________________________________________________________________________________________
+0.000 sec 0.880 0.369 0.288 2.569 21.640
+0.050 sec 0.880 0.410 0.310 2.764 24.209
+0.100 sec 2.000 0.493 -0.086 -0.769 29.542
+0.150 sec 2.000 0.561 -0.221 -1.977 34.105
+0.200 sec 2.000 0.598 -0.295 -2.634 36.692
+0.250 sec 2.000 0.597 -0.294 -2.622 36.644
+0.300 sec 2.000 0.559 -0.218 -1.943 33.975
+0.350 sec 2.000 0.490 -0.081 -0.720 29.361
+0.400 sec 2.000 0.407 0.086 0.765 24.028
+0.450 sec 2.000 0.333 0.234 2.087 19.460
+0.500 sec 2.000 0.292 0.316 2.822 16.978
+
+
+Computations of swing curves for fault cleared at 6.25 cycles(0.125sec)
+______________________________________________________________________________________________
+t Pmax sin(delta) Pa y delta
+______________________________________________________________________________________________
+0.000 sec 0.880 0.369 0.288 2.569 21.640
+0.050 sec 0.880 0.410 0.539 4.814 24.209
+0.100 sec 0.880 0.524 0.439 3.920 31.592
+0.150 sec 2.000 0.681 -0.461 -4.119 42.894
+0.200 sec 2.000 0.767 -0.634 -5.660 50.078
+0.250 sec 2.000 0.784 -0.667 -5.960 51.603
+0.300 sec 2.000 0.733 -0.567 -5.060 47.168
+0.350 sec 2.000 0.611 -0.322 -2.878 37.673
+0.400 sec 2.000 0.427 0.045 0.404 25.301
+0.450 sec 2.000 0.231 0.439 3.918 13.332
+0.500 sec 2.000 0.092 0.716 6.392 5.282
+WARNING : The size of the figure may not be as wide as you want.
+
diff --git a/Working_Examples/83/CH12/EX12.10/result_example_12_10_img.jpeg b/Working_Examples/83/CH12/EX12.10/result_example_12_10_img.jpeg
new file mode 100755
index 0000000..f6279f5
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.10/result_example_12_10_img.jpeg
Binary files differ
diff --git a/Working_Examples/83/CH12/EX12.11/example_12_11.sce b/Working_Examples/83/CH12/EX12.11/example_12_11.sce
new file mode 100755
index 0000000..33c64db
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.11/example_12_11.sce
@@ -0,0 +1,173 @@
+//Chapter 12
+//Example 12.11
+//page 488
+//To plot swing curves for fault cleared at 0.275s and 0.08s of a multimachine system
+clear;clc;
+
+xd1=%i*0.067;xd2=%i*0.1;
+
+//primitive admittances of the lines
+y45=1/(0.018+%i*0.11); B45=%i*0.113;
+y51=1/(0.004+%i*0.0235); B51=%i*0.098;
+y41=1/(0.007+%i*0.04); B41=%i*0.041;
+z24=(%i*0.022);
+z35=(%i*0.04);
+
+//Bus data and prefault load-flow values in PU
+V1=1.0; P1=-3.8083; Q1=-0.2799; Pl1=0; Ql2=0;
+V2=1.0194+%i*0.1475; P2=3.25; Q2=0.6986; Pl2=0; Ql2=0;
+V3=1.0121+%i*0.1271; P3=2.10; Q3=0.3110; Pl3=0; Ql3=0;
+V4=1.0146+%i*0.0767; P4=0; Q4=1.0; Pl4=1.0; Ql4=0.44;
+V5=1.0102+%i*0.0439; P5=0; Q5=0; Pl5=0.5; Ql5=0.16;
+
+
+// To find voltage behind transient reactances before the occurance of fault
+
+I2=(P2-%i*Q2)/(V2');
+E2=V2+I2*xd1;
+E1=V1;
+I3=(P3-%i*Q3)/(V3');
+E3=V3+I3*xd2;
+
+//converting loads into their admittances
+Yl4=(Pl4-%i*Ql4)/(V4*V4');
+Yl5=(Pl5-%i*Ql5)/(V5*V5');
+
+//forming augmented Bus admittance matrix before the occurance of fault
+Y11=y41+y51;Y12=0;Y13=0;Y14=-y41;Y15=-y51;
+Y21=Y12;Y22=1/(xd1+z24);Y23=0;Y24=-(1/(z24+xd1));Y25=0;
+Y31=0;Y32=0;Y33=1/(z35+xd2);Y34=0;Y35=-1/(z35+xd2);
+Y41=Y14;Y42=Y24;Y43=Y34;Y44=y41+Yl4+y45+B45+B41-Y24;Y45=-y45;
+Y51=Y15;Y52=Y25;Y53=Y35;Y54=Y45;Y55=Yl5+y45+y51+B45+B51-Y35;
+
+Ybus=[Y11 Y12 Y13 Y14 Y15;
+ Y21 Y22 Y23 Y24 Y25;
+ Y31 Y32 Y33 Y34 Y35;
+ Y41 Y42 Y43 Y44 Y45;
+ Y51 Y52 Y53 Y54 Y55];
+
+printf('\n Augmented prefault bus admittance matrix (in PU) is given by\n\n Ybus=\n');
+disp(Ybus);
+///////to find the Ybus during fault
+Ybus_1=Ybus([1:3,5],[1:3,5]);
+n=4
+for k=1:n-1
+ for j=1:n-1
+ Ybus_during_fault(k,j)=Ybus_1(k,j)-(Ybus_1(k,n)*Ybus_1(n,j))/Ybus_1(n,n);
+ end
+end
+printf('\n\n\n Bus admittance matrix during fault (in PU) is given by\n\n Ybus_during_fault=\n');
+disp(Ybus_during_fault);
+
+//to find Ybus after the fault has been cleared
+Y45=0;Y54=0;Y44=Y44-y45-B45;Y55=Y55-y45-B45;
+Ybus_2=[Y11 Y12 Y13 Y14 Y15;
+ Y21 Y22 Y23 Y24 Y25;
+ Y31 Y32 Y33 Y34 Y35;
+ Y41 Y42 Y43 Y44 Y45;
+ Y51 Y52 Y53 Y54 Y55];
+
+//eliminating node 5 from Ybus_2
+n=5
+for k=1:n-1
+ for j=1:n-1
+ Ybus_3(k,j)=Ybus_2(k,j)-(Ybus_2(k,n)*Ybus_2(n,j))/Ybus_2(n,n);
+ end
+end
+
+//eliminating node 4 to get post fault Ybus
+n=4
+for k=1:n-1
+ for j=1:n-1
+ Ybus_post_fault(k,j)=Ybus_3(k,j)-(Ybus_3(k,n)*Ybus_3(n,j))/Ybus_3(n,n);
+ end
+end
+printf('\n\n\n Bus admittance matrix postfault (in PU) is given by\n\n Ybus_post_fault=\n');
+disp(Ybus_post_fault);
+printf('\n\n\n');
+//During fault power angle equation
+delta3=0:0.1:180;
+Pe2f=0;
+Pe3f=(abs(E3'))^2*real(Ybus_during_fault(3,3))+abs(E1')*abs(E3')*abs(Ybus_during_fault(3,1))*cosd(delta3-atand(imag(Ybus_during_fault(1,3))/real(Ybus_during_fault(1,3))));
+
+//Postfault power angle equations
+delta2=0:0.1:180;
+Pe2pf=(abs(E2'))^2*real(Ybus_post_fault(2,2))+abs(E1')*abs(E2')*abs(Ybus_post_fault(2,1))*cosd(delta2-atand(imag(Ybus_post_fault(1,2))/real(Ybus_post_fault(1,2))));
+Pe3pf=(abs(E3'))^2*real(Ybus_post_fault(3,3))+abs(E1')*abs(E3')*abs(Ybus_post_fault(3,1))*cosd(delta3-atand(imag(Ybus_post_fault(1,3))/real(Ybus_post_fault(1,3))));
+
+//mechanical inputs which are assumed to be constant are given by
+Pm2=max(real(E2*I2'));
+Pm3=max(real(E3*I3'));
+
+//xdot function defining the swing equations of each of the machines
+function xdot=mac2(t,x,tc)
+ xdot(1)=x(2);
+ if t>tc then
+ xdot(2)=180*50*(Pm2-(0.6012+8.365*sind(x(1)-1.662)))/12;//swing equation after clearing the fault
+ else
+ xdot(2)=180*50*(Pm2-(0))/12; //swing equation before clearing the fault
+ end
+
+endfunction
+
+function xdot=mac3(t,x,tc)
+ xdot(1)=x(2);
+ if t>tc then
+ xdot(2)=180*50*(Pm3-(0.1823+6.5282*sind(x(1)-0.8466)))/9;//swing equation after clearing the fault
+ else
+ xdot(2)=180*50*(Pm3-(0.1561+5.531*sind(x(1)-0.755)))/9; //swing equation before clearing the fault
+ end
+
+endfunction
+
+//to find the solution of swing equation to draw the swing curves
+
+//to draw the swing curves for machines 2 and 3 for example12.11 for clearing at 0.275 sec
+subplot(2,1,1)
+x_1_0=[19.354398,0]';t0=0; T=0:0.01:1;T=T';
+x_2_0=[18.2459,0]';tc=0.275;
+sol1=ode(x_1_0,t0,T,mac2);
+sol2=ode(x_2_0,t0,T,mac3);
+
+plot(T(1:20),sol1(1,1:20)',T,sol2(1,:)');
+set(gca(),"grid",[1 1]);
+legend('Machine 2','Machine 3',[,1]);
+title('Swing Curves for machines 2 and 3 of Example 12.11 for a clearing at '+string(tc)+' s');
+xstring(0.55,59,'Machine 1 is reference (infinte bus)');
+xlabel('Time (in seconds)----->');
+ylabel('Torque Angle (delta,deg)----->');
+
+
+//to draw the swing curves for machines 2 and 3 for example12.11 for clearing at 0.08 sec
+subplot(2,1,2)
+x_1_0=[19.354398,0]';t0=0; T=0:0.01:1;T=T';
+x_2_0=[18.2459,0]';tc=0.08;
+sol1=ode(x_1_0,t0,T,mac2);
+sol2=ode(x_2_0,t0,T,mac3);
+
+plot(T,sol1(1,:)',T,sol2(1,:)');
+set(gca(),"grid",[1 1]);
+legend('Machine 2','Machine 3',[,4]);
+title('Swing Curves for machines 2 and 3 of Example 12.11 for a clearing at '+string(tc)+' s');
+xstring(0.44,43,'Machine 1 is reference (infinte bus)');
+xlabel('Time (in seconds)----->');
+ylabel('Torque Angle (delta,deg)----->');
+
+f=get("current_figure");
+f.figure_position=[0,15];
+f.figure_size=[565,1000];
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Working_Examples/83/CH12/EX12.11/result_example_12_11.txt b/Working_Examples/83/CH12/EX12.11/result_example_12_11.txt
new file mode 100755
index 0000000..7e66326
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.11/result_example_12_11.txt
@@ -0,0 +1,38 @@
+
+
+
+ Augmented prefault bus admittance matrix (in PU) is given by
+
+ Ybus=
+
+ 11.284152 - 65.612163i 0 0 - 4.244997 + 24.257126i - 7.0391553 + 41.355037i
+ 0 - 11.235955i 0 11.235955i 0
+ 0 0 - 7.1428571i 0 7.1428571i
+ - 4.244997 + 24.257126i 11.235955i 0 6.659713 - 44.617911i - 1.4488088 + 8.8538313i
+ - 7.0391553 + 41.355037i 0 7.1428571i - 1.4488088 + 8.8538313i 8.9769945 - 57.297216i
+
+
+
+ Bus admittance matrix during fault (in PU) is given by
+
+ Ybus_during_fault=
+
+ 5.7986033 - 35.768947i 0 - 0.0681253 + 5.1661269i
+ 0 - 11.235955i 0
+ - 0.0681253 + 5.1661269i 0 0.1361683 - 6.2737394i
+
+
+
+ Bus admittance matrix postfault (in PU) is given by
+
+ Ybus_post_fault=
+
+ 1.3931179 - 14.011919i - 0.2213865 + 7.628982i - 0.0901365 + 6.0974822i
+ - 0.2213865 + 7.628982i 0.5005328 - 7.7897867i 0
+ - 0.0901365 + 6.0974822i 0 0.1590837 - 6.1167759i
+
+
+
+WARNING : The size of the figure may not be as wide as you want.
+
+
diff --git a/Working_Examples/83/CH12/EX12.11/result_example_12_11_img.jpeg b/Working_Examples/83/CH12/EX12.11/result_example_12_11_img.jpeg
new file mode 100755
index 0000000..5660f18
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.11/result_example_12_11_img.jpeg
Binary files differ
diff --git a/Working_Examples/83/CH12/EX12.12/example_12_12.sce b/Working_Examples/83/CH12/EX12.12/example_12_12.sce
new file mode 100755
index 0000000..647cf0a
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.12/example_12_12.sce
@@ -0,0 +1,97 @@
+//Chapter 12
+//Example 12.12
+//page 500
+//To plot swing curves for single pole and three pole switching
+clear;clc;
+
+Xg0=0.1;Xg1=0.3;Xg2=0.15;E=1.2;H=4.167;
+Xt=0.1;
+Xl0=1.0;Xl1=0.3;Xl2=0.3;V=1;
+
+//transfer reactance during LG fault(fault not cleared) by star delta transformation is given by
+X12_fault=1.45;
+
+//transfer reactance after LG faulted line open is given by
+X12_fault_open=1.22;
+
+//transfer reactance when all the lines are healthy is given by
+X12_healthy=0.8;
+
+//power angle equations
+delta=0:0.1:180;
+
+//Prefault condition
+Pe1=(E*V)*sind(delta)/X12_healthy;
+//for an initial load of 1PU
+delta0=asind(1/1.5);
+
+//during fault
+Pe2=(E*V)*sind(delta)/X12_fault;
+
+//during single pole switching
+Pe3=(E*V)*sind(delta)/X12_fault_open;
+
+//during three pole switching
+Pe4=0;
+
+//after reclosure
+Pe5=Pe1;
+
+Pm=1.0;
+
+//xdot function defining the swing equations of machine during single poling
+function xdot=mac_1_pole(t,x,tc,tr)
+ xdot(1)=x(2);
+ if (t<=tc) then
+ xdot(2)=180*50*(Pm-(0.827*sind(x(1))))/12; //swing equation before clearing the faulted line
+ elseif (t>tc)&(t<tr) then
+ xdot(2)=180*50*(Pm-(0.985*sind(x(1))))/12;//swing equation during single pole switching
+ elseif (t>=tr) then
+ xdot(2)=180*50*(Pm-(1.5*sind(x(1))))/12; //after reclosure
+ end
+endfunction
+
+//xdot function defining the swing equations of machine during three poling
+function xdot=mac_3_pole(t,x,tc,tr)
+ xdot(1)=x(2);
+ if (t>tc)&(t<tr) then
+ xdot(2)=180*50*(Pm-0)/4.167;//swing equation during three pole switching
+ elseif (t<=tc) then
+ xdot(2)=180*50*(Pm-(0.827*sind(x(1))))/4.167; //swing equation before clearing the faulted line
+ elseif (t>=tr) then
+ xdot(2)=180*50*(Pm-(1.5*sind(x(1))))/4.167; //after reclosure
+ end
+endfunction
+
+//to find the solution of swing equation to draw the swing curves
+
+//to draw the swing curves for three pole switching with reclosure
+subplot(2,1,1)
+x_1_0=[41.8,0]';t0=0; T=0:0.001:0.65;T=T';
+tc=0.075;tr=0.325;
+sol1=ode(x_1_0,t0,T,mac_3_pole);
+plot(T,sol1(1,:)');
+set(gca(),"grid",[1 1]);
+title('Swing Curve for three pole switching at '+string(tc)+' s'+' and reclosure at '+string(tr)+' s','fontsize',3);
+xset("font size",3)
+xstring(0.2,300,'MACHINE UNSTABLE');
+xlabel('Time (in seconds)----->');
+ylabel('Torque Angle (delta,deg)----->');
+
+//to draw the swing curves for single pole switching with reclosure
+subplot(2,1,2)
+x_1_0=[41.8,0]';t0=0; T=0:0.001:2.2;T=T';
+tc=0.075;tr=0.325;
+sol2=ode(x_1_0,t0,T,mac_1_pole);
+plot(T,sol2(1,:)');
+set(gca(),"grid",[1 1]);
+title('Swing Curve for single pole switching at '+string(tc)+' s'+' and reclosure at '+string(tr)+' s','fontsize',3);
+xset("font size",3)
+xstring(1.2,50,'MACHINE STABLE');
+xlabel('Time (in seconds)----->');
+ylabel('Torque Angle (delta,deg)----->');
+
+f=get("current_figure");
+f.figure_position=[0,15];
+f.figure_size=[560,1000];
+
diff --git a/Working_Examples/83/CH12/EX12.12/result_12_12.jpeg b/Working_Examples/83/CH12/EX12.12/result_12_12.jpeg
new file mode 100755
index 0000000..8614513
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.12/result_12_12.jpeg
Binary files differ
diff --git a/Working_Examples/83/CH12/EX12.2/example_12_2.sce b/Working_Examples/83/CH12/EX12.2/example_12_2.sce
new file mode 100755
index 0000000..198bc31
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.2/example_12_2.sce
@@ -0,0 +1,45 @@
+//Chapter 12
+//Example 12.1
+//page 448
+//To calculate steady state power limit
+clear;clc;
+
+Xdg=1*%i; //generator's
+Xdm=1*%i; //motor's
+Xt=0.1*%i; //transformers
+Xl=0.25*%i; //transmission line's
+Xc=-1*%i; //static capacitor's
+Xi=1*%i; //inductive reactor
+Eg=1.2; //generator's internal voltage
+Em=1; //motor's internal voltage
+
+//case(i) steady state power limit without reactor
+P1=(abs(Eg)*abs(Em))/(abs(Xdg+Xt+Xl+Xt+Xdm));
+printf('\n\n Steady state power limit without reactor = %0.5f pu',P1);
+
+//case(ii) steady state power limit with capacitive reactor
+//three arms of star connected reactances are
+Xa=Xdg+Xt+Xl; //from generator side
+Xb=Xdm+Xt; //from load side
+Xc=Xc; //from reactor side
+
+//converting star to delta
+//reactance between generator side to load side is
+Xab=(Xa*Xb+Xb*Xc+Xc*Xa)/Xc;
+//power limit is
+P2=(abs(Eg)*abs(Em))/(abs(Xab));
+printf('\n\n Steady state power limit with capacitive reactor = %0.5f pu',P2);
+
+//case(iii) steady state power limit with inductive reactor
+//three arms of star connected reactances are
+Xa=Xdg+Xt+Xl; //from generator side
+Xb=Xdm+Xt; //from load side
+Xc=Xi; //from reactor side
+
+//converting star to delta
+//reactance between generator side to load side is
+Xab=(Xa*Xb+Xb*Xc+Xc*Xa)/Xc;
+//power limit is
+P3=(abs(Eg)*abs(Em))/(abs(Xab));
+printf('\n\n Steady state power limit with inductive reactor = %0.5f pu',P3);
+
diff --git a/Working_Examples/83/CH12/EX12.2/result_example_12_2.txt b/Working_Examples/83/CH12/EX12.2/result_example_12_2.txt
new file mode 100755
index 0000000..20581cd
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.2/result_example_12_2.txt
@@ -0,0 +1,7 @@
+
+
+ Steady state power limit without reactor = 0.48980 pu
+
+ Steady state power limit with capacitive reactor = 1.24352 pu
+
+ Steady state power limit with inductive reactor = 0.30496 pu
diff --git a/Working_Examples/83/CH12/EX12.3/example_12_3.sce b/Working_Examples/83/CH12/EX12.3/example_12_3.sce
new file mode 100755
index 0000000..e01d48d
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.3/example_12_3.sce
@@ -0,0 +1,62 @@
+//Chapter 12
+//Example 12.3
+//page 450
+//To calculate maximum power transferred
+clear;clc;
+
+Vt=1.0; //generator terminal voltage
+V=1.0 ; //infinite bus voltage
+Pe=1.0 ; //power delivered
+Xd=0.25*%i ; //generator's transient reactance
+Xl=0.5*%i ; //transmission line's reactance
+Xt=0.1*%i; //transformer's reactance
+
+//to calculate alpha
+alpha=asind(Pe*abs(Xt+Xl/2)/(abs(Vt)*abs(V)));
+printf('\n\nAlpha=%0.1f deg',alpha);
+
+//current to infinite bus
+I=(Vt*(cosd(alpha)+%i*sind(alpha))-V)/(Xt+Xl/2);
+printf('\nCurrent to infinte bus=%d+j%0.3f pu',real(I),imag(I));
+
+//votage behind transient reactance
+E=Vt+I*(Xd+Xt+Xl/2);
+printf('\nVoltage behind transient reactance= E''= %0.3f+j%0.1f pu = %0.3f @%0.1f deg pu\n\n',real(E),imag(E),abs(E),atand(imag(E)/real(E)));
+
+delta=0:0.001:180;
+
+//case(a) Maximum power when system is healthy
+X12=Xd+Xt+Xl/2;
+Pmax=abs(V)*abs(E)/abs(X12);
+Pe1=Pmax*sind(delta);
+printf('Maximum power that can be transferred under the following condition is')
+printf('\n\n(a)System Healthy:');
+printf('\nPmax=%0.2f pu',Pmax);
+printf('\nPe=%0.2f sin(delta) pu',Pmax);
+
+//case(b) One line short in the middle
+//converting bus3 to delta40
+Xa=Xd+Xt; //generator side
+Xb=Xl; //healthy transmission line side
+Xc=Xl/2; //unhealthy line side
+X12=(Xa*Xb+Xb*Xc+Xc*Xa)/(Xc);
+Pmax=abs(V)*abs(E)/abs(X12);
+Pe2=Pmax*sind(delta);
+printf('\n\n(b)One line shorted in the middle:');
+printf('\nPmax=%0.4f pu',Pmax);
+printf('\nPe=%0.4f sin(delta) pu',Pmax);
+
+//case(c) One line open
+X12=Xd+Xt+Xl;
+Pmax=abs(V)*abs(E)/abs(X12);
+Pe3=Pmax*sind(delta);
+printf('\n\n(c)One line open :');
+printf('\nPmax=%0.4f pu',Pmax);
+printf('\nPe=%0.4f sin(delta) pu',Pmax);
+
+//plotting Power angle curves
+plot(delta,Pe1,delta,Pe2,delta,Pe3);
+legend(['1.79sin(delta)';'0.694sin(delta)';'1.265sin(delta)']);
+title("Power angle curves");
+xlabel("Delta");
+ylabel("Pe"); \ No newline at end of file
diff --git a/Working_Examples/83/CH12/EX12.3/result_example_12_3.txt b/Working_Examples/83/CH12/EX12.3/result_example_12_3.txt
new file mode 100755
index 0000000..7ba9b55
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.3/result_example_12_3.txt
@@ -0,0 +1,20 @@
+
+
+Alpha=20.5 deg
+Current to infinte bus=1+j0.181 pu
+Voltage behind transient reactance= E'= 0.892+j0.6 pu = 1.075 @33.9 deg pu
+
+Maximum power that can be transferred under the following condition is
+
+(a)System Healthy:
+Pmax=1.79 pu
+Pe=1.79 sin(delta) pu
+
+(b)One line shorted in the middle:
+Pmax=0.6933 pu
+Pe=0.6933 sin(delta) pu
+
+(c)One line open :
+Pmax=1.2643 pu
+Pe=1.2643 sin(delta) pu
+
diff --git a/Working_Examples/83/CH12/EX12.3/result_example_12_3_img.jpeg b/Working_Examples/83/CH12/EX12.3/result_example_12_3_img.jpeg
new file mode 100755
index 0000000..22682b4
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.3/result_example_12_3_img.jpeg
Binary files differ
diff --git a/Working_Examples/83/CH12/EX12.4/example_12_4.sce b/Working_Examples/83/CH12/EX12.4/example_12_4.sce
new file mode 100755
index 0000000..bcd57a0
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.4/example_12_4.sce
@@ -0,0 +1,20 @@
+//Chapter 12
+//Example 12.4
+//page 453
+//To calculate acceleration and rotor angle
+clear;clc;
+
+delta0=33.9; //initial rotor angle
+H=4; //inertia constant
+f=50; //frequency
+Pm=1; //mechanical power input
+t=0.05; //time interval
+angular_acceleration=(Pm-0.694*sind(delta0))*180*f/H;
+delta_change=0.5*angular_acceleration*t^2;
+delta_new=delta0+delta_change;
+new_angular_acceleration=(Pm-0.694*sind(delta_new))*180*f/H;
+
+printf('\n\nInitial rotor angular acceleration = %d elect deg/s^2',angular_acceleration);
+printf('\nDelta_change=%0.1f deg',delta_change);
+printf('\nNew delta =delta1=%0.1f deg',delta_new);
+printf('\nAngular acceleration at the end of 0.05s =%d elect deg/s^2\n\n',new_angular_acceleration);
diff --git a/Working_Examples/83/CH12/EX12.4/result_example_12_4.txt b/Working_Examples/83/CH12/EX12.4/result_example_12_4.txt
new file mode 100755
index 0000000..e05c3a4
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.4/result_example_12_4.txt
@@ -0,0 +1,7 @@
+
+
+Initial rotor angular acceleration = 1379 elect deg/s^2
+Delta_change=1.7 deg
+New delta =delta1=35.6 deg
+Angular acceleration at the end of 0.05s =1340 elect deg/s^2
+
diff --git a/Working_Examples/83/CH12/EX12.5/example_12_5.sce b/Working_Examples/83/CH12/EX12.5/example_12_5.sce
new file mode 100755
index 0000000..ed53369
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.5/example_12_5.sce
@@ -0,0 +1,35 @@
+//Chapter 12
+//Example 12.5
+//page 456
+//To calculate frequency of natural oscilations
+clear;clc;
+
+E=1.2; //no load voltage
+V=1; //infinite bus voltage
+Xg=1.2; // synchronous generator reactance
+Xtl=0.6 //transformer anf transmission line reactance
+H=4; //inertia constant
+
+//case(i) 50% loading
+delta0=asind(0.5);
+synchronizing_coefficien=(abs(E)*abs(V)*cosd(delta0))/(Xg+Xtl);
+M=H/(%pi*50);
+p=%i*sqrt(synchronizing_coefficien/M);
+f=abs(p)/(2*%pi);
+printf('\n\ncase(i) For 50%% loading');
+printf('\nDelta_0=%d deg',delta0);
+printf('\nsynchronizing_coefficient=%0.3f MW(pu)/elect rad',synchronizing_coefficien);
+printf('\nM=%0.4f s^2/elect rad',M);
+printf('\nFrequency of oscillations=%0.2f rad/sec = %0.3f Hz\n',abs(p),f);
+
+//case(i) 80% loading
+delta0=asind(0.8);
+synchronizing_coefficien=(abs(E)*abs(V)*cosd(delta0))/(Xg+Xtl);
+M=H/(%pi*50);
+p=%i*sqrt(synchronizing_coefficien/M);
+f=abs(p)/(2*%pi);
+printf('\n\ncase(ii) For 80%% loading');
+printf('\nDelta_0=%d deg',delta0);
+printf('\nSynchronizing_coefficient=%0.3f MW(pu)/elect rad',synchronizing_coefficien);
+printf('\nM=%0.4f s^2/elect rad',M);
+printf('\nFrequency of oscillations=%0.2f rad/sec = %0.3f Hz\n',abs(p),f); \ No newline at end of file
diff --git a/Working_Examples/83/CH12/EX12.5/result_example_12_5.txt b/Working_Examples/83/CH12/EX12.5/result_example_12_5.txt
new file mode 100755
index 0000000..d48c344
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.5/result_example_12_5.txt
@@ -0,0 +1,15 @@
+
+
+
+case(i) For 50% loading
+Delta_0=30 deg
+synchronizing_coefficient=0.577 MW(pu)/elect rad
+M=0.0255 s^2/elect rad
+Frequency of oscillations=4.76 rad/sec = 0.758 Hz
+
+
+case(ii) For 80% loading
+Delta_0=53 deg
+Synchronizing_coefficient=0.400 MW(pu)/elect rad
+M=0.0255 s^2/elect rad
+Frequency of oscillations=3.96 rad/sec = 0.631 Hz
diff --git a/Working_Examples/83/CH12/EX12.6/example_12_6.sce b/Working_Examples/83/CH12/EX12.6/example_12_6.sce
new file mode 100755
index 0000000..1507d88
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.6/example_12_6.sce
@@ -0,0 +1,23 @@
+//Chapter 12
+//Example 12.6
+//page 457
+//To find steady state power limit
+clear;clc;
+
+V=1.0; //infinite bus volatge
+Vt=1.2; //terminal volatge
+Xd=0.5*%i; //synchronous generator reactance
+X=%i; //series reactance
+//by solving the expressions given in the textbook
+theta=acosd(0.5/1.8);
+printf('\n\ntheta=%0.3f deg',theta);
+Vt=Vt*(cosd(theta)+%i*sind(theta));
+printf('\nVt=%0.3f+j%0.3f pu',real(Vt),imag(Vt));
+I=(Vt-V)/X;
+printf('\nI=%0.3f+j%0.3f pu',real(I),imag(I));
+E=Vt+Xd*I;
+printf('\nE=%0.3f @ %d deg pu',abs(E),atand(imag(E)/real(E)));
+Pmax=(abs(E)*abs(V))/abs(X+Xd);
+printf('\n\nSteady state power limit is given by:\tPmax=%0.3f pu',Pmax);
+E=1.2;Pmax=(abs(E)*abs(V))/abs(X+Xd);
+printf('\n\nIf the generator emf is held fixed at a value 1.2pu,steady state power limit would be :\t Pmax=%0.2f pu\n\n',Pmax); \ No newline at end of file
diff --git a/Working_Examples/83/CH12/EX12.6/result_example_12_6.txt b/Working_Examples/83/CH12/EX12.6/result_example_12_6.txt
new file mode 100755
index 0000000..b7933b1
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.6/result_example_12_6.txt
@@ -0,0 +1,10 @@
+
+theta=73.872 deg
+Vt=0.333+j1.153 pu
+I=1.153+j0.667 pu
+E=1.729 @ -90 deg pu
+
+Steady state power limit is given by: Pmax=1.153 pu
+
+If the generator emf is held fixed at a value 1.2pu,steady state power limit would be : Pmax=0.80 pu
+
diff --git a/Working_Examples/83/CH12/EX12.7/example_12_7.sce b/Working_Examples/83/CH12/EX12.7/example_12_7.sce
new file mode 100755
index 0000000..5e2663f
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.7/example_12_7.sce
@@ -0,0 +1,45 @@
+//Chapter 12
+//Example 12.7
+//page 475
+//To calculate critcal clearing angle
+clear;clc;
+
+Xd=0.25; //direct axis transient reactance of the generator
+Xl1=0.5; Xl2=0.4; //reactances of transmission line
+E=1.2; //voltage behind transient reactance
+Xinf=0.05; //reactnce before infinite bus
+V=1; //infinite bus voltage
+Pm=1; //mechanical input to the generator
+delta=0:1:180;
+
+//Normal operation (prefault)
+X1=Xd+(Xl1*Xl2/(Xl1+Xl2))+Xinf; //equivalent reactance between sending ened and receiving end
+//Power angle equation before the fault is
+Pe1=(E*V/X1)*sind(delta);
+//prefault operating power =1.0pu
+delta0=asin(1/max(Pe1));
+printf('Normal Operation (prefault):\n');
+printf('X1=%0.3f PU\n',X1);
+printf('Pe1=%0.1fsin(delta)\n\n',max(Pe1));
+
+//during fault there will be no power transfer
+Pe2=0;
+printf('During Fault:\n');
+printf('Pe2=%d\n\n',Pe2);
+
+//Post fault operation(fault cleared by opening the faulted line)
+X3=Xd+Xl1+Xinf;
+Pe3=(E*V/X3)*sind(delta);
+delta_max=%pi-asin(Pm/max(Pe3));
+//from A1 and A2, we solve A1=A2
+deff('[y]=fx(delta_cr)',"y=1.5*cos(delta_cr)+delta_cr-1.293-Pm*(delta_cr-delta0)");
+delta_cr=fsolve(0.45,fx);
+printf('Post fault operation(fault cleared by opening the faulted line):\n');
+printf('X3=%0.1fPU\n',X3);
+printf('Pe3=%0.1fsin(delta)\n',max(Pe3));
+printf('Delta_cr=%0.4f rad =%0.2f deg',delta_cr,delta_cr*180/%pi);
+plot(delta,Pe1,delta,Pe3,delta,Pm*ones(1,length(delta)));
+legend('Pe1=2.3sin(delta)','Pe3=1.5sin(delta)','Pm=1');
+title('Power angle Diagram for example 12.7');
+xlabel('delta (in degrees)-----&gt;');
+ylabel('Electrical output (Pe)-----&gt;'); \ No newline at end of file
diff --git a/Working_Examples/83/CH12/EX12.7/result_example_12_7.txt b/Working_Examples/83/CH12/EX12.7/result_example_12_7.txt
new file mode 100755
index 0000000..63fb998
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.7/result_example_12_7.txt
@@ -0,0 +1,12 @@
+
+Normal Operation (prefault):
+X1=0.522 PU
+Pe1=2.3sin(delta)
+
+During Fault:
+Pe2=0
+
+Post fault operation(fault cleared by opening the faulted line):
+X3=0.8PU
+Pe3=1.5sin(delta)
+Delta_cr=0.9742 rad =55.82 deg
diff --git a/Working_Examples/83/CH12/EX12.7/result_example_12_7_img.jpeg b/Working_Examples/83/CH12/EX12.7/result_example_12_7_img.jpeg
new file mode 100755
index 0000000..42d4b8e
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.7/result_example_12_7_img.jpeg
Binary files differ
diff --git a/Working_Examples/83/CH12/EX12.8/example_12_8.sce b/Working_Examples/83/CH12/EX12.8/example_12_8.sce
new file mode 100755
index 0000000..68b4863
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.8/example_12_8.sce
@@ -0,0 +1,50 @@
+//Chapter 12
+//Example 12.8
+//page 477
+//To calculate critcal clearing angle
+clear;clc;
+
+Xd=0.25; //direct axis transient reactance of the generator
+Xl1=0.28; Xl2_1=0.14;Xl2_2=0.14; //reactances of transmission line
+E=1.2; //voltage behind transient reactance
+Xinf=0.17; //reactnce before infinite bus
+V=1; //infinite bus voltage
+Pm=1; //mechanical input to the generator
+Xtr=0.15; //transformer reactance
+delta=0:1:180;
+
+//prefault operation
+X1=Xd+Xinf+(Xtr+Xl1+Xtr)/2; //transfer reactance between generator and infinte bus
+Pe1=E*V*sind(delta)/X1;
+delta0=asin(1/max(Pe1));
+printf('Normal Operation (prefault):\n');
+printf('X1=%0.3f PU\n',X1);
+printf('Pe1=%0.2fsin(delta)\n',max(Pe1));
+printf('delta0=%0.3fPU\n\n',delta0);
+//during fault there will be no power transfer
+//using star delta transformation given in the textbook
+X2=2.424;
+Pe2=E*V*sind(delta)/X2;
+printf('During Fault:\n');
+printf('X2=%0.3f PU\n',X2);
+printf('Pe2=%0.3fsin(delta)\n\n',max(Pe2));
+
+//Post fault operation(faulty line switched off)
+X3=Xd+Xinf+(Xtr+Xl1+Xtr);
+Pe3=E*V*sind(delta)/X3;
+delta_max=%pi-asin(Pm/max(Pe3));
+//from A1 and A2, we solve A1=A2
+deff('[y]=fx(delta_cr)',"y=-delta0+max(Pe2)*cos(delta_cr)-0.399-0.661-max(Pe3)*cos(delta_cr)+delta_max");
+delta_cr=fsolve(0.45,fx);
+printf('Post fault operation(faulty line switched off):\n');
+printf('X3=%0.1fPU\n',X3);
+printf('Pe3=%0.1fsin(delta)\n',max(Pe3));
+printf('Delta_cr=%0.4f rad =%0.2f deg',delta_cr,delta_cr*180/%pi);
+plot(delta,Pe1,delta,Pe2,delta,Pe3,delta,Pm);
+legend('Pe1=1.69sin(delta)','Pe2=0.495sin(delta)','Pe3=1.2sin(delta)','Pm=1');
+title('Power angle Diagram for example 12.8');
+xlabel('delta (in degrees)----->');
+ylabel('Electrical output (Pe)----->');
+f=get("current_figure")
+f.figure_position=[0,15]
+f.figure_size=[750,750]
diff --git a/Working_Examples/83/CH12/EX12.8/result_example_12_8.jpeg b/Working_Examples/83/CH12/EX12.8/result_example_12_8.jpeg
new file mode 100755
index 0000000..424f5aa
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.8/result_example_12_8.jpeg
Binary files differ
diff --git a/Working_Examples/83/CH12/EX12.8/result_example_12_8.txt b/Working_Examples/83/CH12/EX12.8/result_example_12_8.txt
new file mode 100755
index 0000000..47c5db1
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.8/result_example_12_8.txt
@@ -0,0 +1,16 @@
+
+
+Normal Operation (prefault):
+X1=0.710 PU
+Pe1=1.69sin(delta)
+delta0=0.633PU
+
+During Fault:
+X2=2.424 PU
+Pe2=0.495sin(delta)
+
+Post fault operation(faulty line switched off):
+X3=1.0PU
+Pe3=1.2sin(delta)
+Delta_cr=0.8536 rad =48.91 deg
+
diff --git a/Working_Examples/83/CH12/EX12.9/example_12_9.sce b/Working_Examples/83/CH12/EX12.9/example_12_9.sce
new file mode 100755
index 0000000..8fe1976
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.9/example_12_9.sce
@@ -0,0 +1,19 @@
+//Chapter 12
+//Example 12.9
+//page 479
+//To calculate critcal clearing angle
+clear;clc;
+Pmax1=2; // prefault(2 lines)
+Pmax2=0.5; //deuring fault
+Pmax3=1.5; //post fault(1 line)
+Pm=1; //initial loading
+
+delta0=asin(Pm/Pmax1);
+delta_max=%pi-asin(Pm/Pmax3);
+
+//to find critical angle,using eq.12.67
+delta_cr=acos((Pm*(delta_max-delta0)-Pmax2*cos(delta0)+Pmax3*cos(delta_max))/(Pmax3-Pmax2));
+printf('Pmax1=%0.1f PU\t Pmax2=%0.2f PU\t Pmax3=%0.2f PU\n\n',Pmax1,Pmax2,Pmax3);
+printf('Delta0=%0.3f rad\n\n',delta0);
+printf('Delta_max=%0.3f rad\n\n',delta_max);
+printf('Delta_cr=%0.3f rad =%0.2f deg\n\n',delta_cr,delta_cr*180/%pi);
diff --git a/Working_Examples/83/CH12/EX12.9/result_example_12_9.txt b/Working_Examples/83/CH12/EX12.9/result_example_12_9.txt
new file mode 100755
index 0000000..bad40c5
--- /dev/null
+++ b/Working_Examples/83/CH12/EX12.9/result_example_12_9.txt
@@ -0,0 +1,11 @@
+
+
+Pmax1=2.0 PU Pmax2=0.50 PU Pmax3=1.50 PU
+
+Delta0=0.524 rad
+
+Delta_max=2.412 rad
+
+Delta_cr=1.227 rad =70.29 deg
+
+