No BSD License  

Highlights from
Energy Bid Stack Viewer

image thumbnail

Energy Bid Stack Viewer

by

 

26 Apr 2006 (Updated )

Energy Bid Stack Viewer for Australian electricity market

build_data(daily_data,period_data)
function [area_data,disp_dates,price_bands] = build_data(daily_data,period_data)


% get a list of the unique dates within the specified data range
unique_dates = unique(daily_data.TRADING_DATETIME);

price_bands = zeros(length(unique_dates),10);

% Convert the dates to DD-MM-YYYY for display
disp_dates = datenum(unique_dates,'yyyy-mm-dd HH:MM:ss.s');
disp_dates = cellstr(datestr(disp_dates,'dd/mm/yyyy'));

for cur_date = 1:length(unique_dates)
    
    % Get the locations of the current date
    cur_date_ind = strcmp(unique_dates(cur_date),daily_data.TRADING_DATETIME);
    
    % Get the maximum version_no for this date
    ver_no = str2num(char(daily_data.VERSION_NO(cur_date_ind)));
    max_ver_no = max(ver_no);
    
    % Get the period data for this update version
    period_date_ind = strcmp(unique_dates(cur_date),period_data.TRADING_DATETIME);
    period_ver_ind  = period_data.VERSION_NO == max_ver_no;
    
    cur_period_ind  =  period_date_ind & period_ver_ind;
    
    area_data(:,:,cur_date) = [ period_data.BAND_AVAIL_1(cur_period_ind) , ...
                                period_data.BAND_AVAIL_2(cur_period_ind) , ...
                                period_data.BAND_AVAIL_3(cur_period_ind) , ...
                                period_data.BAND_AVAIL_4(cur_period_ind) , ...
                                period_data.BAND_AVAIL_5(cur_period_ind) , ...
                                period_data.BAND_AVAIL_6(cur_period_ind) , ...
                                period_data.BAND_AVAIL_7(cur_period_ind) , ...
                                period_data.BAND_AVAIL_8(cur_period_ind) , ...
                                period_data.BAND_AVAIL_9(cur_period_ind) , ...
                                period_data.BAND_AVAIL_10(cur_period_ind)];
                        
     daily_date_ind = strcmp(unique_dates(cur_date),daily_data.TRADING_DATETIME);  
     daily_ver_ind  = str2num(char(daily_data.VERSION_NO)) == max_ver_no;
     cur_daily_ind  =  daily_date_ind & daily_ver_ind;
     
     price_bands(cur_date,1)  = daily_data.PRICE_BAND_1(cur_daily_ind);
     price_bands(cur_date,2)  = daily_data.PRICE_BAND_2(cur_daily_ind);
     price_bands(cur_date,3)  = daily_data.PRICE_BAND_3(cur_daily_ind);
     price_bands(cur_date,4)  = daily_data.PRICE_BAND_4(cur_daily_ind);
     price_bands(cur_date,5)  = daily_data.PRICE_BAND_5(cur_daily_ind);
     price_bands(cur_date,6)  = daily_data.PRICE_BAND_6(cur_daily_ind);
     price_bands(cur_date,7)  = daily_data.PRICE_BAND_7(cur_daily_ind);
     price_bands(cur_date,8)  = daily_data.PRICE_BAND_8(cur_daily_ind);
     price_bands(cur_date,9)  = daily_data.PRICE_BAND_9(cur_daily_ind);
     price_bands(cur_date,10) = daily_data.PRICE_BAND_10(cur_daily_ind);
          
end

Contact us