summaryrefslogtreecommitdiff
path: root/2372/CH1/EX1.1/ex1.sce
blob: 96ceeb59e85748a2ab054ab731d91bff7033d07e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
clc;
clear;
data=[0 2 6; // column 1 and 2 for specifying the 
    2 6 5;   // time interval in hours
    6 9 10;  // column 3 representing Load in MW
    9 12 15;
    12 14 12;
    14 16 14;
    16 18 16;
    18 20 18;
    20 22 16;
    22 23 12;
    23 24 6;];
P=data(:,3);
Dt=data(:,2)-data(:,1);
W=P'*Dt;
Pavg=W/sum(Dt);
peak=max(P);
LF=Pavg/peak*100;
mprintf('avg load,Pavg=%4.2f MW\n',Pavg);
mprintf('Peak load,Peak=%3.1f MW\n',peak);
mprintf('load factor,LF=Pavg/Peak=%4.2f',LF);
r=1;
for(i=1:11)
    x=data(i,1)+1;
    y=data(i,2);
    for(j=x:y)
        bard(r)=data(i,3);
        r=r+1;
    end
end
bar(bard);
xlabel("Time(in hrs)-->");
ylabel("Power,P(in MW)-->");
title("Daily load cycle based on given data");