You are on page 1of 6

# Introduction:

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)
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)

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)

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)

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)
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)

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));

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

## 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)
set(gca,'XTick',0:dt:24*dt)
set(gca,'XTickLabel',0:1:24)
xlabel('time (hours)')

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

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

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

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

subplot(2,1,2)
plot(cost3);