Hi everyone

I have a model of an electricity market with a given set of virtual power plants (i call them virtual because i take aggregated numbers/data for the diffrent power plants) with given capacities and costs for several interconnected countries. The power plants provide the optimal amount of electricity for every hour of the year depending on given marginal costs of production and availability (e.g. solar power and others are not always available).

As i try to analyze the effects of charging a large number of electric vehicles i created several different models. Ironically i have some problems with the apparently simpler models due to an indexing problem. The problem in this model is as follows:

The total demand for electricity consists of 2 components. The first component is the demand without electric vehicles (this is an exogenous parameter: DoM). The second component is a variable (xMob) which represents the demand of electric vehicles and which should be optimized over a certain time period → in this example over the 48 hours of 2 days (i know that this is not realistic but i need it as comparison to the models with bidirectional charging, which already work). The according demand of the vehicles over the time period (here 2 days) is exogenously given (DMobD). So the model should optimize xMob over the 48 hours of any 2 days to match the given parameter DMobD. I take the calendar of 2018 so the model should optimize xMob over the 1. and 2. of January, then 3. and 4. of January…and so on.

The idea is, that the model tends to choose the midday hours for charging because then there is a lot of “cheap” electricity from solar power.

I tried to overcome the problem with an additional index t for the according time period (here 2 days). To get the model working i had to implement the index t to every parameter and every variable in the model. This was very inefficient and the model gets so big that my computer can’t handle it (the model somehow calculates the new index t1 over all days instead of 1.+2. Jan. then 3.+4. Jan. and so on. I tried some modifications but still it does not work properly. The latest model is infeasible and i really don’t know how i could overcome this problem.

The first attached model (1D.small) optimizes over just the 24 hours of one day. This seems to work.

The second attached model (2D.test2) should optimize over 48 hours of 2 days which does not work properly.

Has anyone an idea how this problem could be solved? It would be even more convenient if there was the possibility to somehow sum up the hourly demand of electric vehicles and set it equal to the sum of the variable xMob over the 48 hours of any 2 days of the year. Firstly because i have the hourly demand data available and secondly i could avoid the separate calculation of the demand over 2, 6 and 7 days (for additional models) in the excel files.

I hope i could somehow explain the problem (as my mathematical background is somewhat limited).

Any help would be greatly appreciated:)

Best, Marco

indata_B_var_1D.small.xlsx (254 KB)

Model_B_var_2D.test2.gms (10.2 KB)

indata_B_var_2D.test2.xlsx (816 KB)

Model_B_var_1D.small.gms (10.2 KB)