summaryrefslogtreecommitdiff
path: root/416/CH2/EX2.9/exp2_9c.sce
blob: d9e2546e4c51546dd9b8b1efd32274d863fc3dab (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
clc
clear
disp("example 2.9")
disp("load duration curve in fig1")
disp("the energy consumed upto different times is as ")
a=[0 5 9 18 20 22 24]  //time in matrix format
b=[50 50 100 100 150 80 50] //load in matrix format
for x=1:6
   z(1,x)=((b(1,x)+b(1,x+1))/2)*(a(1,(x+1))-a(1,x))
end
et=0
for x=1:6
    et=et+z(1,x);
    A=a(1,(x+1))
    ett(1,x)=et;
    q(1,x)=a(1,x+1)
    printf("\nfrom mid night upto %d,energy=%dMWh",A,et)
end
q(1,x+1)=[]
[m n]=gsort(b)
m(1,7)=[];m(1,6)=[]; //rearranging for mass  curve
disp("energy curve in fig 2")
t=[0 3.88 15.88 19.88 23]
for j=1:6
    k(1,j)=a(1,(j+1))
end
subplot(121);
plot(t,m);
xtitle("load duration","hours","MW")
subplot(122);
plot(q,ett,-9);
xtitle("energy curve","time","MWh")