Schlegen / Microgrid-Manager

Driving a battery in a microgrid. Subjects : Command Predictive Control, Time Series Prediction, Linear optimization, Dashboard ( in Flask, JS, HTML, CSS)
6 stars 1 forks source link

Help with prices file #4

Closed botsbuzz closed 4 years ago

botsbuzz commented 4 years ago

Hi Nicolas,

could you help me to understand the file prices.csv?

Best,

Stefano

Schlegen commented 4 years ago

Hello,

I took this file from a previous project about a microgrid. It contains the prices (in euro) of exchanges of heat in the microgrid. These prices depend on the hour. They are plotted in my report if you want to visualize them (see section 2.4). Each line contains the prices of electricity on the microgrid every 30 minutes from 00h00 to 23h30. The first line is not interesting in this case (I used it for internal exchanges between actors in the microgrid). The second line contains the import prices. The third contains the export prices.

Best,

Nicolas

botsbuzz commented 4 years ago

Thank you for your kind response Nicolas!

Another question: is it possible to save or print the battery load values for each value of the net demand?

Best, Stefano

Schlegen commented 4 years ago

Hi!

Can you explain further ? What do you mean by "each value of the net demand" ?

Best, Nicolas

botsbuzz commented 4 years ago

Thank you Nicolas!

Sorry for my poor english. I'll try to explain further.

Every 3 seconds the model generates a forecast of net demand and a consequent trajectory for the battery. can these values be saved in a file? at the moment they are displayed on charts, but I would also like to output a file and not just a chart.

I take this opportunity to ask you another question: could the battery trajectory be obtained even on real values and not only expected? (therefore on the data used for training)?

Thanks for your help, Stefano

Schlegen commented 4 years ago

Hello,

For the first question : In the function get_data file app.py., we save the data that we plot in the route /data as a json file. I think you can modify this function to save the results as you want. If you just want to save the results just once, without running the dashboard, you can modify and run the file compute_results.py that does the same simulation but more rapidly (because it does not run the dashboard, it generates a forecasts quicker than every 3 seconds). I used this file to save the results of the simulations (with numpy.save) just once and then plot them in plot.py.

Let me know if this is not clear :) .

For the second question : I am not sure to understand this question. What I understand is that you would like to compute the optimal trajectory of the battery load but instead of using the forecast of the net demand as input value, you would like to use the real net demand of the two next weeks, as if the forecast were optimal. Is that what you mean ? If yes, I think that this is possible, in the function solve_optim in optimisation.py, instead of taking the forecasts of the two next weeks, you can take the true values of the net demand.

botsbuzz commented 4 years ago

Thank you so much Nicolas!

I find your work really interesting. Could you explain better the optimization algorithm you use? Do you calculate the trajectory that the battery must follow in the next half hour to minimize the cost at each iteration? So in the current step, analyze the net demand foreseen in the next step and define what the battery has to do?

Thanks in advance.

Best, Stefano

Schlegen commented 4 years ago

Hello Stephano,

First, for the the method: I use the command predictive control See the wikipedia link. It consists in iterating at each step:

Then, for the the optimization algorithm: I used Pulp, an open-source Python library that solves linear optimization problems. As my problem is linear, I guess it uses the simplex algorithm.

Best, Nicolas

botsbuzz commented 4 years ago

Thank you Nicolas!