Optimal and Robust Control
B3M35ORR + BE3M35ORR + BE3M35ORCHomework problem assignment #1
Electric Vehicle Charging System
Solve the problem of distributing a limited amount of power to three electric vehicle chargers throughout the next ten hours. Specifically, you are supposed to find an hourly-sampled optimal plan for each car minimizing the total cost of the charging. You are given a time-dependent maximum available energy \(E_{\mathrm{max}}[k]\) [kWh] for charging, time-depended cost of the energy \(c[k]\) [€/kWh], maximum allowed amount of energy you can charge to the ith car per hour \(E_{i,\mathrm{max}}\) [kWh], requested charged energy \(E_{i,\mathrm{req}}\) [kWh] and departure time for each car \(d_i\). All cars are connected and can be charged from time 1. Departure time is the time index when the energy charged to an ith car has to be at least \(E_{i,\mathrm{req}}\) and when you have to stop charging the car. Index \(k\) in the beforementioned quantities is a time index running from 1 to 10 and index \(i\) is an index specifying the corresponding car (i.e. \(i\in\{1,2,3\}\)).
The data for this optimization problem is given in the following tables.
Car | \(E_{i,\mathrm{max}}\) [kWh] | \(E_{i,\mathrm{req}}\) [kWh] | \(d_i\) |
1 | 6 | 15 | 3 |
2 | 6 | 25 | 7 |
3 | 4 | 30 | 10 |
Time | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
---|---|---|---|---|---|---|---|---|---|---|
\(E_{\mathrm{max}}[k]\) | 11.6 | 11.9 | 10.6 | 8.8 | 8.0 | 8.8 | 10.6 | 11.9 | 11.6 | 10.0 |
\(c[k]\) | 0.58 | 0.72 | 0.92 | 0.68 | 0.54 | 0.78 | 0.64 | 0.57 | 0.74 | 0.74 |
Formulate this task as an optimization problem, identify the class of this optimization problem (LP, QP or NLP) and solve it in Matlab by either CVX or functions from Optimization Toolbox. Submit a Matlab function solving this optimization problem. Your solution will be evaluated automatically thus the function you will submit has to have a certain name and return certain values. Specifically, the function has to be stored in a file named hw1_cvutID.m and the header of the function has to be in the following form:
function [ optval, opt_X, opt_type ] = hw1_cvutID()
where cvutID is you KOS username, optval is the found optimal value, opt_X is the 10-by-3 matrix composed of the optimal plans for individual chargers and opt_type is the class of this optimization problem. In opt_type, the function is supposed to return string 'LP', 'QP' or 'NLP'. You can submit only one m-file. If you need more functions, you can use nested functions (for details, see this).
- 23. ledna 2021, 22.44