I am trying to optimize a charging station for EVs in matlab with intlinprog, which is connected to a PV-Modul, to an system storage systeme and to the network grid. I am using different Storage technologies (Lithium, Lead acid and flywheel). I have issues to simulate for some charging scenarios with time resolution of 15 minutes (PV and load data). The charging scenarios are 350kW with 3 Charging points (total energy demand for a year 665 MWh); 150 kW with 12 Charging points (allover 253.58 MWh)and 11kW with 25 Charging points (for a whole year 83.8 MWh). When the demanded energy is lower, the model runs slower, and when there is higher self-discharge, the model also slows down. The simulation varies 3h30 for Li and first scenario (so lowest self discharge and highest Demand) to nearly a day for Flywheel and 11 kW. Can someone help me, explain to me why?

  • $\begingroup$ If your problem is a mathematical or modeling problem, I suggest you write the mathematical problem/model explicitely, rather than the code which is much less readable. $\endgroup$
    – Kuifje
    Jul 12 at 15:30
  • $\begingroup$ the optimization problem is to min{Cost}=min{C_buy+C_batt,var+C_peak+C_charger-R_sell-R_EV} such that the power balance is fulfilled: p_sell/eff_grid - eff_grid * p_buy = eff_pv * p_pv - p_load / eff_load + eff_dch * p_dch - p_ch / eff_ch; the Energie balance too E(t+1)=E(t) + P_chdelta_t - P_dchdelta_t - self_dicharge_Rate*E(t) and other constraints like the max charging power of the battery the maximun and minimum stored energies also there are some integer defined to deny the system from charging and discharging the energy storage at the same time, to buy and sell Energy simultanously $\endgroup$
    – tun24
    Jul 12 at 15:45
  • $\begingroup$ intlinprog is usually not the fastest MILP solver. Gurobi, Xpress or CPLEX might be considerably faster (although the most recent version of CPLEX runnable in MATLAB is 12.10.0, which is not the latest CPLEX version. $\endgroup$ Jul 12 at 15:51
  • $\begingroup$ So, if I want to use one of these solvers, I presume I have to change/ translate my entire code? $\endgroup$
    – tun24
    Jul 12 at 15:56
  • $\begingroup$ Some changes would be needed. If you use YALMIP, you can switch between solvers by just changing which solver is specified, plus specifying the solver-specific options you want. $\endgroup$ Jul 12 at 18:25


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.