HomeMy WebLinkAbout20230705IPC to Staff PR 4 Attachment - Outage_Prob_Table.pdffunction COPT = outageProbTable(GENERATOR_CAPACITIES, GENERATOR_OUTAGE)
% % Programmed by Andres Valdepena Delgado (06/26/2020)
% Email ‐ avaldepenadelgado@idahopower.com
% Input Description:
% GENERATOR_CAPACITIES vector with capacity of each generator
[N x 1] (double)
% GENERATOR_OUTAGE the corresponding Equivalent Forced Outage Rate on Demand
(EFORd) for each generator [N x 1] (double)
% Output Description:
% Returns the capacity outage probability table (COPT): [System Capacity Available,
State Probabilities] [M x 2] (double)
% Generator Units In = COPT Units Out
% Notes:
% Computational efficiency is achieved by combining states that sum to the
% same system capacity. The script automatically rounds all generators to 2 decimal
% points; however, further rounding will achieve greater performance.
%
% Maximum # of System States = SUM(GENERATOR_CAPACITIES)/(smallest unit of
measurement)
% i.e 500,000 possible generator states for a system of 500 MW measured to the
nearest kW
% but only 500 possible generator states for a system of 500 MW measured to the
nearest MW
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% START SCRIPT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Rounds generator capacity to the nearest 10 kW for computational efficiency
GENERATOR_CAPACITIES = round(GENERATOR_CAPACITIES*100)/100;
% Format "sum(generator availability)", "state probability"
% The routine starts with 0 generators and, by definition, a probability of 1
COPT = [0 1];
for i = 1:length(GENERATOR_CAPACITIES)
% Initialize generator branches
genOffBranch = COPT; %genOffBranch ‐ branch that treats the next generator
as being off
genOnBranch = COPT; %genOnBranch ‐ branch that treats the next generator as
being on
% Branch with generator off
genOffBranch(:,2) = GENERATOR_OUTAGE(i) * genOffBranch(:,2);
% Branch with generator on
genOnBranch(:,1) = GENERATOR_CAPACITIES(i) + genOnBranch(:,1);
genOnBranch(:,2) = (1‐GENERATOR_OUTAGE(i)) * genOnBranch(:,2);
[intersection, IA, IB] = intersect(genOffBranch(:,1),genOnBranch(:,1)); %
Common states to the on and off branches
[unique_off, I_0] = setdiff(genOffBranch(:,1), genOnBranch(:,1)); % Unique
states on the off branch
[unique_on, I_1] = setdiff(genOnBranch(:,1), genOffBranch(:,1)); % Unique
states on the on branch;
COPT = sortrows([[intersection, genOffBranch(IA,2)+genOnBranch(IB,2)];
[unique_off, genOffBranch(I_0,2)]; [unique_on, genOnBranch(I_1,2)]],1); % Combine
states together and sort
end