Commit 50f8f80f authored by Topi Rasku's avatar Topi Rasku
Browse files

Fixes to the diagnostic result vectors, as well as adding a command line...

Fixes to the diagnostic result vectors, as well as adding a command line argument to include them only when necessary.
parent a83c2ba5
......@@ -38,6 +38,10 @@ GAMS command line arguments
with all symbols as well as a gdx file for each solution containing
model parameters, variables and equations.
--diag=[yes|no]
Switch on/off diagnostics. Writes some additional diagnostic results in
'results.gdx' about data updates and efficiency approximations.
--dummy=[yes|no]
Do not solve the model, just do preliminary calculations.
For testing purposes.
......
......@@ -157,10 +157,13 @@ r_qCapacity
r_solveStatus
// Diagnostics
$iftheni.diag '%diag%' == 'yes'
d_cop
d_eff
d_capacityFactor
d_nodeState
d_influx
$endif.diag
// Metadata and settings
metadata
......
......@@ -181,9 +181,13 @@ Option clear = r_qResDemand;
* --- Diagnostics Results Arrays ----------------------------------------------
* =============================================================================
// Only include these if '--diag=yes' given as a command line argument
$iftheni.diag '%diag%' == yes
Parameters
d_cop(unit, f, t) "Coefficients of performance of conversion units"
d_eff(unit, f, t) "Efficiency of generation units using fuel"
d_capacityFactor(flow, node, s, f, t) "Diagnostic capacity factors (accounting for GAMS plotting error)"
d_nodeState(grid, node, param_gnBoundaryTypes, s, f, t) "Diagnostic temperature forecasts (accounting for GAMS plotting error)"
d_influx(grid, node, s, f, t) "Diagnostic influx forecasts (accounting for GAMS plotting error)"
;
$endif.diag
......@@ -164,25 +164,38 @@ r_qGen(inc_dec, gn(grid, node), f, t)
* --- Diagnostics Results -----------------------------------------------------
* =============================================================================
// Only include these if '--diag=yes' given as a command line argument
$iftheni.diag '%diag%' == yes
// Capacity factors for examining forecast errors
d_capacityFactor(flowNode(flow, node), s, f_solve(f), t_active(t))${sft(s, f, t)
and sum(flowUnit(flow, unit), nu(node, unit)) }
d_capacityFactor(flowNode(flow, node), s, f_solve(f), t_current(t))
${ msf(mSolve, s, f)
and t_active(t)
and sum(flowUnit(flow, unit), nu(node, unit))
}
= ts_cf_(flow, node, f, t, s)
+ ts_cf(flow, node, f, t + dt_sampleOffset(flow, node, 'ts_cf', s))${ not ts_cf_(flow, node, f, t, s) }
- 1e-3${ not ts_cf_(flow, node, f, t, s)
and not ts_cf(flow, node, f, t + dt_sampleOffset(flow, node, 'ts_cf', s))
}
+ Eps
;
// Temperature forecast for examining the error
d_nodeState(gn_state(grid, node), param_gnBoundaryTypes, s, f_solve(f), t_active(t))
${p_gnBoundaryPropertiesForStates(grid, node, param_gnBoundaryTypes, 'useTimeseries')
and sft(s, f, t)}
d_nodeState(gn_state(grid, node), param_gnBoundaryTypes, s, f_solve(f), t_current(t))
${ p_gnBoundaryPropertiesForStates(grid, node, param_gnBoundaryTypes, 'useTimeseries')
and t_active(t)
and msf(mSolve, s, f)
}
= ts_node_(grid, node, param_gnBoundaryTypes, f, t, s)
+ ts_node(grid, node, param_gnBoundaryTypes, f, t)${ not ts_node_(grid, node, param_gnBoundaryTypes, f, t, s)}
- 1e-3${ not ts_node_(grid, node, param_gnBoundaryTypes, f, t, s)
and not ts_node_(grid, node, param_gnBoundaryTypes, f, t, s)
}
+ Eps
;
// Influx forecast for examining the errors
d_influx(gn(grid, node), s, f_solve(f), t_current(t))
${ msf(mSolve, s, f)
and t_active(t)
}
= ts_influx_(grid, node, f, t, s)
+ ts_influx(grid, node, f, t)${ not ts_influx_(grid, node, f, t, s)}
+ Eps
;
$endif.diag
* --- Model Solve & Status ----------------------------------------------------
......
......@@ -483,6 +483,8 @@ r_uTotalShutdown(unit)
* --- Diagnostic Results ------------------------------------------------------
// Only include these if '--diag=yes' given as a command line argument
$iftheni.diag '%diag%' = 'yes'
// Estimated coefficients of performance
d_cop(unit, ft_realizedNoReset(f, t))${ [ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
and sum(gnu_input(grid, node, unit), 1)
......@@ -506,7 +508,7 @@ d_eff(unit_fuel(unit), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 't_start
) // END sum(uFuel)
+ 1${not sum(uFuel(unit, 'main', fuel), r_fuelUse(fuel, unit, f, t))}
];
$endif.diag
); // END loop(m)
Supports Markdown
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