Commit 3d02d9b4 authored by Niina Helistö's avatar Niina Helistö
Browse files

Updating p_msWeight description.

First try to fix issue #97.
parent 5b68dbe5
......@@ -54,6 +54,8 @@ if (mType('building'),
// Define the probability (weight) of samples
p_msProbability('building', s) = 0;
p_msProbability('building', 's000') = 1;
p_msWeight('building', s) = 0;
p_msWeight('building', 's000') = 1;
* --- Define Time Step Intervals ----------------------------------------------
......
......@@ -58,9 +58,13 @@ if (mType('invest'),
// Define the probability (weight) of samples
p_msProbability('invest', s) = 0;
p_msProbability('invest', 's000') = 8760/504;
p_msProbability('invest', 's001') = 8760/504;
p_msProbability('invest', 's002') = 8760/504;
p_msProbability('invest', 's000') = 1;
p_msProbability('invest', 's001') = 1;
p_msProbability('invest', 's002') = 1;
p_msWeight('invest', s) = 0;
p_msWeight('invest', 's000') = 8760/504;
p_msWeight('invest', 's001') = 8760/504;
p_msWeight('invest', 's002') = 8760/504;
* --- Define Time Step Intervals ----------------------------------------------
......
......@@ -64,6 +64,8 @@ if (mType('schedule'),
// Define the probability (weight) of samples
p_msProbability('schedule', s) = 0;
p_msProbability('schedule', 's000') = 1;
p_msWeight('schedule', s) = 0;
p_msWeight('schedule', 's000') = 1;
// If using long-term samples, uncomment
//ms_central('schedule', 's001') = yes;
......
......@@ -92,7 +92,7 @@ Parameters
* --- Probability -------------------------------------------------------------
Parameters
p_msWeight(mType, s) "Weight of sample"
p_msWeight(mType, s) "Temporal weight of sample: number of similar periods represented by sample s"
p_msProbability(mType, s) "Probability to reach sample conditioned on anchestor samples"
p_mfProbability(mType, f) "Probability of forecast"
p_msft_probability(mType, s, f, t) "Probability of forecast"
......
......@@ -2118,7 +2118,7 @@ q_boundCyclic(gnss_bound(gn_state(grid, node), s_, s), m)
and tSolveFirst = mSettings(m, 't_start')
}..
// Initial value of the state of the node at the start of the sample
// Initial value of the state of the node at the start of the sample s
+ sum(mst_start(m, s, t),
+ sum(sft(s, f, t),
+ v_state(grid, node, s, f+df(f,t+dt(t)), t+dt(t))
......@@ -2127,12 +2127,28 @@ q_boundCyclic(gnss_bound(gn_state(grid, node), s_, s), m)
=E=
// State of the node at the end of the sample
+ sum(mst_end(m, s_, t_),
+ sum(sft(s_, f_, t_),
+ v_state(grid, node, s_, f_, t_)
// Initial value of the state of the node at the start of the sample s_
+ sum(mst_start(m, s_, t),
+ sum(sft(s_, f, t),
+ v_state(grid, node, s_, f+df(f,t+dt(t)), t+dt(t))
) // END sum(ft)
) // END sum(mst_end)
) // END sum(mst_start)
// Change in the state value over the sample s_, multiplied by sample s_ temporal weight
+ p_msWeight(m, s_)
* [
// State of the node at the end of the sample s_
+ sum(mst_end(m, s_, t),
+ sum(sft(s_, f, t),
+ v_state(grid, node, s_, f, t)
) // END sum(ft)
) // END sum(mst_end)
// State of the node at the end of the sample s_
- sum(mst_start(m, s_, t),
+ sum(sft(s_, f, t),
+ v_state(grid, node, s_, f+df(f,t+dt(t)), t+dt(t))
) // END sum(ft)
) // END sum(mst_start)
] // END * p_msWeight(m, s_)
;
*--- Minimum Inertia ----------------------------------------------------------
......
......@@ -422,7 +422,8 @@ Option clear = p_msft_probability;
p_msft_probability(msft(mSolve, s, f, t))
= p_mfProbability(mSolve, f)
/ sum(f_${ft(f_, t)},
p_mfProbability(mSolve, f_)) * p_msProbability(mSolve, s);
p_mfProbability(mSolve, f_)) * p_msProbability(mSolve, s)
* p_msWeight(mSolve, s);
* --- Calculate sample displacements ------------------------------------------
......@@ -454,4 +455,4 @@ if(mSettings(mSolve, 'scenarios'), // Only do smooting if using long-term scena
$$batinclude 'inc/smoothing.gms' ts_influx
$$batinclude 'inc/smoothing.gms' ts_cf
);
); // END if('scenarios')
\ No newline at end of file
); // END if('scenarios')
......@@ -96,35 +96,35 @@ loop(m,
r_gnuTotalVOMCost(gnu_output(grid, node, unit))
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_gnuVOMCost(grid, node, unit, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
);
// Total fuel & emission costs
r_uTotalFuelEmissionCost(fuel, unit)${ uFuel(unit, 'main', fuel) }
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_uFuelEmissionCost(fuel, unit, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
);
// Total unit startup costs
r_uTotalStartupCost(unit)${ sum(starttype, unitStarttype(unit, starttype)) }
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_uStartupCost(unit, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
);
// Total state variable slack costs
r_gnTotalStateSlackCost(gn_stateSlack(grid, node))
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_gnStateSlackCost(grid, node, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
);
// Fixed O&M costs
r_gnuFOMCost(gnu(grid, node, unit))
= 1e-6 // Scaling to MEUR
* [
+ p_gnu(grid, node, unit, 'maxGen') // Not in v_obj
+ p_gnu(grid, node, unit, 'maxGen') // Not in v_obj
+ p_gnu(grid, node, unit, 'maxCons') // Not in v_obj
+ r_invest(unit)
* p_gnu(grid, node, unit, 'unitSizeTot')
......@@ -196,7 +196,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_gen(grid, node, unit, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
// Energy generation by fuels
......@@ -219,7 +219,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_genFuel(grid, node, fuel, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
// Total dummy generation/consumption
......@@ -227,7 +227,7 @@ loop(m,
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_qGen(inc_dec, grid, node, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
* --- Total Unit Online Results -----------------------------------------------
......@@ -237,7 +237,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_online(unit, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
// Approximate utilization rates for gnus over the simulation
......@@ -256,7 +256,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_reserve(restype, up_down, node, unit, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
// Total dummy reserve provisions over the simulation
......@@ -264,7 +264,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_qResDemand(restype, up_down, node, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
* --- Total Transfer and Spill ------------------------------------------------
......@@ -274,7 +274,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_transfer(grid, from_node, to_node, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
// Total energy spill from nodes
......@@ -282,7 +282,7 @@ loop(m,
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_spill(grid, node, f, t)
* p_stepLengthNoReset(m, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
* =============================================================================
......@@ -331,7 +331,7 @@ r_gTotalqGen(inc_dec, grid)
r_gnTotalConsumption(gn(grid, node))
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_gnConsumption(grid, node, f ,t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
);
// Total consumption in each grid over the simulation
......@@ -375,7 +375,7 @@ r_gnTotalSpillShare(gn(grid, node_spill))${ r_gTotalSpill(grid) > 0 }
r_gnTotalRealizedOperatingCost(gn(grid, node))
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_gnRealizedOperatingCost(grid, node, f ,t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
);
// Total realized net operating costs on each gn over the simulation
......@@ -473,14 +473,14 @@ r_uTotalOnlinePerUnit(unit)${ p_unit(unit, 'unitCount') > 0 }
r_uTotalStartup(unit, starttype)
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_startup(unit, starttype, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
// Total sub-unit shutdowns over the simulation
r_uTotalShutdown(unit)
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_shutdown(unit, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s))
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
* --- Diagnostic Results ------------------------------------------------------
......
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