Commit 5904fe32 authored by jussi ikäheimo's avatar jussi ikäheimo
Browse files

Simplifiy q_superposStateUpwardLimit.

parent a3bc98ed
......@@ -2689,38 +2689,34 @@ q_superposStateMin(gn_state(grid, node_superpos(node)), msft(m, s, f, t))..
*--- Upward limit for superpositioned states -----------------
* Note: this
* Note:
q_superposStateUpwardLimit(gn_state(grid, node_superpos(node)), mz(m,z))..
// Utilizable headroom in the state variable
+ [
// Upper boundary of the variable
+ p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'constant')${p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'useConstant')}
// Upper boundary of the variable
+ p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'constant')${p_gnBoundaryPropertiesForStates(grid, node, 'upwardLimit', 'useConstant')}
// Investments
+ sum(gnu(grid, node, unit),
+ p_gnu(grid, node, unit, 'upperLimitCapacityRatio')
* p_gnu(grid, node, unit, 'unitSize')
* [
+ v_invest_LP(unit)${unit_investLP(unit)}
+ v_invest_MIP(unit)${unit_investMIP(unit)}
]
) // END sum(gnu)
// State of the node at the beginning of period z
- v_state_z(grid, node, z)
// Investments
+ sum(gnu(grid, node, unit),
+ p_gnu(grid, node, unit, 'upperLimitCapacityRatio')
* p_gnu(grid, node, unit, 'unitSize')
* [
+ v_invest_LP(unit)${unit_investLP(unit)}
+ v_invest_MIP(unit)${unit_investMIP(unit)}
]
) // END sum(gnu)
// Maximum state reached during the related sample
- sum(zs(z,s_),
v_statemax(grid, node, s_)
)
// State of the node at the beginning of period z
- v_state_z(grid, node, z)
] // END Headroom
// Maximum state reached during the related sample
- sum(zs(z,s_),
v_statemax(grid, node, s_)
)
*
// Conversion to energy
p_gn(grid, node, 'energyStoredPerUnitOfState')
=G= 0
;
......@@ -2732,25 +2728,25 @@ q_superposStateDownwardLimit(gn_state(grid, node_superpos(node)), mz(m,z))..
// Utilizable headroom in the state variable
// State of the node at the beginning of period z
+ v_state_z(grid, node, z)
*
// multiplied by the self discharge loss over the whole period
// (note here we make a conservative assumption that the minimum
// intra-period state v_statemin is reached near the end of the period
// so that maximal effect of the self-discharge loss applies.)
sum(zs(z, s_),
power(1 - mSettings(m, 'stepLengthInHours')
* p_gn(grid, node, 'selfDischargeLoss'),
msEnd(m,s_) - msStart(m,s_) )
)
// Minimum state reached during the related sample
+ sum(zs(z,s_),
v_statemin(grid, node, s_)
)
// State of the node at the beginning of period z
+ v_state_z(grid, node, z)
*
// multiplied by the self discharge loss over the whole period
// (note here we make a conservative assumption that the minimum
// intra-period state v_statemin is reached near the end of the period
// so that maximal effect of the self-discharge loss applies.)
sum(zs(z, s_),
power(1 - mSettings(m, 'stepLengthInHours')
* p_gn(grid, node, 'selfDischargeLoss'),
msEnd(m,s_) - msStart(m,s_) )
)
// Minimum state reached during the related sample
+ sum(zs(z,s_),
v_statemin(grid, node, s_)
)
// Lower boundary of the variable
- p_gnBoundaryPropertiesForStates(grid, node, 'downwardLimit', 'constant')${p_gnBoundaryPropertiesForStates(grid, node, 'downwardLimit', 'useConstant')}
// Lower boundary of the variable
- p_gnBoundaryPropertiesForStates(grid, node, 'downwardLimit', 'constant')${p_gnBoundaryPropertiesForStates(grid, node, 'downwardLimit', 'useConstant')}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment