NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

clear all
clc

threshold_value=input('Enter the threshold value: ');
reflig=xlsread('loads.xlsx','refrig');
washmac=xlsread('loads.xlsx','washmac');
dishwas=xlsread('loads.xlsx','dishwas');
vacclean=xlsread('loads.xlsx','vacclean');
iron=xlsread('loads.xlsx','iron');
hair_dryr=xlsread('loads.xlsx','hair_dryr');
air_cond=xlsread('loads.xlsx','air_cond');
bakery=xlsread('loads.xlsx','bakery');
micrwave=xlsread('loads.xlsx','micrwave');
aspirator=xlsread('loads.xlsx','aspirator');
elec_heatr=xlsread('loads.xlsx','elec_heatr');
kettil=xlsread('loads.xlsx','kettil');
toastmach=xlsread('loads.xlsx','toastmach');
bulb=xlsread('loads.xlsx','bulb');
battery_winter=xlsread('loads.xlsx','battery_winter');
battery_summer=xlsread('loads.xlsx','battery_summer');
summer_loads=xlsread('loads.xlsx','summer_loads');
winter_loads=xlsread('loads.xlsx','winter_loads');
loads=xlsread('loads.xlsx','loads');

total_load=loads';
mat=[reflig washmac dishwas vacclean iron hair_dryr air_cond bakery micrwave aspirator elec_heatr kettil toastmach bulb]; % loads
matters=mat';
battery_winter=battery_winter'; % we took the reverse of the gain of battery for winter
battery_summer=battery_summer'; % we took the reverse of the gain of battery for summer

Load_Hour= [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; % we formed a matrix
Load_Hour_Winter_Shift= [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; % we formed a matrix for winter shift
Load_Hour_Summer_Shift= [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; % we formed a matrix for summer shift

Costoff=0.363; % Cost of daytime average (06.00-17.00--22.00-06.00)
Coston=0.6769; %Cost of peaktime (17.00-22.00)


for j=1:14
for i=1:13
Load_Hour(1,j)=Load_Hour(1,j)+matters(i,j);
end
end

Load_Hour_Winter=Load_Hour-battery_winter; % we reduced the produced energy from the total load (for winter)
Load_Hour_Summer=Load_Hour-battery_summer; %we reduced the produced energy from the total load (for summer)

LHWonpeak=sum(Load_Hour_Winter(1,17:22)); % on peak of Load_Hour_Winter
LHWoffpeak=sum(Load_Hour_Winter)-sum(Load_Hour_Winter(1,17:22)); % off peak of Load_Hour_Winter

LHSonpeak=sum(Load_Hour_Summer(1,17:22)); % on peak of Load_Hour_Summer
LHSoffpeak=sum(Load_Hour_Summer)-sum(Load_Hour_Summer(1,17:22)); % off peak of Load_Hour_Summer

Total_LHW=LHWonpeak*Coston+LHWoffpeak*Costoff % Total cost of Load_Hour_Winter

Total_LHS=LHSonpeak*Coston+LHSoffpeak*Costoff % Total cost of Load_Hour_Summer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

TTO_Winter=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; % we created a matrix for winter
t=17; % we added t to create a loop, peak starting.(17.00-22.00 , peak time interval)

while t<13 % peak ending.
for i=1:13
Load_Hour_Winter_Shift(1,t)=Load_Hour_Winter_Shift(1,t)+total_load(i,t);
if sum(Load_Hour_Winter_Shift(1,t))>threshold_value

TTO_Winter(1,t)=TTO_Winter(1,t)+total_load(i,t);
else
end
end
t=t+1;

end

Shift_total_load_Winter=Load_Hour_Winter-TTO_Winter-battery_winter; % total shifting load for winter
Shift_total_load_Winter(1,23)=Shift_total_load_Winter(1,23)+sum(TTO_Winter); % we added shifting load to 23.00

Shift_Cost_onpeak_Winter=sum(Shift_total_load_Winter(1,17:22))*Coston; % we calculated the cost of shifting onpeak for winter
Shift_Cost_offpeak_Winter=(sum(Shift_total_load_Winter)-sum(Shift_total_load_Winter(1,17:22)))*Costoff; % we calculated the cost of shifting offpeak for winter
Shift_Total_Winter = Shift_Cost_onpeak_Winter + Shift_Cost_offpeak_Winter % we calculated the cost of total shigting for winter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TTO_Summer=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; % we created a matrix for summer
t=17;

while t<13
for i=1:13
Load_Hour_Summer_Shift(1,t)=Load_Hour_Summer_Shift(1,t)+total_load(i,t);
if sum(Load_Hour_Summer_Shift(1,t))>threshold_value

TTO_Summer(1,t)=TTO_Summer(1,t)+total_load(i,t);
else
end
end
t=t+1;

end

Shift_total_load_Summer=Load_Hour_Summer-TTO_Summer-battery_summer;
Shift_total_load_Summer(1,23)=Shift_total_load_Summer(1,23)+sum(TTO_Summer);

Shift_Cost_onpeak_Summer=sum(Shift_total_load_Summer(1,17:22))*Coston;
Shift_Cost_offpeak_Summer=(sum(Shift_total_load_Summer)-sum(Shift_total_load_Summer(1,17:22)))*Costoff;
Shift_Total_Summer=Shift_Cost_onpeak_Summer+Shift_Cost_offpeak_Summer

stairs(Shift_total_load_Winter,'g')
hold on
stairs(Load_Hour_Winter,'r')
legend('Shift Winter+battery','noShift Winter')
figure
stairs(Shift_total_load_Summer,'b')
hold on
stairs(Load_Hour_Summer,'r')
legend('Shift Summer+battery','noShift Summer')


Profit_Winter=Total_LHW-Shift_Total_Winter
Profit_Summer=Total_LHS-Shift_Total_Summer
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.