0% found this document useful (0 votes)
6 views4 pages

Eco

Uploaded by

ramachandran5000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Eco

Uploaded by

ramachandran5000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Program

clc;

clear;

disp('Enter cost coefficients for each generator in the form: [a b c] for C = a + bP + cP^2');

% Input cost coefficients

C1 = input('Enter cost coefficients for Generator 1 [a b c]: ');

C2 = input('Enter cost coefficients for Generator 2 [a b c]: ');

C3 = input('Enter cost coefficients for Generator 3 [a b c]: ');

PD = input('Enter total demand (MW): ');

lambda = input('Enter the value of lambda: ');

% Extracting coefficients

a1 = C1(1); b1 = C1(2); c1 = C1(3);

a2 = C2(1); b2 = C2(2); c2 = C2(3);

a3 = C3(1); b3 = C3(2); c3 = C3(3);

% Solve for P1, P2, P3

P1 = (lambda - b1) / (2 * c1);

P2 = (lambda - b2) / (2 * c2);

P3 = (lambda - b3) / (2 * c3);

% Check power balance

P_total = P1 + P2 + P3;

% Calculate individual costs

Cost1 = a1 + b1 * P1 + c1 * P1^2;

Cost2 = a2 + b2 * P2 + c2 * P2^2;

Cost3 = a3 + b3 * P3 + c3 * P3^2;

Total_Cost = Cost1 + Cost2 + Cost3;


% Display results

fprintf('\nOptimal Generation:\n');

fprintf('P1 = %.2f MW\n', P1);

fprintf('P2 = %.2f MW\n', P2);

fprintf('P3 = %.2f MW\n', P3);

fprintf('Total Generated Power = %.2f MW\n', P_total);

fprintf('Total Cost = Rs %.2f /hr\n', Total_Cost);

Output

Enter cost coefficients for Generator 1 [a b c]: [500 5.3 0.004]

Enter cost coefficients for Generator 2 [a b c]: [400 5.5 0.006]

Enter cost coefficients for Generator 3 [a b c]: [200 5.8 0.009]

Enter total demand (MW): 800

Enter the value of lambda: 8.5

Optimal Generation:

P1 = 400.00 MW

P2 = 250.00 MW

P3 = 150.00 MW

Total Generated Power = 800.00 MW

Total Cost = Rs 6682.50 /hr

You might also like