diff --git a/Programs/vSPDfileList.inc b/Programs/vSPDfileList.inc index a11fa70..88d6f04 100644 --- a/Programs/vSPDfileList.inc +++ b/Programs/vSPDfileList.inc @@ -1,3 +1,3 @@ / -'Pricing_20221105' +'Pricing_20231128' / diff --git a/Programs/vSPDmodel.g00 b/Programs/vSPDmodel.g00 index daa2b3b..573fe53 100644 Binary files a/Programs/vSPDmodel.g00 and b/Programs/vSPDmodel.g00 differ diff --git a/Programs/vSPDmodel.gms b/Programs/vSPDmodel.gms index 254e202..4f57015 100644 --- a/Programs/vSPDmodel.gms +++ b/Programs/vSPDmodel.gms @@ -239,6 +239,7 @@ Scalars Sets * Global case2dt(ca,dt) 'mapping caseID-DateTime pair' + tp2dt(tp,dt) 'mapping period to first datetime in a period ' t(ca,dt) 'Current trading interval to solve' * Node/bus diff --git a/Programs/vSPDoverrides.gms b/Programs/vSPDoverrides.gms index 5e720a8..84ae18c 100644 --- a/Programs/vSPDoverrides.gms +++ b/Programs/vSPDoverrides.gms @@ -7,7 +7,7 @@ * https://www.emi.ea.govt.nz/Tools/vSPD * Contact: Forum: https://www.emi.ea.govt.nz/forum/ * Email: emi@ea.govt.nz -* Last modified on: 18 March 2022 +* Last modified on: 10 November 2023 * *===================================================================================== @@ -22,404 +22,1137 @@ After declaring the override symbols, the override data is installed and the original symbols are overwritten. Note that: -The Excel interface permits a limited number of input data symbols to be overridden. -The EMI interface will create a GDX file of override values for all data inputs to be overridden. -If operating in standalone mode,overrides can be installed by any means the user prefers - GDX file, $include file, hard-coding, etc. -But it probably makes sense to mimic the GDX file as used by EMI. - -Use GAMS to process a text file (e.g. somefile.gms) into a GDX file called filename.gdx, -e.g. c:\>gams somefile.gms gdx=filename +User use the Excel interface to create overrdies in GDX format. Directory of code sections in vSPDoverrides.gms: - 1. Declare all symbols required for vSPD on EMI and standalone overrides and load data from GDX - 2. Initialise the data - a) Demand overrides - b) Offers - ... + 1. Demand overrides + 2. Offer parameter overrides + 3. Offer energy overrides + 4. Offer reserve overrides + 5. Bid parameter overrides + 6. Demand Bid overrides + 7. Branch parameter overrides + 8. Branch constraint RHS overrides + 9. Branch constraint factors overrides + 10. Market node constraint RHS overrides + 11. Market node constraint factor overrides $offtext -$OnEnd + + +* mapping data +case2dt(ca,dt) = yes $ sum[ tp $ case2dt2tp(ca,dt,tp), 1] ; +node(ca,dt,n) = yes $ sum[ b $ nodeBus(ca,dt,n,b), 1 ] ; +bus(ca,dt,b) = yes $ sum[ isl $ busIsland(ca,dt,b,isl), 1 ] ; +nodeIsland(ca,dt,n,isl) $ sum[ b $ { bus(ca,dt,b) and node(ca,dt,n) and nodeBus(ca,dt,n,b) and busIsland(ca,dt,b,isl) }, 1 ] = yes ; + *========================================================================================================================= -* 1. Declare all symbols required for vSPD on EMI and standalone overrides and load data from GDX +* 1. Demand overrides *========================================================================================================================= -Set demMethod 'Demand override method' / scale, increment, value / ; +$onText +- When : By "all time" is applied first, by "period" are applied second and take precedence over "all time", by "caseID" are + applied next and take precedence over "period" and datetime are applied last and take precedence over "caseID". + +- Where: By "all nodes" is applied first, by "island" are applied second and take precedence over "all nodes", and datetime + are applied last and take precedence over "caseID". + +- Type : By "all load types" is applied first, by "conforming/nonconform" are applied second and take precedence over "all load type". + +- How : scaling is applied first, increments are applied second and take precedence over scaling, + and values are applied last and take precedence over increments. + +- Increment and value overrides applied to island/NZ level will be distributed to positive load only. +$offText +Sets + alll 'set that indicate the overrides appied to all element in a dimension' / All / + type 'Demand override applied to load type' / All, Conforming, Nonconform / + how 'Demand override method' / scale, increment, value / +; Parameters * Demand - ovrd_tradePeriodNodeDemand(tp,n,demMethod) 'Override the i_tradePeriodNodeDemand parameter' - ovrd_dateTimeNodeDemand(dt,n,demMethod) 'Override the i_tradePeriodNodeDemand parameter with dateTime data' + ovrd_Demand_AllTime_All(alll,alll,type,how) 'Demand override applied to all nodes all the time' + ovrd_Demand_Period_All(tp,alll,type,how) 'Demand override applied to all nodes for a trading period every day' + ovrd_Demand_CaseID_All(ca,alll,type,how) 'Demand override applied to all nodes for a CaseID' + ovrd_Demand_DateTime_All(dt,alll,type,how) 'Demand override applied to all nodes for a DateTime' + + ovrd_Demand_AllTime_Island(alll,isl,type,how) 'Island demand override applied all the time' + ovrd_Demand_Period_Island(tp,isl,type,how) 'Island demand override applied to a trading period every day' + ovrd_Demand_CaseID_Island(ca,isl,type,how) 'Island demand override applied to a CaseID' + ovrd_Demand_DateTime_Island(dt,isl,type,how) 'Island demand override applied to a DateTime' + + ovrd_Demand_AllTime_Node(alll,n,type,how) 'Node demand override applied all the time' + ovrd_Demand_Period_Node(tp,n,type,how) 'Node demand override applied to a trading period every day' + ovrd_Demand_CaseID_Node(ca,n,type,how) 'Node demand override applied to a CaseID' + ovrd_Demand_DateTime_Node(dt,n,type,how) 'Node demand override applied to a DateTime' + +* temporary calculated parameters + positive_IslandDemand(ca,dt,isl,type) 'Temporary container for island positive demand value while implementing the island-based scaling factor' + negative_IslandDemand(ca,dt,isl,type) 'Temporary container for island negative demand value while implementing the island-based scaling factor' + positive_NZDemand(ca,dt,type) 'Temporary container for NZ positive demand value while implementing the island-based scaling factor' + negative_NZDemand(ca,dt,type) 'Temporary container for NZ negative demand value while implementing the island-based scaling factor' + temp_NodeDemandScale(ca,dt,n) 'Final scaling factor applied to node level' +; + + +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" + +$load ovrd_Demand_AllTime_All = demand_overrides +$load ovrd_Demand_Period_All = demand_overrides +$load ovrd_Demand_DateTime_All = demand_overrides +$load ovrd_Demand_CaseID_All = demand_overrides + +$load ovrd_Demand_AllTime_Island = demand_overrides +$load ovrd_Demand_Period_Island = demand_overrides +$load ovrd_Demand_DateTime_Island = demand_overrides +$load ovrd_Demand_CaseID_Island = demand_overrides + +$load ovrd_Demand_AllTime_Node = demand_overrides +$load ovrd_Demand_Period_Node = demand_overrides +$load ovrd_Demand_DateTime_Node = demand_overrides +$load ovrd_Demand_CaseID_Node = demand_overrides + +$gdxin +$offEps + +* Calculate temporary parameters for overrdie process +if (1=1, + +positive_IslandDemand(case2dt(ca,dt),isl,'All') = sum[ n $ {nodeIsland(ca,dt,n,isl) and (nodeParameter(ca,dt,n,'demand') > 0) }, nodeParameter(ca,dt,n,'demand')]; +positive_IslandDemand(case2dt(ca,dt),isl,'Nonconform') = sum[ n $ {nodeIsland(ca,dt,n,isl) and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') }, nodeParameter(ca,dt,n,'demand')]; +positive_IslandDemand(case2dt(ca,dt),isl,'Conforming') = sum[ n $ {nodeIsland(ca,dt,n,isl) and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL'))}, nodeParameter(ca,dt,n,'demand')]; + +negative_IslandDemand(case2dt(ca,dt),isl,'All') = sum[ n $ {nodeIsland(ca,dt,n,isl) and (nodeParameter(ca,dt,n,'demand') < 0) }, nodeParameter(ca,dt,n,'demand')]; +negative_IslandDemand(case2dt(ca,dt),isl,'Nonconform') = sum[ n $ {nodeIsland(ca,dt,n,isl) and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') }, nodeParameter(ca,dt,n,'demand')]; +negative_IslandDemand(case2dt(ca,dt),isl,'Conforming') = sum[ n $ {nodeIsland(ca,dt,n,isl) and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL'))}, nodeParameter(ca,dt,n,'demand')]; + +positive_NZDemand(case2dt(ca,dt),'All') = sum[ n $ {(nodeParameter(ca,dt,n,'demand') > 0) }, nodeParameter(ca,dt,n,'demand')]; +positive_NZDemand(case2dt(ca,dt),'Nonconform') = sum[ n $ {(nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') }, nodeParameter(ca,dt,n,'demand')]; +positive_NZDemand(case2dt(ca,dt),'Conforming') = sum[ n $ {(nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL'))}, nodeParameter(ca,dt,n,'demand')]; + +negative_NZDemand(case2dt(ca,dt),'All') = sum[ n $ {(nodeParameter(ca,dt,n,'demand') < 0) }, nodeParameter(ca,dt,n,'demand')]; +negative_NZDemand(case2dt(ca,dt),'Nonconform') = sum[ n $ {(nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') }, nodeParameter(ca,dt,n,'demand')]; +negative_NZDemand(case2dt(ca,dt),'Conforming') = sum[ n $ {(nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL'))}, nodeParameter(ca,dt,n,'demand')]; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ nodeParameter(ca,dt,n,'demand') = 1; +) ; + +* Overrides applied all the time +if (1=1, + +* Overrides applied all the time for entire NZ +if (1=1, + +* Calculate scaling factor for demand scale overrides applied to all time, every where +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','All','scale') and (nodeParameter(ca,dt,n,'demand') > 0) + } = ovrd_Demand_AllTime_All('All','All','All','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = ovrd_Demand_AllTime_All('All','All','Nonconform','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = ovrd_Demand_AllTime_All('All','All','Conforming','scale') ; + + +* Calculate scaling factor for demand increment overrides applied to all time, every where +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','All','increment') and (nodeParameter(ca,dt,n,'demand') > 0) } + = [ ovrd_Demand_AllTime_All('All','All','All','increment') + positive_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ ovrd_Demand_AllTime_All('All','All','Nonconform','increment') + positive_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ ovrd_Demand_AllTime_All('All','All','Conforming','increment') + positive_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + + +* Calculate scaling factor for demand value overrides applied to all time, every where +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','All','value') and (nodeParameter(ca,dt,n,'demand') > 0) } + = [ovrd_Demand_AllTime_All('All','All','All','value') - negative_NZDemand(ca,dt,'All')] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ovrd_Demand_AllTime_All('All','All','Nonconform','value') - negative_NZDemand(ca,dt,'Nonconform')] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_AllTime_All('All','All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ ovrd_Demand_AllTime_All('All','All','Conforming','value') - negative_NZDemand(ca,dt,'Conforming')] / positive_NZDemand(ca,dt,'Conforming') ; + +) ; + + +* Overrides applied all the time for island +if (1=1, + +* Calculate scaling factor for demand scale overrdies applied to all time and an island +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'All','scale') ] ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Nonconform','scale') ] + and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Nonconform','scale') ]; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Conforming','scale') ] + and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Conforming','scale') ] ; + + +* Calculate scaling factor for demand increment overrdies applied to all time and an island +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'All','increment')] + and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), { ovrd_Demand_AllTime_Island('All',isl,'All','increment') + positive_IslandDemand(ca,dt,isl,'All') + } / positive_IslandDemand(ca,dt,isl,'All') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Nonconform','increment')] + and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), { ovrd_Demand_AllTime_Island('All',isl,'Nonconform','increment') + positive_IslandDemand(ca,dt,isl,'Nonconform') + } / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Conforming','increment')] + and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), { ovrd_Demand_AllTime_Island('All',isl,'Conforming','increment') + positive_IslandDemand(ca,dt,isl,'Conforming') + } / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + + +* Calculate scaling factor for demand value overrdies applied to all time and an island +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'All','value')] + and (nodeParameter(ca,dt,n,'demand') > 0) } + = sum[ isl $ nodeIsland(ca,dt,n,isl), { ovrd_Demand_AllTime_Island('All',isl,'All','value') - negative_IslandDemand(ca,dt,isl,'All') + } / positive_IslandDemand(ca,dt,isl,'All') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Nonconform','value')] + and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = sum[ isl $ nodeIsland(ca,dt,n,isl), { ovrd_Demand_AllTime_Island('All',isl,'Nonconform','value') - negative_IslandDemand(ca,dt,isl,'Nonconform') + } / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_AllTime_Island('All',isl,'Conforming','value')] + and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = sum[ isl $ nodeIsland(ca,dt,n,isl), { ovrd_Demand_AllTime_Island('All',isl,'Conforming','value') - negative_IslandDemand(ca,dt,isl,'Conforming') + } / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + +); + + +* Overrides applied all the time for node +if (1=1, + +* Calculate scaling factor for demand scale overrdies applied to all time and a node +temp_NodeDemandScale(case2dt(ca,dt),n) $ ovrd_Demand_AllTime_Node('All',n,'All','scale') = ovrd_Demand_AllTime_Node('All',n,'All','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ {ovrd_Demand_AllTime_Node('All',n,'Nonconform','scale') and nodeParameter(ca,dt,n,'loadIsNCL') } = ovrd_Demand_AllTime_Node('All',n,'Nonconform','scale'); +temp_NodeDemandScale(case2dt(ca,dt),n) $ {ovrd_Demand_AllTime_Node('All',n,'Conforming','scale') and (not nodeParameter(ca,dt,n,'loadIsNCL'))} = ovrd_Demand_AllTime_Node('All',n,'Conforming','scale'); + + +* Calculate scaling factor for demand increment overrdies applied to all time and a node +temp_NodeDemandScale(case2dt(ca,dt),n) $ ovrd_Demand_AllTime_Node('All',n,'All','increment') + = [ ovrd_Demand_AllTime_Node('All',n,'All','increment') $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [(ovrd_Demand_AllTime_Node('All',n,'All','increment') + nodeParameter(ca,dt,n,'demand'))/nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ {ovrd_Demand_AllTime_Node('All',n,'Nonconform','increment') and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ ovrd_Demand_AllTime_Node('All',n,'Nonconform','increment') $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [(ovrd_Demand_AllTime_Node('All',n,'Nonconform','increment') + nodeParameter(ca,dt,n,'demand'))/nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ {ovrd_Demand_AllTime_Node('All',n,'Conforming','increment') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ ovrd_Demand_AllTime_Node('All',n,'Conforming','increment') $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [(ovrd_Demand_AllTime_Node('All',n,'Conforming','increment') + nodeParameter(ca,dt,n,'demand'))/nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + + +* Calculate scaling factor for demand value overrdies applied to all time and a node +temp_NodeDemandScale(case2dt(ca,dt),n) $ ovrd_Demand_AllTime_Node('All',n,'All','value') + = [ ovrd_Demand_AllTime_Node('All',n,'All','value') $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ ovrd_Demand_AllTime_Node('All',n,'All','value') / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ {ovrd_Demand_AllTime_Node('All',n,'Nonconform','value') and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ ovrd_Demand_AllTime_Node('All',n,'Nonconform','value') $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ ovrd_Demand_AllTime_Node('All',n,'Nonconform','value') / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ {ovrd_Demand_AllTime_Node('All',n,'Conforming','value') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ ovrd_Demand_AllTime_Node('All',n,'Conforming','value') $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ ovrd_Demand_AllTime_Node('All',n,'Conforming','value') / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +); + +); +* Overrides applied all the time end + + +* Overrides applied to a trading period +if (1=1, + +* Overrides applied to a trading period time for entire NZ +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','scale')] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','scale')] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','scale')] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','scale')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','scale')] + and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','scale')] + and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','scale')] + and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','scale')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','scale')] + and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','scale')] + and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','scale')] + and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','scale')] ; + + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','increment')] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','increment')] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','increment')] and (nodeParameter(ca,dt,n,'demand') > 0) } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','increment')] + positive_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','increment')] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','increment')] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','increment')] + and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','increment')] + positive_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','increment')] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','increment')] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','increment')] + and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','increment')] + positive_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','value')] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','value')] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','value')] and (nodeParameter(ca,dt,n,'demand') > 0) } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','All','value')] - negative_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','value')] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','value')] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','value')] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Nonconform','value')] - negative_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','value')] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','value')] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','value')] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_All(tp,'All','Conforming','value')] - negative_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + +) ; + + +* Overrides applied to a trading period time for island +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','scale')] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','scale')] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','scale')] and (nodeParameter(ca,dt,n,'demand') > 0) } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','scale')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','scale')] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','scale')] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','scale')] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','scale')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','scale')] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','scale')] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','scale')] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','scale')] ; + + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','increment')] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','increment')] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','increment')] and (nodeParameter(ca,dt,n,'demand') > 0) } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ( ovrd_Demand_Period_Island(tp,isl,'All','increment') + positive_IslandDemand(ca,dt,isl,'All') ) / positive_IslandDemand(ca,dt,isl,'All') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','increment')] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','increment')] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','increment')] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ( ovrd_Demand_Period_Island(tp,isl,'Nonconform','increment') + positive_IslandDemand(ca,dt,isl,'Nonconform') ) / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','increment')] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','increment')] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','increment')] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ( ovrd_Demand_Period_Island(tp,isl,'Conforming','increment') + positive_IslandDemand(ca,dt,isl,'Conforming') ) / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','value')] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','value')] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'All','value')] and (nodeParameter(ca,dt,n,'demand') > 0) } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, [ ovrd_Demand_Period_Island(tp,isl,'All','value') - negative_IslandDemand(ca,dt,isl,'All') ] / positive_IslandDemand(ca,dt,isl,'All') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','value')] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','value')] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Nonconform','value')] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, [ ovrd_Demand_Period_Island(tp,isl,'Nonconform','value') - negative_IslandDemand(ca,dt,isl,'Nonconform') ] / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','value')] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','value')] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, ovrd_Demand_Period_Island(tp,isl,'Conforming','value')] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = sum[ {case2dt2tp(ca,dt,tp),nodeIsland(ca,dt,n,isl)}, [ ovrd_Demand_Period_Island(tp,isl,'Conforming','value') - negative_IslandDemand(ca,dt,isl,'Conforming') ] / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + +) ; + + +* Overrides applied to a trading period time for node +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','scale')] } + = sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','scale')]; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','scale')] and nodeParameter(ca,dt,n,'loadIsNCL') } + = sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','scale')] ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','scale')] and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','scale')] ; + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','increment')] } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','increment') ] $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ sum[ case2dt2tp(ca,dt,tp),(ovrd_Demand_Period_Node(tp,n,'All','increment') + nodeParameter(ca,dt,n,'demand')) / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0)]; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','increment')] and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','increment') ] $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ sum[ case2dt2tp(ca,dt,tp),(ovrd_Demand_Period_Node(tp,n,'Nonconform','increment') + nodeParameter(ca,dt,n,'demand') ) / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0)] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','increment')] and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','increment') ] $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ sum[ case2dt2tp(ca,dt,tp),(ovrd_Demand_Period_Node(tp,n,'Conforming','increment') + nodeParameter(ca,dt,n,'demand') ) / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0)] ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','value')] } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','value') ] $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'All','value') / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0)]; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','value')] and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','value') ] $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Nonconform','value') / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0)] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','value')] and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','value') ] $ (nodeParameter(ca,dt,n,'demand') = 0) ] + + [ sum[ case2dt2tp(ca,dt,tp), ovrd_Demand_Period_Node(tp,n,'Conforming','value') / nodeParameter(ca,dt,n,'demand') ] $ (nodeParameter(ca,dt,n,'demand') <> 0)] ; + + +); + +); +* Overrides applied to a trading period end + + +* Overrides applied to a datetime +if (1=1, + +* Overrides applied to a datetime for entire NZ +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','scale') and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','scale') and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','scale') and (nodeParameter(ca,dt,n,'demand') > 0) + } = ovrd_Demand_DateTime_All(dt,'All','All','scale') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = ovrd_Demand_DateTime_All(dt,'All','Nonconform','scale') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = ovrd_Demand_DateTime_All(dt,'All','Conforming','scale') ; + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','increment') and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','increment') and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','increment') and (nodeParameter(ca,dt,n,'demand') > 0) + } = [ ovrd_Demand_DateTime_All(dt,'All','All','increment') + positive_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = [ ovrd_Demand_DateTime_All(dt,'All','Nonconform','increment') + positive_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = [ ovrd_Demand_DateTime_All(dt,'All','Conforming','increment') + positive_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','value') and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','value') and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','All','value') and (nodeParameter(ca,dt,n,'demand') > 0) + } = [ ovrd_Demand_DateTime_All(dt,'All','All','value') - negative_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = [ ovrd_Demand_DateTime_All(dt,'All','Nonconform','value') - negative_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_All(dt,'All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = [ ovrd_Demand_DateTime_All(dt,'All','Conforming','value') - negative_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + +) ; + + +* Overrides applied to a datatime for island +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','scale') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','scale') ] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','scale') ] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','scale') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','scale') ] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','scale') ] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','scale') ] ; + + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','increment') ] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','increment') ] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','increment') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_DateTime_Island(dt,isl,'All','increment') + positive_IslandDemand(ca,dt,isl,'All')) / positive_IslandDemand(ca,dt,isl,'All')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','increment') ] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','increment') ] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','increment') ] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','increment') + positive_IslandDemand(ca,dt,isl,'Nonconform')) / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','increment') ] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','increment') ] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','increment') ] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_DateTime_Island(dt,isl,'Conforming','increment') + positive_IslandDemand(ca,dt,isl,'Conforming')) / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','value') ] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','value') ] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'All','value') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_DateTime_Island(dt,isl,'All','value') - negative_IslandDemand(ca,dt,isl,'All')) / positive_IslandDemand(ca,dt,isl,'All')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','value') ] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','value') ] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','value') ] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_DateTime_Island(dt,isl,'Nonconform','value') - negative_IslandDemand(ca,dt,isl,'Nonconform')) / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','value') ] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','value') ] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_DateTime_Island(dt,isl,'Conforming','value') ] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_DateTime_Island(dt,isl,'Conforming','value') - negative_IslandDemand(ca,dt,isl,'Conforming')) / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; +) ; + + +* Overrides applied to a datetime for node +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'All','scale') } = ovrd_Demand_DateTime_Node(dt,n,'All','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'Nonconform','scale') and nodeParameter(ca,dt,n,'loadIsNCL') } = ovrd_Demand_DateTime_Node(dt,n,'Nonconform','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'Conforming','scale') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = ovrd_Demand_DateTime_Node(dt,n,'Conforming','scale') ; + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'All','increment') } + = [ ovrd_Demand_DateTime_Node(dt,n,'All','increment') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [(ovrd_Demand_DateTime_Node(dt,n,'All','increment') + nodeParameter(ca,dt,n,'demand'))/ nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'Nonconform','increment') and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ ovrd_Demand_DateTime_Node(dt,n,'Nonconform','increment') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [(ovrd_Demand_DateTime_Node(dt,n,'Nonconform','increment') + nodeParameter(ca,dt,n,'demand')) / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'Conforming','increment') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ ovrd_Demand_DateTime_Node(dt,n,'Conforming','increment') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [(ovrd_Demand_DateTime_Node(dt,n,'Conforming','increment') + nodeParameter(ca,dt,n,'demand')) / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'All','value') } + = [ovrd_Demand_DateTime_Node(dt,n,'All','value') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [ovrd_Demand_DateTime_Node(dt,n,'All','value') / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'Nonconform','value') and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ovrd_Demand_DateTime_Node(dt,n,'Nonconform','value') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [ovrd_Demand_DateTime_Node(dt,n,'Nonconform','value') / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_DateTime_Node(dt,n,'Conforming','value') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ovrd_Demand_DateTime_Node(dt,n,'Conforming','value') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [ovrd_Demand_DateTime_Node(dt,n,'Conforming','value') / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; +) ; + +); +* Overrides applied to a datetime end + + +* Overrides applied to a CaseID +if (1=1, + +* Overrides applied to a CaseID for entire NZ +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','scale') and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','scale') and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','scale') and (nodeParameter(ca,dt,n,'demand') > 0) + } = ovrd_Demand_CaseID_All(ca,'All','All','scale') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','scale') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = ovrd_Demand_CaseID_All(ca,'All','Nonconform','scale') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','scale') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = ovrd_Demand_CaseID_All(ca,'All','Conforming','scale') ; + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','increment') and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','increment') and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','increment') and (nodeParameter(ca,dt,n,'demand') > 0) + } = [ ovrd_Demand_CaseID_All(ca,'All','All','increment') + positive_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','increment') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = [ ovrd_Demand_CaseID_All(ca,'All','Nonconform','increment') + positive_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','increment') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = [ ovrd_Demand_CaseID_All(ca,'All','Conforming','increment') + positive_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','value') and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','value') and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','All','value') and (nodeParameter(ca,dt,n,'demand') > 0) + } = [ ovrd_Demand_CaseID_All(ca,'All','All','value') - negative_NZDemand(ca,dt,'All') ] / positive_NZDemand(ca,dt,'All') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Nonconform','value') and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = [ ovrd_Demand_CaseID_All(ca,'All','Nonconform','value') - negative_NZDemand(ca,dt,'Nonconform') ] / positive_NZDemand(ca,dt,'Nonconform') ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_All(ca,'All','Conforming','value') and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = [ ovrd_Demand_CaseID_All(ca,'All','Conforming','value') - negative_NZDemand(ca,dt,'Conforming') ] / positive_NZDemand(ca,dt,'Conforming') ; + + +) ; + + +* Overrides applied to a CaseID for island +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','scale') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','scale') ] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','scale') ] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','scale') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','scale') ] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','scale') ] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','scale') ] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','scale') ] ; + + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','increment') ] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','increment') ] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','increment') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_CaseID_Island(ca,isl,'All','increment') + positive_IslandDemand(ca,dt,isl,'All')) / positive_IslandDemand(ca,dt,isl,'All')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','increment') ] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','increment') ] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','increment') ] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','increment') + positive_IslandDemand(ca,dt,isl,'Nonconform')) / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','increment') ] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','increment') ] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','increment') ] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_CaseID_Island(ca,isl,'Conforming','increment') + positive_IslandDemand(ca,dt,isl,'Conforming')) / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','value') ] and (nodeParameter(ca,dt,n,'demand') = 0) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','value') ] and (nodeParameter(ca,dt,n,'demand') < 0) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'All','value') ] and (nodeParameter(ca,dt,n,'demand') > 0) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_CaseID_Island(ca,isl,'All','value') - negative_IslandDemand(ca,dt,isl,'All')) / positive_IslandDemand(ca,dt,isl,'All')] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','value') ] and (nodeParameter(ca,dt,n,'demand') = 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','value') ] and (nodeParameter(ca,dt,n,'demand') < 0) and nodeParameter(ca,dt,n,'loadIsNCL') } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','value') ] and (nodeParameter(ca,dt,n,'demand') > 0) and nodeParameter(ca,dt,n,'loadIsNCL') + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_CaseID_Island(ca,isl,'Nonconform','value') - negative_IslandDemand(ca,dt,isl,'Nonconform')) / positive_IslandDemand(ca,dt,isl,'Nonconform') ] ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','value') ] and (nodeParameter(ca,dt,n,'demand') = 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 0; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','value') ] and (nodeParameter(ca,dt,n,'demand') < 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = 1; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { sum[ isl $ nodeIsland(ca,dt,n,isl), ovrd_Demand_CaseID_Island(ca,isl,'Conforming','value') ] and (nodeParameter(ca,dt,n,'demand') > 0) and (not nodeParameter(ca,dt,n,'loadIsNCL')) + } = sum[ isl $ nodeIsland(ca,dt,n,isl), (ovrd_Demand_CaseID_Island(ca,isl,'Conforming','value') - negative_IslandDemand(ca,dt,isl,'Conforming')) / positive_IslandDemand(ca,dt,isl,'Conforming') ] ; + +) ; + + +* Overrides applied to a CaseID for node +if (1=1, + +* Calculate scaling factor for demand scale overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'All','scale') } = ovrd_Demand_CaseID_Node(ca,n,'All','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'Nonconform','scale') and nodeParameter(ca,dt,n,'loadIsNCL') } = ovrd_Demand_CaseID_Node(ca,n,'Nonconform','scale') ; +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'Conforming','scale') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } = ovrd_Demand_CaseID_Node(ca,n,'Conforming','scale') ; + +* Calculate scaling factor for demand increment overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'All','increment') } + = [ ovrd_Demand_CaseID_Node(ca,n,'All','increment') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [(ovrd_Demand_CaseID_Node(ca,n,'All','increment') + nodeParameter(ca,dt,n,'demand'))/ nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'Nonconform','increment') and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ ovrd_Demand_CaseID_Node(ca,n,'Nonconform','increment') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [(ovrd_Demand_CaseID_Node(ca,n,'Nonconform','increment') + nodeParameter(ca,dt,n,'demand')) / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'Conforming','increment') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ ovrd_Demand_CaseID_Node(ca,n,'Conforming','increment') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [(ovrd_Demand_CaseID_Node(ca,n,'Conforming','increment') + nodeParameter(ca,dt,n,'demand')) / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + + +* Calculate scaling factor for demand value overrides +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'All','value') } + = [ovrd_Demand_CaseID_Node(ca,n,'All','value') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [ovrd_Demand_CaseID_Node(ca,n,'All','value') / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'Nonconform','value') and nodeParameter(ca,dt,n,'loadIsNCL') } + = [ovrd_Demand_CaseID_Node(ca,n,'Nonconform','value') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [ovrd_Demand_CaseID_Node(ca,n,'Nonconform','value') / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; + +temp_NodeDemandScale(case2dt(ca,dt),n) $ { ovrd_Demand_CaseID_Node(ca,n,'Conforming','value') and (not nodeParameter(ca,dt,n,'loadIsNCL')) } + = [ovrd_Demand_CaseID_Node(ca,n,'Conforming','value') $ (nodeParameter(ca,dt,n,'demand') = 0)] + + [ovrd_Demand_CaseID_Node(ca,n,'Conforming','value') / nodeParameter(ca,dt,n,'demand')] $ (nodeParameter(ca,dt,n,'demand') <> 0) ; +) ; - ovrd_tradePeriodIslandDemand(tp,isl,demMethod) 'Override the i_tradePeriodNodeDemand parameter with island-based data' - ovrd_dateTimeIslandDemand(dt,isl,demMethod) 'Override the i_tradePeriodNodeDemand parameter with dateTime and island-based data' +); +* Overrides applied to a CaseID end - temp_TradePeriodNodeDemand(tp,n) 'Temporary container for node demand value while implementing the node-based scaling factor' - temp_TradePeriodIslandDemand(tp,isl) 'Temporary container for island positive demand value while implementing the island-based scaling factor' - used_TradePeriodIslandScale(tp,isl) 'Final value used for island-based scaling' + +nodeParameter(case2dt(ca,dt),n,'demand') $ { (temp_NodeDemandScale(ca,dt,n) <> 0) and (temp_NodeDemandScale(ca,dt,n) <> 1) } + = temp_NodeDemandScale(ca,dt,n) * nodeParameter(ca,dt,n,'demand') $ nodeParameter(ca,dt,n,'demand') + + temp_NodeDemandScale(ca,dt,n) $ {nodeParameter(ca,dt,n,'demand') = 0} ; + +nodeParameter(case2dt(ca,dt),n,'demand') $ { nodeParameter(ca,dt,n,'demand') = EPS } = 0 ; + +*========================================================================================================================= +* Demand overrides end +*========================================================================================================================= + + + +*========================================================================================================================= +* 2. Offer parameter overrides +*========================================================================================================================= + +Parameters + ovrd_OfferParameter_Alltime(alll,o,offerPar) 'Override for energy offer parameters applied all the time' + ovrd_OfferParameter_Period(tp,o,offerPar) 'Override for energy offer parameters applied to a trading period' + ovrd_OfferParameter_DateTime(dt,o,offerPar) 'Override for energy offer parameters applied to an interval' + ovrd_OfferParameter_CaseID(ca,o,offerPar) 'Override for energy offer parameters applied to a caseID' +; + +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_OfferParameter_Alltime = offer_parameter_overrides +$load ovrd_OfferParameter_Period = offer_parameter_overrides +$load ovrd_OfferParameter_DateTime = offer_parameter_overrides +$load ovrd_OfferParameter_CaseID = offer_parameter_overrides +$gdxin +$offEps + + +offerParameter(case2dt(ca,dt),o,offerPar) $ ovrd_OfferParameter_Alltime('All',o,offerPar) = ovrd_OfferParameter_Alltime('All',o,offerPar) ; + +offerParameter(case2dt(ca,dt),o,offerPar) $ sum[ case2dt2tp(ca,dt,tp), ovrd_OfferParameter_Period(tp,o,offerPar)] = sum[ case2dt2tp(ca,dt,tp), ovrd_OfferParameter_Period(tp,o,offerPar)] ; + +offerParameter(case2dt(ca,dt),o,offerPar) $ ovrd_OfferParameter_DateTime(dt,o,offerPar) = ovrd_OfferParameter_DateTime(dt,o,offerPar) ; + +offerParameter(case2dt(ca,dt),o,offerPar) $ ovrd_OfferParameter_CaseID(ca,o,offerPar) = ovrd_OfferParameter_CaseID(ca,o,offerPar) ; + +offerParameter(case2dt(ca,dt),o,offerPar) $ { offerParameter(ca,dt,o,offerPar) = EPS } = 0 ; + +*========================================================================================================================= +* Offer parameter overrides end +*========================================================================================================================= + + + +*========================================================================================================================= +* 3. Offer energy overrides +*========================================================================================================================= +Parameters + ovrd_EnergyOffer_Alltime(alll,o,bidofrCmpnt,blk) 'Override for energy offer prices and limits applied all the time' + ovrd_EnergyOffer_Period(tp,o,bidofrCmpnt,blk) 'Override for energy offer prices and limits applied to a trading period' + ovrd_EnergyOffer_DateTime(dt,o,bidofrCmpnt,blk) 'Override for energy offer prices and limits applied to an interval' + ovrd_EnergyOffer_CaseID(ca,o,bidofrCmpnt,blk) 'Override for energy offer prices and limits applied to a caseID' +; + +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_EnergyOffer_Alltime = energy_offer_overrides +$load ovrd_EnergyOffer_Period = energy_offer_overrides +$load ovrd_EnergyOffer_DateTime = energy_offer_overrides +$load ovrd_EnergyOffer_CaseID = energy_offer_overrides +$gdxin +$offEps + +energyOffer(case2dt(ca,dt),o,blk,bidofrCmpnt) $ ovrd_EnergyOffer_Alltime('All',o,bidofrCmpnt,blk) = ovrd_EnergyOffer_Alltime('All',o,bidofrCmpnt,blk) ; + +energyOffer(case2dt(ca,dt),o,blk,bidofrCmpnt) $ sum[case2dt2tp(ca,dt,tp), ovrd_EnergyOffer_Period(tp,o,bidofrCmpnt,blk)] = sum[case2dt2tp(ca,dt,tp), ovrd_EnergyOffer_Period(tp,o,bidofrCmpnt,blk)] ; + +energyOffer(case2dt(ca,dt),o,blk,bidofrCmpnt) $ ovrd_EnergyOffer_DateTime(dt,o,bidofrCmpnt,blk) = ovrd_EnergyOffer_DateTime(dt,o,bidofrCmpnt,blk) ; + +energyOffer(case2dt(ca,dt),o,blk,bidofrCmpnt) $ ovrd_EnergyOffer_CaseID(ca,o,bidofrCmpnt,blk) = ovrd_EnergyOffer_CaseID(ca,o,bidofrCmpnt,blk) ; + +energyOffer(case2dt(ca,dt),o,blk,bidofrCmpnt) $ { energyOffer(ca,dt,o,blk,bidofrCmpnt) = EPS } = 0 ; + +*========================================================================================================================= +* Offer energy overrides end +*========================================================================================================================= + + + + +*========================================================================================================================= +* 4. Offer reserve overrides +*========================================================================================================================= +Parameters + ovrd_ReserveOffer_Alltime(alll,o,resC,resT,bidofrCmpnt,blk) 'Override for reserve offer prices and limits applied all the time' + ovrd_ReserveOffer_Period(tp,o,resC,resT,bidofrCmpnt,blk) 'Override for reserve offer prices and limits applied to a trading period' + ovrd_ReserveOffer_DateTime(dt,o,resC,resT,bidofrCmpnt,blk) 'Override for reserve offer prices and limits applied to an interval' + ovrd_ReserveOffer_CaseID(ca,o,resC,resT,bidofrCmpnt,blk) 'Override for reserve offer prices and limits applied to a caseID' ; +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_ReserveOffer_Alltime = reserve_offer_overrides +$load ovrd_ReserveOffer_Period = reserve_offer_overrides +$load ovrd_ReserveOffer_DateTime = reserve_offer_overrides +$load ovrd_ReserveOffer_CaseID = reserve_offer_overrides +$gdxin +$offEps + + +reserveOffer(case2dt(ca,dt),o,resC,resT,blk,bidofrCmpnt) $ ovrd_ReserveOffer_Alltime('All',o,resC,resT,bidofrCmpnt,blk) = ovrd_ReserveOffer_Alltime('All',o,resC,resT,bidofrCmpnt,blk); + +reserveOffer(case2dt(ca,dt),o,resC,resT,blk,bidofrCmpnt) $ sum[case2dt2tp(ca,dt,tp), ovrd_ReserveOffer_Period(tp,o,resC,resT,bidofrCmpnt,blk)] = sum[case2dt2tp(ca,dt,tp), ovrd_ReserveOffer_Period(tp,o,resC,resT,bidofrCmpnt,blk)]; + +reserveOffer(case2dt(ca,dt),o,resC,resT,blk,bidofrCmpnt) $ ovrd_ReserveOffer_DateTime(dt,o,resC,resT,bidofrCmpnt,blk) = ovrd_ReserveOffer_DateTime(dt,o,resC,resT,bidofrCmpnt,blk); + +reserveOffer(case2dt(ca,dt),o,resC,resT,blk,bidofrCmpnt) $ ovrd_ReserveOffer_CaseID(ca,o,resC,resT,bidofrCmpnt,blk) = ovrd_ReserveOffer_CaseID(ca,o,resC,resT,bidofrCmpnt,blk); + +reserveOffer(case2dt(ca,dt),o,resC,resT,blk,bidofrCmpnt) $ { reserveOffer(ca,dt,o,resC,resT,blk,bidofrCmpnt) = EPS } = 0 ; +*========================================================================================================================= +* Offer reserve overrides end +*========================================================================================================================= + + + +*========================================================================================================================= +* 5. Bid parameter overrides +*========================================================================================================================= + +Parameters + ovrd_BidParameter_Alltime(alll,bd,bidPar) 'Override for demand bid parameters applied all the time' + ovrd_BidParameter_Period(tp,bd,bidPar) 'Override for demand bid parameters applied to a trading period' + ovrd_BidParameter_DateTime(dt,bd,bidPar) 'Override for demand bid parameters applied to an interval' + ovrd_BidParameter_CaseID(ca,bd,bidPar) 'Override for demand bid parameters applied to a caseID' +; + +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_BidParameter_Alltime = bid_parameter_overrides +$load ovrd_BidParameter_Period = bid_parameter_overrides +$load ovrd_BidParameter_DateTime = bid_parameter_overrides +$load ovrd_BidParameter_CaseID = bid_parameter_overrides +$gdxin +$offEps + + +bidParameter(case2dt(ca,dt),bd,bidPar) $ ovrd_BidParameter_Alltime('All',bd,bidPar) = ovrd_BidParameter_Alltime('All',bd,bidPar) ; + +bidParameter(case2dt(ca,dt),bd,bidPar) $ sum[ case2dt2tp(ca,dt,tp), ovrd_BidParameter_Period(tp,bd,bidPar)] = sum[ case2dt2tp(ca,dt,tp), ovrd_BidParameter_Period(tp,bd,bidPar)] ; + +bidParameter(case2dt(ca,dt),bd,bidPar) $ ovrd_BidParameter_DateTime(dt,bd,bidPar) = ovrd_BidParameter_DateTime(dt,bd,bidPar) ; + +bidParameter(case2dt(ca,dt),bd,bidPar) $ ovrd_BidParameter_CaseID(ca,bd,bidPar) = ovrd_BidParameter_CaseID(ca,bd,bidPar) ; + +bidParameter(case2dt(ca,dt),bd,bidPar) $ { bidParameter(ca,dt,bd,bidPar) = EPS } = 0 ; + +*========================================================================================================================= +* Bid parameter overrides end +*========================================================================================================================= + + -* The parameters below added to fix the bug in vSPD online overrides -Set ovrdtypo 'wrong enrgy offer price in vSPD online' /'i_GenerationOfferPrice'/; +*========================================================================================================================= +* 6. Demand Bid overrides +*========================================================================================================================= Parameters - ovrd_tradePeriodEnergyOfferX(tp,o,blk,ovrdtypo) 'Override for energy offers for specified trade period' - ovrd_dateTimeEnergyOfferX(dt,o,blk,ovrdtypo) 'Override for energy offers for specified datetime' + ovrd_DemandBid_Alltime(alll,bd,bidofrCmpnt,blk) 'Override for demand bid prices and limits applied all the time' + ovrd_DemandBid_Period(tp,bd,bidofrCmpnt,blk) 'Override for demand bid prices and limits applied to a trading period' + ovrd_DemandBid_DateTime(dt,bd,bidofrCmpnt,blk) 'Override for demand bid prices and limits applied to an interval' + ovrd_DemandBid_CaseID(ca,bd,bidofrCmpnt,blk) 'Override for demand bid prices and limits applied to a caseID' ; -* The parameters above added to fix the bug in vSPD online overrides + +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_DemandBid_Alltime = energy_bid_overrides +$load ovrd_DemandBid_Period = energy_bid_overrides +$load ovrd_DemandBid_DateTime = energy_bid_overrides +$load ovrd_DemandBid_CaseID = energy_bid_overrides +$gdxin +$offEps + +energyBid(case2dt(ca,dt),bd,blk,bidofrCmpnt) $ ovrd_DemandBid_Alltime('All',bd,bidofrCmpnt,blk) = ovrd_DemandBid_Alltime('All',bd,bidofrCmpnt,blk) ; + +energyBid(case2dt(ca,dt),bd,blk,bidofrCmpnt) $ sum[case2dt2tp(ca,dt,tp), ovrd_DemandBid_Period(tp,bd,bidofrCmpnt,blk)] = sum[case2dt2tp(ca,dt,tp), ovrd_DemandBid_Period(tp,bd,bidofrCmpnt,blk)] ; + +energyBid(case2dt(ca,dt),bd,blk,bidofrCmpnt) $ ovrd_DemandBid_DateTime(dt,bd,bidofrCmpnt,blk) = ovrd_DemandBid_DateTime(dt,bd,bidofrCmpnt,blk) ; + +energyBid(case2dt(ca,dt),bd,blk,bidofrCmpnt) $ ovrd_DemandBid_CaseID(ca,bd,bidofrCmpnt,blk) = ovrd_DemandBid_CaseID(ca,bd,bidofrCmpnt,blk) ; + +energyBid(case2dt(ca,dt),bd,blk,bidofrCmpnt) $ { energyBid(ca,dt,bd,blk,bidofrCmpnt) = EPS } = 0 ; + +*========================================================================================================================= +* Demand Bid overrides end +*========================================================================================================================= + +*========================================================================================================================= +* 7. Branch parameter overrides +*========================================================================================================================= + Parameters -* Offers - incl. energy, PLSR, TWDR, and ILR - ovrd_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) 'Override for energy offers for specified trade period' - ovrd_dateTimeEnergyOffer(dt,o,blk,bidofrCmpnt) 'Override for energy offers for specified datetime' + ovrd_BranchParameter_Alltime(alll,br,brPar) 'Override for branch parameters applied all the time' + ovrd_BranchParameter_Period(tp,br,brPar) 'Override for branch parameters applied to a trading period' + ovrd_BranchParameter_DateTime(dt,br,brPar) 'Override for branch parameters applied to an interval' + ovrd_BranchParameter_CaseID(ca,br,brPar) 'Override for branch parameters applied to a caseID' +; - ovrd_tradePeriodOfferParameter(tp,o,offerPar) 'Override for energy offer parameters for specified trade period' - ovrd_dateTimeOfferParameter(dt,o,offerPar) 'Override for energy offer parameters for specified datetime' +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_BranchParameter_Alltime = branch_parameter_overrides +$load ovrd_BranchParameter_Period = branch_parameter_overrides +$load ovrd_BranchParameter_DateTime = branch_parameter_overrides +$load ovrd_BranchParameter_CaseID = branch_parameter_overrides +$gdxin +$offEps - ovrd_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) 'Override for reserve offers for specified trading periods' - ovrd_dateTimeSustainedPLSRoffer(dt,o,blk,bidofrCmpnt) 'Override for reserve offers for specified datetime' - ovrd_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) 'Override for reserve offers for specified trading periods' - ovrd_dateTimeFastPLSRoffer(dt,o,blk,bidofrCmpnt) 'Override for reserve offers for specified datetime' +branchParameter(case2dt(ca,dt),br,brPar) $ ovrd_BranchParameter_Alltime('All',br,brPar) = ovrd_BranchParameter_Alltime('All',br,brPar) ; - ovrd_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) 'Override for reserve offers for specified trading periods' - ovrd_dateTimeSustainedTWDRoffer(dt,o,blk,bidofrCmpnt) 'Override for reserve offers for specified datetime' +branchParameter(case2dt(ca,dt),br,brPar) $ sum[ case2dt2tp(ca,dt,tp), ovrd_BranchParameter_Period(tp,br,brPar)] = sum[ case2dt2tp(ca,dt,tp), ovrd_BranchParameter_Period(tp,br,brPar)] ; - ovrd_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) 'Override for reserve offers for specified trading periods' - ovrd_dateTimeFastTWDRoffer(dt,o,blk,bidofrCmpnt) 'Override for reserve offers for specified datetime' +branchParameter(case2dt(ca,dt),br,brPar) $ ovrd_BranchParameter_DateTime(dt,br,brPar) = ovrd_BranchParameter_DateTime(dt,br,brPar) ; - ovrd_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) 'Override for reserve offers for specified trading periods' - ovrd_dateTimeSustainedILRoffer(dt,o,blk,bidofrCmpnt) 'Override for reserve offers for specified datetime' +branchParameter(case2dt(ca,dt),br,brPar) $ ovrd_BranchParameter_CaseID(ca,br,brPar) = ovrd_BranchParameter_CaseID(ca,br,brPar) ; - ovrd_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) 'Override for reserve offers for specified trading periods' - ovrd_dateTimeFastILRoffer(dt,o,blk,bidofrCmpnt) 'Override for reserve offers for specified datetime' +branchParameter(case2dt(ca,dt),br,brPar) $ { branchParameter(ca,dt,br,brPar) = EPS } = 0 ; + +*========================================================================================================================= +* Branch parameter overrides end +*========================================================================================================================= - ovrd_tradePeriodReserveClassGenerationMaximum(tp,o,resC) 'Override for MW used to determine factor to adjust maximum reserve of a reserve class' - ovrd_dateTimeReserveClassGenerationMaximum(dt,o,resC) 'Override for MW used to determine factor to adjust maximum reserve of a reserve class' -* Bid data - ovrd_tradePeriodEnergyBid(tp,i_bid,blk,bidofrCmpnt) 'Override for energy bids for specified trading periods' - ovrd_dateTimeEnergyBid(dt,i_bid,blk,bidofrCmpnt) 'Override for energy bids for specified datetime' - ovrd_tradePeriodDispatchableBid(tp,i_bid) 'Override for energy bids for specified trading periods' - ovrd_datetimeDispatchableBid(dt,i_bid) 'Override for energy bids for specified datetime' +*========================================================================================================================= +* 8. Branch constraint RHS overrides +*========================================================================================================================= + +Parameters + ovrd_BranchCnstrRHS_Alltime(alll,brCstr,CstrRHS) 'Override for branch constraint RHS applied all the time' + ovrd_BranchCnstrRHS_Period(tp,brCstr,CstrRHS) 'Override for branch constraint RHS applied to a trading period' + ovrd_BranchCnstrRHS_DateTime(dt,brCstr,CstrRHS) 'Override for branch constraint RHS applied to an interval' + ovrd_BranchCnstrRHS_CaseID(ca,brCstr,CstrRHS) 'Override for branch constraint RHS applied to a caseID' ; +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_BranchCnstrRHS_Alltime = branch_constraint_overrides +$load ovrd_BranchCnstrRHS_Period = branch_constraint_overrides +$load ovrd_BranchCnstrRHS_DateTime = branch_constraint_overrides +$load ovrd_BranchCnstrRHS_CaseID = branch_constraint_overrides +$gdxin +$offEps + +branchCstrRHS(case2dt(ca,dt),brCstr,CstrRHS) $ ovrd_BranchCnstrRHS_Alltime('All',brCstr,CstrRHS) = ovrd_BranchCnstrRHS_Alltime('All',brCstr,CstrRHS) ; +branchCstrRHS(case2dt(ca,dt),brCstr,CstrRHS) $ sum[ case2dt2tp(ca,dt,tp), ovrd_BranchCnstrRHS_Period(tp,brCstr,CstrRHS)] = sum[ case2dt2tp(ca,dt,tp), ovrd_BranchCnstrRHS_Period(tp,brCstr,CstrRHS)] ; + +branchCstrRHS(case2dt(ca,dt),brCstr,CstrRHS) $ ovrd_BranchCnstrRHS_DateTime(dt,brCstr,CstrRHS) = ovrd_BranchCnstrRHS_DateTime(dt,brCstr,CstrRHS) ; + +branchCstrRHS(case2dt(ca,dt),brCstr,CstrRHS) $ ovrd_BranchCnstrRHS_CaseID(ca,brCstr,CstrRHS) = ovrd_BranchCnstrRHS_CaseID(ca,brCstr,CstrRHS) ; + +branchCstrRHS(case2dt(ca,dt),brCstr,CstrRHS) $ { branchCstrRHS(ca,dt,brCstr,CstrRHS) = EPS } = 0 ; + +*========================================================================================================================= +* Branch constraint RHS overrides end *========================================================================================================================= -* 2. Demand overrides + + + +*========================================================================================================================= +* 9. Branch constraint factors overrides *========================================================================================================================= -* Note that demMethod is declared in vSPDsolve.gms. Elements include scale, increment, and value where: -* - scaling is applied first, -* - increments are applied second and take precedence over scaling, and -* - values are applied last and take precedence over increments. +Parameters + ovrd_BranchCnstrFactor_Alltime(alll,brCstr,br) 'Override for branch constraint factor applied all the time' + ovrd_BranchCnstrFactor_Period(tp,brCstr,br) 'Override for branch constraint factor applied to a trading period' + ovrd_BranchCnstrFactor_DateTime(dt,brCstr,br) 'Override for branch constraint factor applied to an interval' + ovrd_BranchCnstrFactor_CaseID(ca,brCstr,br) 'Override for branch constraint factor applied to a caseID' +; *Loading data from gdx file +$onEps $gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" -$load ovrd_tradePeriodNodeDemand = demandOverrides -$load ovrd_tradePeriodIslandDemand = demandOverrides -$load ovrd_dateTimeNodeDemand = demandOverrides -$load ovrd_dateTimeIslandDemand = demandOverrides +$load ovrd_BranchCnstrFactor_Alltime = branch_cnstr_factor_overrides +$load ovrd_BranchCnstrFactor_Period = branch_cnstr_factor_overrides +$load ovrd_BranchCnstrFactor_DateTime = branch_cnstr_factor_overrides +$load ovrd_BranchCnstrFactor_CaseID = branch_cnstr_factor_overrides $gdxin +$offEps + + +branchCstrFactors(case2dt(ca,dt),brCstr,br) $ ovrd_BranchCnstrFactor_Alltime('All',brCstr,br) = ovrd_BranchCnstrFactor_Alltime('All',brCstr,br) ; + +branchCstrFactors(case2dt(ca,dt),brCstr,br) $ sum[ case2dt2tp(ca,dt,tp), ovrd_BranchCnstrFactor_Period(tp,brCstr,br)] = sum[ case2dt2tp(ca,dt,tp), ovrd_BranchCnstrFactor_Period(tp,brCstr,br)] ; + +branchCstrFactors(case2dt(ca,dt),brCstr,br) $ ovrd_BranchCnstrFactor_DateTime(dt,brCstr,br) = ovrd_BranchCnstrFactor_DateTime(dt,brCstr,br) ; + +branchCstrFactors(case2dt(ca,dt),brCstr,br) $ ovrd_BranchCnstrFactor_CaseID(ca,brCstr,br) = ovrd_BranchCnstrFactor_CaseID(ca,brCstr,br) ; + +branchCstrFactors(case2dt(ca,dt),brCstr,br) $ { branchCstrFactors(ca,dt,brCstr,br) = EPS } = 0 ; + +*========================================================================================================================= +* Branch constraint factors overrides end +*========================================================================================================================= + -*overwrite period demand override by datetime demand override if datetime demand override exists (>0) -Loop i_dateTimeTradePeriodMap(dt,tp) do - ovrd_tradePeriodNodeDemand(tp,n,demMethod) - $ ovrd_dateTimeNodeDemand(dt,n,demMethod) - = ovrd_dateTimeNodeDemand(dt,n,demMethod); - - ovrd_tradePeriodIslandDemand(tp,isl,demMethod) - $ ovrd_dateTimeIslandDemand(dt,isl,demMethod) - = ovrd_dateTimeIslandDemand(dt,isl,demMethod); -EndLoop; - - -* Store current node and island demand into temporary parameters -temp_TradePeriodNodeDemand(tp,n) = 0 ; -temp_TradePeriodIslandDemand(tp,isl) = 0; - -temp_TradePeriodNodeDemand(tp,n) = i_tradePeriodNodeDemand(tp,n) ; -temp_TradePeriodIslandDemand(tp,isl) - = Sum[ (n,b) $ { i_tradePeriodNodeBus(tp,n,b) and - i_tradePeriodBusIsland(tp,b,isl) and - (temp_TradePeriodNodeDemand(tp,n) > 0) and - (Sum[ bd $ { sameas(n,bd) and - i_tradePeriodDispatchableBid(tp,bd) - }, 1 ] = 0) - } - , temp_TradePeriodNodeDemand(tp,n) - * i_tradePeriodNodeBusAllocationFactor(tp,n,b) - ] ; - -used_TradePeriodIslandScale(tp,isl) = 1; - -* Apply island scaling factor to an island if scaling factor exist -used_TradePeriodIslandScale(tp,isl) - $ ovrd_tradePeriodIslandDemand(tp,isl,'scale') - = ovrd_tradePeriodIslandDemand(tp,isl,'scale') ; - -* Apply island scaling factor to an island if scaling factor = eps (i.e. zero) -used_TradePeriodIslandScale(tp,isl) - $ { ovrd_tradePeriodIslandDemand(tp,isl,'scale') - and (ovrd_tradePeriodIslandDemand(tp,isl,'scale') = eps) } - = 0 ; - -* Apply island increments to an island if increments exist -used_TradePeriodIslandScale(tp,isl) - $ ovrd_tradePeriodIslandDemand(tp,isl,'increment') - = 1 + [ ovrd_tradePeriodIslandDemand(tp,isl,'increment') - / temp_TradePeriodIslandDemand(tp,isl) ] ; - -* Apply island values to an island if values exist -used_TradePeriodIslandScale(tp,isl) - $ ovrd_tradePeriodIslandDemand(tp,isl,'value') - = ovrd_tradePeriodIslandDemand(tp,isl,'value') - / temp_TradePeriodIslandDemand(tp,isl) ; - -* Apply island values to an island if value = eps (i.e. zero) -used_TradePeriodIslandScale(tp,isl) - $ { ovrd_tradePeriodIslandDemand(tp,isl,'value') - and (ovrd_tradePeriodIslandDemand(tp,isl,'value') = eps) } - = 0 ; - -* Allocate island demand override value to node demand -i_tradePeriodNodeDemand(tp,n) $ (temp_TradePeriodNodeDemand(tp,n) > 0) - = Sum[ (b,isl) $ { i_tradePeriodNodeBus(tp,n,b) and - i_tradePeriodBusIsland(tp,b,isl) - } , used_TradePeriodIslandScale(tp,isl) - * i_tradePeriodNodeBusAllocationFactor(tp,n,b) - * temp_TradePeriodNodeDemand(tp,n) - ] ; - -* Node demand overrides --> overwriten island override as node level -i_tradePeriodNodeDemand(tp,n) $ ovrd_tradePeriodNodeDemand(tp,n,'scale') - = temp_TradePeriodNodeDemand(tp,n) - * ovrd_tradePeriodNodeDemand(tp,n,'scale') ; - -i_tradePeriodNodeDemand(tp,n) - $ { ovrd_tradePeriodNodeDemand(tp,n,'scale') - and (ovrd_tradePeriodNodeDemand(tp,n,'scale') = eps) } - = 0; - -i_tradePeriodNodeDemand(tp,n) $ ovrd_tradePeriodNodeDemand(tp,n,'increment') - = temp_TradePeriodNodeDemand(tp,n) - + ovrd_tradePeriodNodeDemand(tp,n,'increment'); - -i_tradePeriodNodeDemand(tp,n) $ ovrd_tradePeriodNodeDemand(tp,n,'value') - = ovrd_tradePeriodNodeDemand(tp,n,'value') ; - -i_tradePeriodNodeDemand(tp,n) - $ { ovrd_tradePeriodNodeDemand(tp,n,'value') - and (ovrd_tradePeriodNodeDemand(tp,n,'value') = eps) } - = 0; - - - -*========================================================================================================================= -* 3. Bid and Offer overrides - incl. bid, energy, PLSR, TWDR, and ILR *========================================================================================================================= +* 10. Market node constraint RHS overrides +*========================================================================================================================= + +Parameters + ovrd_MnodeCnstrRHS_Alltime(alll,MnodeCstr,CstrRHS) 'Override for market node constraint RHS applied all the time' + ovrd_MnodeCnstrRHS_Period(tp,MnodeCstr,CstrRHS) 'Override for market node constraint RHS applied to a trading period' + ovrd_MnodeCnstrRHS_DateTime(dt,MnodeCstr,CstrRHS) 'Override for market node constraint RHS applied to an interval' + ovrd_MnodeCnstrRHS_CaseID(ca,MnodeCstr,CstrRHS) 'Override for market node constraint RHS applied to a caseID' +; + *Loading data from gdx file +$onEps $gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_MnodeCnstrRHS_Alltime = marketnode_constraint_overrides +$load ovrd_MnodeCnstrRHS_Period = marketnode_constraint_overrides +$load ovrd_MnodeCnstrRHS_DateTime = marketnode_constraint_overrides +$load ovrd_MnodeCnstrRHS_CaseID = marketnode_constraint_overrides +$gdxin +$offEps -$load ovrd_tradePeriodEnergyOfferX = energyOfferOverrides -$load ovrd_dateTimeEnergyOfferX = energyOfferOverrides -$load ovrd_tradePeriodEnergyOffer = energyOfferOverrides -$load ovrd_dateTimeEnergyOffer = energyOfferOverrides +mnCnstrRHS(case2dt(ca,dt),MnodeCstr,CstrRHS) $ ovrd_MnodeCnstrRHS_Alltime('All',MnodeCstr,CstrRHS) = ovrd_MnodeCnstrRHS_Alltime('All',MnodeCstr,CstrRHS) ; -$load ovrd_tradePeriodOfferParameter = offerParameterOverrides -$load ovrd_dateTimeOfferParameter = offerParameterOverrides -$load ovrd_tradePeriodReserveClassGenerationMaximum = offerParameterOverrides -$load ovrd_dateTimeReserveClassGenerationMaximum = offerParameterOverrides +mnCnstrRHS(case2dt(ca,dt),MnodeCstr,CstrRHS) $ sum[ case2dt2tp(ca,dt,tp), ovrd_MnodeCnstrRHS_Period(tp,MnodeCstr,CstrRHS)] = sum[ case2dt2tp(ca,dt,tp), ovrd_MnodeCnstrRHS_Period(tp,MnodeCstr,CstrRHS)] ; -$load ovrd_tradePeriodFastILRoffer = fastILROfferOverrides -$load ovrd_dateTimeFastILRoffer = fastILROfferOverrides -$load ovrd_tradePeriodSustainedILRoffer = sustainedILROfferOverrides -$load ovrd_dateTimeSustainedILRoffer = sustainedILROfferOverrides +mnCnstrRHS(case2dt(ca,dt),MnodeCstr,CstrRHS) $ ovrd_MnodeCnstrRHS_DateTime(dt,MnodeCstr,CstrRHS) = ovrd_MnodeCnstrRHS_DateTime(dt,MnodeCstr,CstrRHS) ; -$load ovrd_tradePeriodFastPLSRoffer = fastPLSROfferOverrides -$load ovrd_dateTimeFastPLSRoffer = fastPLSROfferOverrides -$load ovrd_tradePeriodSustainedPLSRoffer = sustainedPLSROfferOverrides -$load ovrd_dateTimeSustainedPLSRoffer = sustainedPLSROfferOverrides +mnCnstrRHS(case2dt(ca,dt),MnodeCstr,CstrRHS) $ ovrd_MnodeCnstrRHS_CaseID(ca,MnodeCstr,CstrRHS) = ovrd_MnodeCnstrRHS_CaseID(ca,MnodeCstr,CstrRHS) ; -$load ovrd_tradePeriodFastTWDRoffer = fastTWDROfferOverrides -$load ovrd_dateTimeFastTWDRoffer = fastTWDROfferOverrides -$load ovrd_tradePeriodSustainedTWDRoffer = sustainedTWDROfferOverrides -$load ovrd_dateTimeSustainedTWDRoffer = sustainedTWDROfferOverrides +mnCnstrRHS(case2dt(ca,dt),MnodeCstr,CstrRHS) $ { mnCnstrRHS(ca,dt,MnodeCstr,CstrRHS) = EPS } = 0 ; + +*========================================================================================================================= +* Market node constraint RHS overrides end +*========================================================================================================================= -$load ovrd_tradePeriodEnergyBid = energyBidOverrides -$load ovrd_dateTimeEnergyBid = energyBidOverrides -$load ovrd_tradePeriodDispatchableBid = dispatchableEnergyBidOverrides -$load ovrd_datetimeDispatchableBid = dispatchableEnergyBidOverrides + +*========================================================================================================================= +* 11. Market node constraint factor overrides +*========================================================================================================================= +Sets + resCx / set.resC, "NA" / + resTx / set.resT, "NA" / +; + +Parameters + ovrd_MnodeCnstrfactor_Alltime(alll,MnodeCstr,o,resCx,resTx) 'Override for market node constraint factor applied all the time' + ovrd_MnodeCnstrfactor_Period(tp,MnodeCstr,o,resCx,resTx) 'Override for market node constraint factor applied to a trading period' + ovrd_MnodeCnstrfactor_DateTime(dt,MnodeCstr,o,resCx,resTx) 'Override for market node constraint factor applied to an interval' + ovrd_MnodeCnstrfactor_CaseID(ca,MnodeCstr,o,resCx,resTx) 'Override for market node constraint factor applied to a caseID' +; + +*Loading data from gdx file +$onEps +$gdxin "%ovrdPath%%vSPDinputOvrdData%.gdx" +$load ovrd_MnodeCnstrfactor_Alltime = marketnode_cnstr_factor_overrides +$load ovrd_MnodeCnstrfactor_Period = marketnode_cnstr_factor_overrides +$load ovrd_MnodeCnstrfactor_DateTime = marketnode_cnstr_factor_overrides +$load ovrd_MnodeCnstrfactor_CaseID = marketnode_cnstr_factor_overrides $gdxin +$offEps + + +mnCstrEnrgFactors(case2dt(ca,dt),MnodeCstr,o) $ ovrd_MnodeCnstrfactor_Alltime('All',MnodeCstr,o,"NA","NA") = ovrd_MnodeCnstrfactor_Alltime('All',MnodeCstr,o,"NA","NA") ; + +mnCstrEnrgFactors(case2dt(ca,dt),MnodeCstr,o) $ sum[ case2dt2tp(ca,dt,tp), ovrd_MnodeCnstrfactor_Period(tp,MnodeCstr,o,"NA","NA")] = sum[ case2dt2tp(ca,dt,tp), ovrd_MnodeCnstrfactor_Period(tp,MnodeCstr,o,"NA","NA")] ; -* The parameters below added to fix the bug in vSPD online overrides -ovrd_tradePeriodEnergyOffer(tp,o,blk,'i_generationMWofferPrice') - $ ovrd_tradePeriodEnergyOfferX(tp,o,blk,'i_generationofferPrice') - = ovrd_tradePeriodEnergyOfferX(tp,o,blk,'i_generationofferPrice'); - -ovrd_dateTimeEnergyOffer(dt,o,blk,'i_generationMWofferPrice') - $ ovrd_dateTimeEnergyOfferX(dt,o,blk,'i_generationofferPrice') - = ovrd_dateTimeEnergyOfferX(dt,o,blk,'i_generationofferPrice'); -* The parameters above added to fix the bug in vSPD online overrides - -*overwrite period offer override by datetime offer override if datetime offer override exists (>0) -Loop i_dateTimeTradePeriodMap(dt,tp) do - ovrd_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeEnergyOffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeEnergyOffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodOfferParameter(tp,o,offerPar) - $ ovrd_dateTimeOfferParameter(dt,o,offerPar) - = ovrd_dateTimeOfferParameter(dt,o,offerPar) ; - - ovrd_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeFastPLSRoffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeFastPLSRoffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeSustainedPLSRoffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeSustainedPLSRoffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeFastTWDRoffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeFastTWDRoffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeSustainedTWDRoffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeSustainedTWDRoffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeFastILRoffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeFastILRoffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) - $ ovrd_dateTimeSustainedILRoffer(dt,o,blk,bidofrCmpnt) - = ovrd_dateTimeSustainedILRoffer(dt,o,blk,bidofrCmpnt) ; - - ovrd_tradePeriodReserveClassGenerationMaximum(tp,o,resC) - $ ovrd_dateTimeReserveClassGenerationMaximum(dt,o,resC) - = ovrd_dateTimeReserveClassGenerationMaximum(dt,o,resC) ; - - ovrd_tradePeriodEnergyBid(tp,i_bid,blk,bidofrCmpnt) - $ ovrd_dateTimeEnergyBid(dt,i_bid,blk,bidofrCmpnt) - = ovrd_dateTimeEnergyBid(dt,i_bid,blk,bidofrCmpnt) ; - - ovrd_tradePeriodDispatchableBid(tp,i_bid) - $ ovrd_datetimeDispatchableBid(dt,i_bid) - = ovrd_datetimeDispatchableBid(dt,i_bid) ; -EndLoop; - -* Energy offer overrides -i_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodEnergyOffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -* Offer parameter overrides -i_tradePeriodOfferParameter(tp,o,offerPar) - $ (ovrd_tradePeriodOfferParameter(tp,o,offerPar) > 0) - = ovrd_tradePeriodOfferParameter(tp,o,offerPar) ; - -i_tradePeriodOfferParameter(tp,o,offerPar) - $ { ovrd_tradePeriodOfferParameter(tp,o,offerPar) - and (ovrd_tradePeriodOfferParameter(tp,o,offerPar) = eps ) - } = 0 ; - -* PLSR offer overrides -i_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodFastPLSRoffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -i_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodSustainedPLSRoffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -* TWDR offer overrides -i_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodFastTWDRoffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -i_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodSustainedTWDRoffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -* ILR offer overrides -i_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodFastILRoffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -i_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) - $ (ovrd_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) ; - -i_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) - $ { ovrd_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) - and (ovrd_tradePeriodSustainedILRoffer(tp,o,blk,bidofrCmpnt) = eps) - } = 0 ; - -* Genertion Reserve Class Capacity -i_tradePeriodReserveClassGenerationMaximum(tp,o,resC) - $ (ovrd_tradePeriodReserveClassGenerationMaximum(tp,o,resC) > 0) - = ovrd_tradePeriodReserveClassGenerationMaximum(tp,o,resC) ; - -i_tradePeriodReserveClassGenerationMaximum(tp,o,resC) - $ { ovrd_tradePeriodReserveClassGenerationMaximum(tp,o,resC) - and (ovrd_tradePeriodReserveClassGenerationMaximum(tp,o,resC) = eps) - } = 0 ; - -* Enegry bid overrides -i_tradePeriodEnergyBid(tp,bd,blk,bidofrCmpnt) - $ (ovrd_tradePeriodEnergyBid(tp,bd,blk,bidofrCmpnt) > 0) - = ovrd_tradePeriodEnergyBid(tp,bd,blk,bidofrCmpnt) ; - -i_tradePeriodEnergyBid(tp,bd,blk,bidofrCmpnt) - $ { ovrd_tradePeriodEnergyBid(tp,bd,blk,bidofrCmpnt) - and (ovrd_tradePeriodEnergyBid(tp,bd,blk,bidofrCmpnt) = eps) - } = 0 ; - -i_tradePeriodDispatchableBid(tp,bd) - $ (ovrd_tradePeriodDispatchableBid(tp,bd) > 0) = yes ; - -i_tradePeriodDispatchableBid(tp,bd) - $ { ovrd_tradePeriodDispatchableBid(tp,bd) - and (ovrd_tradePeriodDispatchableBid(tp,bd) = eps) - } = no ; - -$offEnd +mnCstrEnrgFactors(case2dt(ca,dt),MnodeCstr,o) $ ovrd_MnodeCnstrfactor_DateTime(dt,MnodeCstr,o,"NA","NA") = ovrd_MnodeCnstrfactor_DateTime(dt,MnodeCstr,o,"NA","NA") ; +mnCstrEnrgFactors(case2dt(ca,dt),MnodeCstr,o) $ ovrd_MnodeCnstrfactor_CaseID(ca,MnodeCstr,o,"NA","NA") = ovrd_MnodeCnstrfactor_CaseID(ca,MnodeCstr,o,"NA","NA") ; + +mnCstrEnrgFactors(case2dt(ca,dt),MnodeCstr,o) $ { mnCstrEnrgFactors(ca,dt,MnodeCstr,o) = EPS } = 0 ; + + +mnCnstrResrvFactors(case2dt(ca,dt),MnodeCstr,o,resC,resT) + $ sum[ (resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_Alltime('All',MnodeCstr,o,resCx,resTx) ] + = sum[ (resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_Alltime('All',MnodeCstr,o,resCx,resTx) ] ; + +mnCnstrResrvFactors(case2dt(ca,dt),MnodeCstr,o,resC,resT) + $ sum[ (case2dt2tp(ca,dt,tp),resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_Period(tp,MnodeCstr,o,resCx,resTx) ] + = sum[ (case2dt2tp(ca,dt,tp),resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_Period(tp,MnodeCstr,o,resCx,resTx) ] ; + +mnCnstrResrvFactors(case2dt(ca,dt),MnodeCstr,o,resC,resT) + $ sum[ (resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_DateTime(dt,MnodeCstr,o,resCx,resTx) ] + = sum[ (resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_DateTime(dt,MnodeCstr,o,resCx,resTx) ] ; + +mnCnstrResrvFactors(case2dt(ca,dt),MnodeCstr,o,resC,resT) + $ sum[ (resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_CaseID(ca,MnodeCstr,o,resCx,resTx) ] + = sum[ (resCx,resTx) $ { sameas(resCx,resC) and sameas(resTx,resT) }, ovrd_MnodeCnstrfactor_CaseID(ca,MnodeCstr,o,resCx,resTx) ] ; + +mnCnstrResrvFactors(case2dt(ca,dt),MnodeCstr,o,resC,resT) $ { mnCnstrResrvFactors(ca,dt,MnodeCstr,o,resC,resT) = EPS } = 0 ; + +*========================================================================================================================= +* Market node constraint factor overrides end +*========================================================================================================================= * End of file diff --git a/Programs/vSPDreport.gms b/Programs/vSPDreport.gms index 38eee53..f7bf079 100644 --- a/Programs/vSPDreport.gms +++ b/Programs/vSPDreport.gms @@ -84,8 +84,8 @@ File PublishedEnergyPrices_TP /"%outputPath%\%runName%\%runName%_PublishedEnerg PublishedEnergyPrices_TP.pc = 5; PublishedEnergyPrices_TP.lw = 0; PublishedEnergyPrices_TP.pw = 9999; PublishedEnergyPrices_TP.ap = 1; PublishedEnergyPrices_TP.nd = 5; PublishedEnergyPrices_TP.nw = 20; put PublishedEnergyPrices_TP ; -loop( (tp,n), - put tp.tl, n.tl, o_PublisedPrice_TP(tp,n) / ; +loop( (dt,tp,n) $ tp2dt(tp,dt) , + put dt.tl,tp.tl, n.tl, o_PublisedPrice_TP(tp,n) / ; ) ; * Published reserve prices @@ -93,8 +93,8 @@ File PublishedReservePrices_TP /"%outputPath%\%runName%\%runName%_PublishedRese PublishedReservePrices_TP.pc = 5; PublishedReservePrices_TP.lw = 0; PublishedReservePrices_TP.pw = 9999; PublishedReservePrices_TP.ap = 1; PublishedReservePrices_TP.nd = 5; PublishedReservePrices_TP.nw = 20; put PublishedReservePrices_TP ; -loop( (tp,isl), - put tp.tl, isl.tl, o_PublisedFIRPrice_TP(tp,isl), o_PublisedSIRPrice_TP(tp,isl) / ; +loop( (dt,tp,isl) $ tp2dt(tp,dt) , + put dt.tl, tp.tl, isl.tl, o_PublisedFIRPrice_TP(tp,isl), o_PublisedSIRPrice_TP(tp,isl) / ; ) ; * Trading period offer result @@ -439,6 +439,6 @@ loop( (ca,dt,tp) $ case2dt2tp(ca,dt,tp), execute_unload '%outputPath%\%runName%\%GDXname%_AllData.gdx' ; $endif.AuditReport *=============================================================================== -execute_unload '%outputPath%\%runName%\%GDXname%_AllData.gdx' ; +*execute_unload '%outputPath%\%runName%\%GDXname%_AllData.gdx' ; diff --git a/Programs/vSPDreportSetup.gms b/Programs/vSPDreportSetup.gms index e7cd2e7..5237217 100644 --- a/Programs/vSPDreportSetup.gms +++ b/Programs/vSPDreportSetup.gms @@ -39,11 +39,11 @@ put nodeResults_TP 'CaseID','DateTime','Period', 'Node','Generation (MW)','Load File PublishedEnergyPrices_TP /"%outputPath%\%runName%\%runName%_PublishedEnergyPrices_TP.csv"/; PublishedEnergyPrices_TP.pc = 5 ; PublishedEnergyPrices_TP.lw = 0 ; PublishedEnergyPrices_TP.pw = 9999 ; -put PublishedEnergyPrices_TP 'TradingPeriod','Pnodename','vSPDDollarsPerMegawattHour'; +put PublishedEnergyPrices_TP 'DateTime','TradingPeriod','Pnodename','vSPDDollarsPerMegawattHour'; File PublishedReservePrices_TP /"%outputPath%\%runName%\%runName%_PublishedReservePrices_TP.csv"/; PublishedReservePrices_TP.pc = 5 ; PublishedReservePrices_TP.lw = 0 ; PublishedReservePrices_TP.pw = 9999 ; -put PublishedReservePrices_TP 'TradingPeriod','Island','vSPDFIRDollarsPerMegawattHour','vSPDSIRDollarsPerMegawattHour'; +put PublishedReservePrices_TP 'DateTime','TradingPeriod','Island','vSPDFIRDollarsPerMegawattHour','vSPDSIRDollarsPerMegawattHour'; File offerResults_TP / "%outputPath%\%runName%\%runName%_OfferResults_TP.csv" /; offerResults_TP.pc = 5; offerResults_TP.lw = 0; offerResults_TP.pw = 9999; diff --git a/Programs/vSPDsettings.inc b/Programs/vSPDsettings.inc index 2f145a8..b9d9e15 100644 --- a/Programs/vSPDsettings.inc +++ b/Programs/vSPDsettings.inc @@ -3,7 +3,7 @@ $inlinecom ## ## $eolcom ! *+++ Paths +++ -$setglobal runName daily_202221105_0140_RTD +$setglobal runName Testing $setglobal programPath '%system.fp%' $setglobal inputPath '%system.fp%..\Input\' @@ -14,7 +14,7 @@ $setglobal vSPDinputOvrdData '' !Name of override file *+++ Model +++ Scalar sequentialSolve / 0 / ; ! Vectorisation: Yes <-> i_SequentialSolve: 0 -Scalar dailymode / 0 / ; ! Solving quickly by using RTD pre-calculated demand or PRSS solved initial MW +Scalar dailymode / 1 / ; ! Solving quickly by using RTD pre-calculated demand or PRSS solved initial MW *+++ Network +++ Scalar useACLossModel / 1 / ; @@ -44,4 +44,4 @@ $setglobal licenseMode 1 *+++ Various switches +++ -$setglobal opMode SPD ! DWH for data warehouse; AUD for audit; FTR for FTR Rental; SPD for normal SPD run; PVT for pivot analysis; DPS for demand~price sensitivity analysis +$setglobal opMode SPD ! SPD for normal SPD run; diff --git a/Programs/vSPDsolve.gms b/Programs/vSPDsolve.gms index 55e2083..48f1d73 100644 --- a/Programs/vSPDsolve.gms +++ b/Programs/vSPDsolve.gms @@ -387,6 +387,7 @@ $if exist "%ovrdPath%%vSPDinputOvrdData%.gdx" $include vSPDoverrides.gms studyMode(ca,dt) = runMode(ca,'studyMode'); IntervalDuration(ca,dt) = runMode(ca,'intervalLength'); case2dt(ca,dt) = yes $ sum[ tp $ case2dt2tp(ca,dt,tp), 1] ; +tp2dt(tp,dt) = yes $ [ord(dt) = smin[case2dt2tp(ca,dt1,tp), ord(dt1)] ]; * Nodal data node(ca,dt,n) = yes $ sum[ b $ nodeBus(ca,dt,n,b), 1 ] ;