How do I add time dependence to linprog

I am currently drafting a system for load scheduling according to a varying electricity price and power available from a PV system. This is my first time using linprog. I have managed to schedule charging and discharging of a battery to minimize cost defined by a cost function. I have included a load prediction, PV generation prediction and electricity price prediction (using existing data, for now). To allow time dependency, I divided the day into time slots with all equalities and inequalities defined separately for each time slot as well as dependencies over time slots (such as the state of charge of the battery). What I don't know how to do is scheduling of a load with a known load profile that cannot be changed or turned off once it is running. The only way that I have thought of is to run the linear optimization once for each time slot within the selected window with the load starting in a different time slot every time, basically brute forcing. But that's computationally intensive and won't work with a lot of loads due to the exponential increase in number of calculations for each additional load since ideally every possible combination should be evaluated. Is there any better way to do this?

Answers (1)

I am not sure that I fully understand your model, but I wonder if this example might be relevant. The example uses mixed-integer linear programming, which is different than your question, but might provide an answer to your question.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

1 Comment

workoft
workoft on 22 Mar 2016
Edited: workoft on 22 Mar 2016
Hi Alan, thank you for your answer.
I have a working model at this point. I want to improve my model by introducing load scheduling for loads that can be scheduled, on top of the predicted, non-controllable load. A load has a fixed (estimated) power consumption pattern that will generally extend over several time frames. What is variable is the starting time of the load. What is to be determined is the optimal starting time frame for a load (or a combination of loads) alongside battery use.
What I am able to do at the moment is to create variable loads with local (maximum momentary power) and global (total energy demand) restrictions or fixed patterns at pre-defined time frames, but I cannot let the optimizer vary a pre-defined load pattern over a certain number of time frames.
If I understand mixed integer programming correctly, I suppose what I could do is to create an m×n array (with n being the number of time frames and m being the number of allowed starting frames) for each controllable load with the load pattern shifted by one time frame for each line. I'm not sure if that's how it works, so I would appreciate if anybody could confirm this if I haven't posted success or failure here yet.
Regards,
Malte

Sign in to comment.

Products

Tags

Asked:

on 21 Mar 2016

Edited:

on 22 Mar 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!