Assignment

3
Assignment Program to solve Economic Load Dispatch Problem on Matlab clear all clc global P1 P2 P3 Lambda PL global P1min P2min P3min P1max P2max P3max % define Pi_min and Pi_max P1min = 150; P2min = 100; P3min = 50; P1max = 600; P2max = 400; P3max = 200; % set initial guess of powers and system lambda step 1 P1=400; P2=300; P3=150; Lambda = 9.5252; %incremntal power lossesstep 2 PL= 0.0003*P1^2 +0.00009*P2^2 +0.00012*P3^2; %dPL/dP IL1=2*(0.00003)*P1; IL2=2*(0.00009)*P2; IL3=2*(0.00012)*P3; PL= 0.00003*P1^2 +0.00009*P2^2 +0.00012*P3^2; %using cordination equation step 3 P4=(((Lambda*(1-IL1))-7.92))/0.003124; P5=((Lambda*(1-IL2))-7.85)/0.00388; P6=((Lambda*(1-IL3))-7.97)/0.00964; P1+P2+P2-850-PL; disp('Example 3H ') disp('___________') disp('P1 P2 P3 Lambda Power.Lost') disp(['Power of Unit 1: ' num2str(P4)]) disp(['Power of Unit 2: ' num2str(P5)]) disp(['Power of Unit 3: ' num2str(P6)]) disp(['Total power lost: ' num2str(PL)])

Transcript of Assignment

Page 1: Assignment

AssignmentProgram to solve Economic Load Dispatch Problem on Matlab

clear allclcglobal P1 P2 P3 Lambda PLglobal P1min P2min P3min P1max P2max P3max% define Pi_min and Pi_maxP1min = 150;P2min = 100;P3min = 50;P1max = 600;P2max = 400;P3max = 200;% set initial guess of powers and system lambda step 1

P1=400;P2=300;P3=150;Lambda = 9.5252;

%incremntal power lossesstep 2PL= 0.0003*P1^2 +0.00009*P2^2 +0.00012*P3^2; %dPL/dP IL1=2*(0.00003)*P1;IL2=2*(0.00009)*P2;IL3=2*(0.00012)*P3;PL= 0.00003*P1^2 +0.00009*P2^2 +0.00012*P3^2; %using cordination equation step 3 P4=(((Lambda*(1-IL1))-7.92))/0.003124;P5=((Lambda*(1-IL2))-7.85)/0.00388;P6=((Lambda*(1-IL3))-7.97)/0.00964;P1+P2+P2-850-PL; disp('Example 3H ')disp('___________')disp('P1 P2 P3 Lambda Power.Lost')disp(['Power of Unit 1: ' num2str(P4)])disp(['Power of Unit 2: ' num2str(P5)])disp(['Power of Unit 3: ' num2str(P6)])disp(['Total power lost: ' num2str(PL)])disp(['Lambda of first iteration:' num2str(Lambda)])

Page 2: Assignment

OutputExample 3H ___________

P1 P2 P3 Lambda power.Lost

Power of Unit 1: 440.6515

Power of Unit 2: 299.1854

Power of Unit 3: 125.7565

Total power lost: 15.6

Lambda of first iteration:9.5252

Function File:

function F = funny(x)global P1 P2 P3 Lambdaglobal P1min P2min P3min P1max P2max P3max% define Pi_min and Pi_maxP1min = 150;P2min = 100;P3min = 50;P1max = 600;P2max = 400;P3max = 200;% Unknown variablesP1 = x(1);P2 = x(2);P3 = x(3);Lambda = z(4);if P3 < P3minP3 = P3min;elseif P3 > P3maxP3 = P3max;endend if P2 < P2minP2 = P2min;elseif P2 > P2maxP2 = P2max;endendif P1 < P1minP1 = P1min;elseif P1 > P1maxP1 = P1max;endend