1

I have a specific question, and I will deeply appreciate any help please.

I am working on a specific project on AMPL (A Mathematical Programming language): I need to implement an objective function that minimizes the risk on the cost for a variable, that has a cost as a parameter and correlation coefficients as well.

The risk is estimated using the variance on cost, and I have my correlation matrix data. My correlation matrix looks like this: correlation coefficients (%)
2015
Coal steam turbine Gas combustion turbine Wind Central PV Hydro non pumped Nuclear GenIII Nuclear GenIV Coal steam turbine CCS
1 0.47 0 0 0 0.12 0.12 1 Coal steam turbine
0.47 1 0 0 0 0.06 0.06 0.47 Gas combustion turbine
0 0 1 0 0 0 0 0 Wind
0 0 0 1 0 0 0 0 Central PV
0 0 0 0 1 0 0 0 Hydro non pumped
0.12 0.06 0 0 0 1 1 0.12 Nuclear GenIII
0.12 0.06 0 0 0 1 1 0.12 Nuclear GenIV
1 0.47 0 0 0 0.12 0.12 1 Coal steam turbine CCS

In my case, the risk on cost that I want to minimize is on fuel prices ( Fuels types are correlated and coefficients of correlation vary yearly, fuel prices depend on the type of the technology, the province, and the year).

I need to find a way to find an efficient way to enter the correlation matrix in a table ( database on psgAdmin (psql) ) and then use appropriate arguments to read them, and implement them on my objective function.

The table that I have so far looks like this:

table fuel_prices "inputs/fuel_prices.tab" IN:
[province, fuel, year], fuel_price, cv_fuel_price;
read table fuel_prices;

I need to modify it to add correlation coefficients.

# Table for the correlation coefficients
# table fuel_prices_corr "inputs/fuel_prices_corr.tab"  and IN:
#  [province, year], fuel, correl_coeff1, correl_coeff2;
# read table fuel_prices_corr;

The technologies I am using are extracted from tables as the following: table generator_info "inputs/generator_info.tab" IN:
TECHNOLOGIES <- [technology], technology_id, fuel; read table generator_info;

table gen_cap_cost "inputs/gen_cap_cost.tab" IN:
[technology, year], overnight_cost_yearly ~ overnight_cost, fixed_o_m_yearly ~    fixed_o_m, variable_o_m_yearly ~ variable_o_m;
read table gen_cap_cost;

table existing_plants "inputs/existing_plants.tab" IN: 
EXISTING_PLANTS <- [project_id, province, technology], 
ep_plant_name ~ plant_name, ep_carma_plant_id ~ carma_plant_id,
ep_capacity_mw ~ capacity_mw, ep_heat_rate ~ heat_rate,   ep_cogen_thermal_demand ~ cogen_thermal_demand_mmbtus_per_mwh,
ep_vintage ~ start_year,  
ep_overnight_cost ~ overnight_cost, ep_connect_cost_per_mw ~ connect_cost_per_mw, ep_fixed_o_m ~ fixed_o_m, ep_variable_o_m ~ variable_o_m,
ep_location_id;
read table existing_plants;


table new_projects "inputs/new_projects.tab" IN: 
PROJECTS <- [project_id, province, technology], location_id,   ep_project_replacement_id,
capacity_limit, capacity_limit_conversion, heat_rate, cogen_thermal_demand, connect_cost_per_mw;
read table new_projects;

My objective function looks like this:pid = project specific id , a = province, t = technology , p = PERIODS, the start of an investment period as well as the date when a power plant starts running, h = study hour - unique timepoint considered, and p = investment period.

sum{(pid, a, t, p)in PROJECT} Gen[pid, a,t, p, h] * fuel_cost[pid,a,t,p]))

Does anyone have a hint on that please, or a project that uses MPT, and correlated variables?

1 Answers1

0

Here's an example of a table declaration for reading a two-dimensional parameter amt taken from here:

table dietAmts IN "ODBC" (ConnectionStr) "Amounts":
  [NUTR, FOOD], amt;

In your case, you'll have the same set twice in the key section, something like [ENERGY_SOURCE, ENERGY_SOURCE], where ENERGY_SOURCE is a set of energy sources such as Coal steam turbine, etc. Since the matrix is symmetric you only need to store half of it.

vitaut
  • 49,672
  • 25
  • 199
  • 336