Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Use this forum to post Vensim related questions.
Post Reply
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Good day,

This post is similar to http://www.ventanasystems.co.uk/forum/v ... tor#p13729.

Background: I am developing a model for electricity generation expansion planning similar to https://www.energypolicy.solutions/ (EPS model (also used Vensim)) for South Africa over the period 2015 - 2030. The work is for my Master's Thesis in Energy Economics. I am using the DSS version.

In terms of the optimization I want Vensim to find the optimal new build options in terms of least cost adhering to certain constraints such as reserve margin, emissions, firm capacity (peak demand) etc. Unfortunately, the optimizer only allows constants to be altered when minimizing the objective function. I need the optimizer to establish each year (time dependent) which technology (coal, nuclear, hydro, wind, etc.) to build and how many MWs. The EPS model does this with ALLOCATE AVAILABLE function which I have done too (also used for least cost dispatch of energy) but I think this limits the new build optimum to each year and not over the entire period. Also I would like to take it further and include the reserve margin in the objective function to see the trade off between cost and reserve margin.

I do appreciate that the optimizer is working within an dynamic model but this could be solved with Excel's Solver and thus confident that Vensim can do the same. Just need to figure out how :? . Please assist :) . Happy to provide the model and/or further details.

I look forward to your response.

Regards
Warrick
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by Administrator »

warrick wrote:I need the optimizer to establish each year (time dependent) which technology (coal, nuclear, hydro, wind, etc.) to build and how many MWs.
You'll need to create a variable for each year that you then optimise to. It's impossible to advise further as you haven't given us anything to look at.

So at a guess,

Code: Select all

payoff year 1 = if then else ( time > year 1 start time :and: time <= year 1 end time , existing payoff, 0 )
payoff year 2 = if then else ( time > year 2 start time :and: time <= year 2 end time , existing payoff, 0 )

overall payoff = payoff year 1 + payoff year 2
This will be zero outside of the year being considered. So include this in the overall payoff, and it will be maximised (or minimised).
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Dear Administrator,

I have attached the model with input file (excel spreadsheet) and the optimizer control file. Let me know how I can talk you through the model and clearly explain my technical requirements. Possible to private message/skype?

I think what you are saying is that I would need to create for instance coal_NewBuild_2015 to coal_NewBuild_2030 and then the same for the other technologies (nuclear, hydro, etc). These constant variables can then be used to optimize. For each technology there is a minimum capacity size (and thus also step size for the optimizer). How would this be incorporated, at the model level or within the optimizer?

Regards
Warrick
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by tomfid »

Have you explored the second suggestion in the other thread, using VECTOR LOOKUP? That seems like it would address your need. You'd be estimating something like NewCapacity[source,timeslice], with VECTOR LOOKUP picking a value at each timeslice for each source. You'd have a combinatorial explosion problem if there are too many sources and timeslices, but for reasonable values it ought to be doable.
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Thank you for the response tomfid. I was reluctant to use the mentioned second option due to the "suppressed feedback loops" and other comments from posters.

I have followed the VECTOR LOOKUP approach and the optimizer is operating. The optimizer finds the number of plants to be built per technology per year (the CONSTANT New Build Number of Units). The capacity (MW/Year) is obtained by multiplying the number of units per year by the unit size per technology. The objective function is:
*P
Total Costs/-1
Reserve Margin/+10
Unmet Demand/-100
Unmet Reserve Margin/-1000000

The last two are constraints which are forced with a high 'penalty'. For the constraints I have increased the weights until there is sufficient Demand (MWh) and Peak Capacity (MW). Not sure how to establish what the correct ratio between Total Costs and Reserve Margin is but I will keep on playing around.

After viewing the presentation "Vensim 6 Optimization Features" I used the following .voc file:
0<=New Build Number of Units[coal,Time Slice]=0<=6|DIS=1
0<=New Build Number of Units[nuclear,Time Slice]=0<=2|DIS=1
0<=New Build Number of Units[hydro,Time Slice]=0<=5|DIS=1
0<=New Build Number of Units[pumped storage,Time Slice]=0<=5|DIS=1
0<=New Build Number of Units[CCGT,Time Slice]=0<=5|DIS=1
0<=New Build Number of Units[OCGT,Time Slice]=0<=10|DIS=1
0<=New Build Number of Units[solar thermal,Time Slice]=0<=3|DIS=1
0<=New Build Number of Units[wind,Time Slice]=0<=10|DIS=1
0<=New Build Number of Units[solar PV,Time Slice]=0<=20|DIS=1

