summaryrefslogtreecommitdiff
path: root/83/CH7/EX7.4
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /83/CH7/EX7.4
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '83/CH7/EX7.4')
-rwxr-xr-x83/CH7/EX7.4/example_7_4.sce59
-rwxr-xr-x83/CH7/EX7.4/result_example_7_4.txt15
2 files changed, 74 insertions, 0 deletions
diff --git a/83/CH7/EX7.4/example_7_4.sce b/83/CH7/EX7.4/example_7_4.sce
new file mode 100755
index 000000000..2fb2f767e
--- /dev/null
+++ b/83/CH7/EX7.4/example_7_4.sce
@@ -0,0 +1,59 @@
+//Chapter 7
+//Example 7.4
+//page 263
+//To find required generation for each plant and losses incurred
+clear;clc;
+
+///Let us use the program given in the Appendix G in the textbook which includes penalty factor also to write
+//a function that returns the value of lamda,Loading of each generator and losses
+//when the total load on the plant is sent to the function
+
+function [lamda,Pg,PL]=optimum2(Pd)
+n=2; //no of generators
+Alpha=[0.02 0.04];
+Beta=[16 20];
+lamda=20; //initial value of lamda
+lamdaprev=lamda;
+eps=1; //tolerance
+deltalamda=0.1;
+Pgmax=[200 200];
+Pgmin=[0 0];
+B=[0.001 0;0 0];
+Pg=zeros(n,1);
+noofiter=0;
+PL=0;
+Pg=zeros(n,1);
+while abs(sum(Pg)-Pd-PL)>eps
+ for i=1:n
+ sigma=B(i,:)*Pg-B(i,i)*Pg(i);
+ Pg(i)=(1-(Beta(i)/lamda)-(2*sigma))/(Alpha(i)/lamda+2*B(i,i));
+ PL=Pg.'*B*Pg;
+ if Pg(i)>Pgmax(i) then
+ Pg(i)=Pgmax(i);
+ end
+ if Pg(i)<Pgmin(i) then
+ Pg(i)=Pgmin(i);
+ end
+ end
+ PL=Pg.'*B*Pg;
+ if(sum(Pg)-Pd-PL)<0 then
+ lamdaprev=lamda;
+ lamda=lamda+deltalamda;
+ else
+ lamdaprev=lamda;
+ lamda=lamda-deltalamda;
+ end
+ noofiter=noofiter+1;
+ Pg;
+end
+endfunction
+
+//In this example let us take the answer .i.e load(Pd)=237.04MW and calculate
+//lamda so that we can use the algorithm used in the textbook
+Pd=237.04
+[lamda_test,Pg_test,PL_test]=optimum2(Pd);
+printf('\nLagrange''s multiplier (lamda) is\n Lamda =%0.1f',lamda_test);
+printf('\n\nRequired generation for optimum loading are \n Pg1=%0.2f MW \n Pg2=%d MW\n',Pg_test(1),Pg_test(2));
+printf('\nThe transmission power loss is\n PL=%0.2f MW',PL_test);
+printf('\n\nThe load is \n Pd=%0.2f MW',Pd);
+
diff --git a/83/CH7/EX7.4/result_example_7_4.txt b/83/CH7/EX7.4/result_example_7_4.txt
new file mode 100755
index 000000000..9038d91c5
--- /dev/null
+++ b/83/CH7/EX7.4/result_example_7_4.txt
@@ -0,0 +1,15 @@
+
+
+Lagrange's multiplier (lamda) is
+ Lamda =24.9
+
+Required generation for optimum loading are
+ Pg1=128.57 MW
+ Pg2=125 MW
+
+The transmission power loss is
+ PL=16.53 MW
+
+The load is
+ Pd=237.04 MW
+