Вы находитесь на странице: 1из 6

Introduction:

Load Type 1 is a random load


Load Type 2 is a random binary load i.e. can be on or off only
Load Type 3 is a non-interruptible load with a given start time and operating time.

The optimisation algorithm optimally allocates the load profiles for loads type 1, 2 and 3 but
for now we chose random ones.

Results:

price
5

4.5

3.5

2.5

1.5

1
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)
Load 1
5

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)

Cost for Load 1


25

20

15

10

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)

Load 2
4

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)

Cost for Load 2


20

15

10

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)
Load 3
100

80

60

40

20

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)

Cost for Load 3


500

400

300

200

100

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)

total cost
450

400

350

300

250

200

150

100

50

0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
time (hours)
Matlab Code:

function [ profile ] = price( hourly,dt)

t = 1:dt:24*dt;
ti = 1:1:24*dt;
profile = interp1(t,hourly,ti);

end

function [ profiles ] = loads(type, dt, p_rated, runtime, start )


profiles = zeros(1,24*dt);

if type == 1 %random load continuous


profiles = p_rated.*rand(24*dt,1);

elseif type == 2 %random load binary


profiles = p_rated.*round(rand(24*dt,1));

else %random load binary


hourly = zeros(24,1);
hourly(start:start+runtime-1) = p_rated.*ones(1,runtime);

for i = 0:23
profiles(i*dt + 1:(i+1)*dt) = hourly(i+1).*p_rated.*ones(1,dt);
end

profiles = profiles';
end

end

clear all; close all; clc

prices_hourly = ...
[1,1,1,1,1,1,1,1.8,2.6,3.4,4.2,...
5,5,5,5,5,5,4.2,3.4,2.6,1.8,1,1,1];%prices

resolution = 200; %time step in seconds


dt = 3600/resolution; %number of steps in an hour

price_profile = price( prices_hourly,dt)';

load1 = loads(1, dt, 5);


load2 = loads(2, dt, 4);
load3 = loads(3, dt, 9, 6, 7);

cost1 = load1.*price_profile;
cost2 = load2.*price_profile;
cost3 = load3.*price_profile;

total_cost = cost1 + cost2 + cost3;


figure()
plot(price_profile);
title('price')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

figure()
subplot(2,1,1)
plot(load1);
title('Load 1')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

subplot(2,1,2)
plot(cost1);
title('Cost for Load 1')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

figure()
subplot(2,1,1)
plot(load2);
title('Load 2')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

subplot(2,1,2)
plot(cost2);
title('Cost for Load 2')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

figure()
subplot(2,1,1)
plot(load3);
title('Load 3')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

subplot(2,1,2)
plot(cost3);
title('Cost for Load 3')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

figure()
plot(total_cost);
title('total cost')
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

Вам также может понравиться