The optimizer's output make sense and I have tested a few what if scenarios like removing cost from the objective function and the solution pushes to the max allowable build capacity per year per technology. The model is outputting New Builds to the end of the period which might be specific to the setup considered with already has committed New Builds forced for the first five years or so and lower than expected demand growth. I thought this might have to do with SMOOTHING function used to spread the Capital Costs but reducing the time period from five to 1 year made very little difference. Any thoughts?

I would appreciate comments/direction/resources regarding setting up the optimizer and if what I have done is acceptable/good practice. I am concerned about the "suppressed feedback loops". Hopefully the nine technologies over 16 time periods is doable. If so this is quite impressive.

I look forward to further inputs :)
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by tomfid »

My initial reaction is that this seems like a good approach. Unfortunately I'm teaching today and traveling tomorrow, so I probably won't be able to comment in depth immediately. One general recommendation for situations like this is to be sure to use the random multistart option, to prevent the optimizer from getting stuck on local optima in the (potentially rough) integer payoff surface.
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Thank you for the feedback tomfid.

Since last post the simultaneous equations have been fixed (http://www.ventanasystems.co.uk/forum/v ... f=2&t=6356) and constraints included as continuous and derivable based on post http://www.ventanasystems.co.uk/forum/v ... nts#p11041. Also, as you recommend the random multistart option is employed.

I am investigating the trade off between system cost (average $/MWh) and CO2 emissions (kg CO2/MWh). The objective function is cost and CO2, with unmet demand and reserve margin as constraints.

The optimization outputs broadly make sense - if greater weight compared to cost is given to CO2 reductions then less coal is built and dispatched (capacity factor lowered), and less CO2 intensive technologies are built such as hydro, nuclear, gas and renewables. However, if looking closer at the results some outputs do not make sense. For example, if system cost and CO2 emissions are equally weighted then new coal power plants are built when seemingly not required. I initially thought this was to reduce the amount of electricity generated by less efficient older coal plants but the new coal plants are under utilized (as well as new gas, hydro and nuclear plants). New coal power plants are not required due to the reserve margin constraint nor the unmet demand constraint and obviously add cost to the system and CO2 emissions so why added?

Please find attached my model, with input data and control file. I would really appreciate guidance on the correct setup of the optimizer. I do not currently have confidence in the outputs. Please assist.

I look forward to your feedback :)
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by tomfid »

I think the control file (.voc) is missing?
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Sorry only three attachments are allowed and I removed the wrong one. Attached.
SearchFunction.voc
Further to above, when slowly varying the weighting between cost (50 to 100%) and CO2 emissions (50 to 0%) one would expect the outputs of the cases to follow a 'trend'. Overall it does but the new build of technologies seems 'patchy'. For example, for 50:50 weighting 700 MW new coal is built in year 2021 but for 60:40 no coal is built in 2021 but for 70:30 700 MW new coal is built again in that year. Seems a bit strange. I assume this has something to do with non-smooth search space and getting stuck in a local minima.

A side note: what is the best way to script/automate the optimization runs as there are 28 cases (7 weighting combinations per 4 reserve margin constraints). It is cumbersome to do this manually each time a variable is changed.
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Thanks tomfid. I will make use of command script once optimization is finalized. I apologise for not better searching for this within the user manual.

I am busy writing up my thesis and would appreciate your feedback regarding the optimization outputs/setup. As stated, I can 'manually' alter the optimal output to more optimal solution, still within the constraints, and thus not optimal. I do believe the work can add value to the South African electricity planning industry but first need to have confidence in the results.
warrick
Member
Posts: 21
Joined: Tue Jul 19, 2016 8:49 pm
Vensim version: DSS

Re: Optimization of time dependent variable (non-constant) for electricity generation expansion planning

Post by warrick »

Optimizer sorted. The outputs used in the objective function were not correctly defined when guaranteed output was greater than the required demand. Thank you it works :)
Post Reply