summaryrefslogtreecommitdiff
path: root/83/CH7/EX7.1
diff options
context:
space:
mode:
Diffstat (limited to '83/CH7/EX7.1')
-rwxr-xr-x83/CH7/EX7.1/example_7_1.sce86
-rwxr-xr-x83/CH7/EX7.1/result_example_7_1.txt18
-rwxr-xr-x83/CH7/EX7.1/result_graph_example_7_1.jpgbin0 -> 148973 bytes
3 files changed, 104 insertions, 0 deletions
diff --git a/83/CH7/EX7.1/example_7_1.sce b/83/CH7/EX7.1/example_7_1.sce
new file mode 100755
index 000000000..4980957e4
--- /dev/null
+++ b/83/CH7/EX7.1/example_7_1.sce
@@ -0,0 +1,86 @@
+//Chapter 7
+//Example 7.1
+//page 246
+//To find incremental cost and load sharing
+clear;clc;
+
+///Let us use the program given in the Appendix G in the textbook to write
+//a function that returns the value of lamda and Loading of each generator
+//when the total load on the plant is sent to the function
+
+function [lamdaprev,Pg]=optimum(Pd)
+ n=2; //number of generators
+ Alpha=[0.2 0.25];
+ Beta=[40 30];
+ lamda=35; //initial guess for lambda
+ lamdaprev=lamda;
+ eps=1; //tolerance
+ deltalamda=0.25; //increment in lamda
+ Pgmax=[125 125];
+ Pgmin=[20 20];
+ Pg=100*ones(n,1);
+ while abs(sum(Pg)-Pd)>eps
+ for i=1:n
+ Pg(i)=(lamda-Beta(i))/Alpha(i);
+ if Pg(i)>Pgmax(i) then
+ Pg(i)=Pgmax(i);
+ end
+ if Pg(i)<Pgmin(i) then
+ Pg(i)=Pgmin(i);
+ end
+ end
+ if (sum(Pg)-Pd)<0 then
+ lamdaprev=lamda;
+ lamda=lamda+deltalamda;
+ else
+ lamdaprev=lamda;
+ lamda=lamda-deltalamda;
+ end
+ end
+endfunction
+
+
+//to draw the table 7.1
+printf('Table 7.1 Output of each unit and plant output for various values of lamda\n')
+printf('--------------------------------------------------------------\n');
+printf('Plant Lamda, Unit 1 Unit 2 Plant Output \n');
+printf('Rs/MWh Pg1,MW Pg2,MW (Pg1+Pg2),MW \n');
+printf('--------------------------------------------------------------\n');
+
+Pd_matrix=[40 76 130 150 175 220 231.25 250];
+for i=1:8
+ [lamda,Pg]=optimum(Pd_matrix(i));
+ printf('%0.2f %0.2f %0.2f %0.2f\n',lamda,Pg(1),Pg(2),Pg(1)+Pg(2));
+end
+printf('--------------------------------------------------------------\n');
+
+//To draw the Graphs 7.3 and 7.4
+
+Pd_test=40:3.75:250;
+[Pd_ro,Pd_co]=size(Pd_test)
+for i=1:Pd_co
+ [lamda,Pg]=optimum(Pd_test(i));
+ lamda_test(i)=lamda;
+ Pg1_test(i)=Pg(1);
+ Pg2_test(i)=Pg(2);
+end
+Pg1_test=Pg1_test.'; //transposing without conjugating
+Pg2_test=Pg2_test.';
+lamda_test=lamda_test.';
+
+subplot(211)
+plot(Pd_test,lamda_test);
+title('Incremental Fuel cost versus plant output');
+xlabel('Plant output,MW');
+ylabel('Incremental fuel cost,Rs/MWh');
+set(gca(),"grid",[0,0])
+get("current_axes");
+
+subplot(212)
+plot(Pd_test,Pg1_test,Pd_test,Pg2_test);
+title('Output of each unit versus plant output');
+xlabel('Plant output,MW');
+ylabel('Unit output,MW');
+legend(["Unit 1";"Unit 2"],[2]);
+set(gca(),"grid",[0,0])
+get("current_axes"); \ No newline at end of file
diff --git a/83/CH7/EX7.1/result_example_7_1.txt b/83/CH7/EX7.1/result_example_7_1.txt
new file mode 100755
index 000000000..19fcad441
--- /dev/null
+++ b/83/CH7/EX7.1/result_example_7_1.txt
@@ -0,0 +1,18 @@
+
+
+Table 7.1 Output of each unit and plant output for various values of lamda
+--------------------------------------------------------------
+Plant Lamda, Unit 1 Unit 2 Plant Output
+Rs/MWh Pg1,MW Pg2,MW (Pg1+Pg2),MW
+--------------------------------------------------------------
+35.00 20.00 20.00 40.00
+43.75 20.00 55.00 75.00
+50.00 50.00 80.00 130.00
+52.25 61.25 89.00 150.25
+55.00 75.00 100.00 175.00
+60.00 100.00 120.00 220.00
+61.25 106.25 125.00 231.25
+65.00 125.00 125.00 250.00
+--------------------------------------------------------------
+
+
diff --git a/83/CH7/EX7.1/result_graph_example_7_1.jpg b/83/CH7/EX7.1/result_graph_example_7_1.jpg
new file mode 100755
index 000000000..0d12777ae
--- /dev/null
+++ b/83/CH7/EX7.1/result_graph_example_7_1.jpg
Binary files differ