infeasible or unbounded model

10 views (last 30 days)
Bahareh
Bahareh on 30 Jun 2024
Commented: Bahareh on 3 Jul 2024
i have 8 Electric vans with different scheduling of arrival and departure at the charging station P_ch_max_van=100KW and dt=0.25,running the code in one day ,got the error infeasible ,any suggestions?
ev24 = [];
for n = 1:1:N_van
for k=n
for t = t_arr_van(k):1:t_dep_van(k)-1
ev24 = [ev24, P_ch_van(n,t) >= 0];
end
end
end
ev25 = [];
for n = 1:1:N_van
for k=n
for t = t_arr_van(k):1:t_dep_van(k)-1
ev25 = [ev25, P_ch_van(n,t) <= P_ch_max_van*x_ch_van(n,t)];
end
end
end
ev26=[];
for n = 1:1:N_van
for k=n
for t = t_arr_van(k):1:t_dep_van(k)-1
ev26 = [ev26, x_ch_van(n,t) <= y_van_t(t)];
end
end
end
ev27 = [];
for n = 1:1:N_van
for k=n
for t = t_arr_van(k):1:t_dep_van(k)
ev27 = [ev27, SoC_van(n,t) >= SoC_min_van];
end
end
end
ev28=[];
for n = 1:1:N_van
for k=n
for t = t_arr_van(k):1:t_dep_van(k)
ev28 = [ev28, SoC_van(n,t) <= 100];
end
end
end
ev29 = [];
for n = 1:1:N_van
for k=n
for t = t_arr_van(k):1:t_dep_van(k)-1
ev29 = [ev29, SoC_van(n,t+1) == SoC_van(n,t) + ((delta./C_van)*(P_ch_van(n,t)*...
eta_ch_van))*100];
end
end
end
ev30 = [];
for n = 1:1:2
for k=n
ev30 = [ev30,SoC_van(n,t_arr_van(k)) <= 30];
end
end
ev30a = [];
for n = 3:1:4
for k=n
ev30a = [ev30a,SoC_van(n,t_arr_van(k)) <= 40];
end
end
ev30b = [];
for n = 5:1:6
for k=n
ev30b = [ev30b,SoC_van(n,t_arr_van(k)) <= 20];
end
end
ev30c = [];
for n = 7:1:8
for k=n
ev30c = [ev30c,SoC_van(n,t_arr_van(k)) <= 25];
end
end
ev31=[];
for n = 1:1:N_van
for k=n
ev31 = [ev31,SoC_van(n,t_dep_van(k)) >= 80];
end
end
ev32 = [];
for n = 1:1:N_van
for k=n
for t = 1:1:t_arr_van(k)-1
ev32 = [ev32, P_ch_van(n,t) == 0];
end
end
end
ev32a = [];
for n = 1:1:N_van
for k=n
for t = t_dep_van(k):1:T
ev32a = [ev32a, P_ch_van(n,t) == 0];
end
end
end
ev33 = [];
for n = 1:1:N_van
for k=n
for t = 1:1:t_arr_van(k)-1
ev33 = [ev33, SoC_van(n,t) == 0];
end
end
end
ev33a = [];
for n = 1:1:N_van
for k=n
for t = t_dep_van(k)+1:1:T
ev33a = [ev33a, SoC_van(n,t) == 0];
end
end
end

Answers (2)

Umar
Umar on 30 Jun 2024
Hi Bahareh,
Regarding the error of "infeasible" when running the code for 8 electric vans with different scheduling of arrival and departure at the charging station, there could be several reasons for this error. Here are a few suggestions to resolve the issue:
Review the constraints in the code to ensure they are correctly implemented. Make sure that the constraints are feasible given the specific scheduling of the vans and the power limitations of the charging station.
In case, if the error is related to the power limitations of the charging station, consider increasing the maximum power capacity (P_ch_max_van) to accommodate the charging requirements of all the vans.
If the error still persists, then consider optimizing the scheduling of the vans to minimize conflicts and maximize the utilization of the charging station. This could involve adjusting the arrival and departure times of the vans to distribute the charging load more evenly throughout the day.
Hope these suggestions will help resolve your issues.
  1 Comment
Bahareh
Bahareh on 1 Jul 2024
Hi Umar
Thanks for the reply.I went through all your suggestions but this error still persists.I guess the problem would be in the code since if i write the constraints for the vehicles with same time arrival and departure i don't get this error.however i could not figure out how to solve it.

Sign in to comment.


Umar
Umar on 1 Jul 2024
Hi Bahareh,
I can understand your pain. So, I will go extra mile try to help you out. Upon analyzing the code, I have identified a potential issue that could lead to infeasibility. The issue lies in the way the constraints are being formulated and added to the constraint vectors (ev24, ev25, ev26, etc.).
The code iterates over the vehicles (n) and the time steps (t) within the arrival and departure time intervals for each vehicle. However, the nested loops within each constraint vector are unnecessary and may be causing the infeasibility issue.
So, I modified the code to correctly formulate the constraints without unnecessary nested loops. Here's the modified code:
ev24 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n)-1 ev24 = [ev24, P_ch_van(n,t) >= 0]; end end
ev25 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n)-1 ev25 = [ev25, P_ch_van(n,t) <= P_ch_max_van*x_ch_van(n,t)]; end end
ev26 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n)-1 ev26 = [ev26, x_ch_van(n,t) <= y_van_t(t)]; end end
ev27 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n) ev27 = [ev27, SoC_van(n,t) >= SoC_min_van]; end end
ev28 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n) ev28 = [ev28, SoC_van(n,t) <= 100]; end end
ev29 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n)-1 ev29 = [ev29, SoC_van(n,t+1) == SoC_van(n,t) + ((delta./C_van)*(P_ch_van(n,t)*eta_ch_van))*100]; end end
ev30 = []; for n = 1:1:2 ev30 = [ev30, SoC_van(n,t_arr_van(n)) <= 30]; end
ev30a = []; for n = 3:1:4 ev30a = [ev30a, SoC_van(n,t_arr_van(n)) <= 40]; end
ev30b = []; for n = 5:1:6 ev30b = [ev30b, SoC_van(n,t_arr_van(n)) <= 20]; end
ev30c = []; for n = 7:1:8 ev30c = [ev30c, SoC_van(n,t_arr_van(n)) <= 25]; end
ev31 = []; for n = 1:1:N_van ev31 = [ev31, SoC_van(n,t_dep_van(n)) >= 80]; end
ev32 = []; for n = 1:1:N_van for t = 1:1:t_arr_van(n)-1 ev32 = [ev32, P_ch_van(n,t) == 0]; end end
ev32a = []; for n = 1:1:N_van for t = t_dep_van(n):1:T ev32a = [ev32a, P_ch_van(n,t) == 0]; end end
ev33 = []; for n = 1:1:N_van for t = 1:1:t_arr_van(n)-1 ev33 = [ev33, SoC_van(n,t) == 0]; end end
ev33a = []; for n = 1:1:N_van for t = t_dep_van(n)+1:1:T ev33a = [ev33a, SoC_van(n,t) == 0]; end end
So, the above modified code consists of multiple loops iterating over different time periods and vehicle indices to enforce specific conditions related to power, state of charge (SoC), and other parameters. Each constraint is formulated as a logical expression that must hold true for the system to operate within predefined limits.
Also, let me break down a few examples to understand the constraints better:
ev24 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n)-1 ev24 = [ev24, P_ch_van(n,t) >= 0]; end end
This constraint ensures that the charging power of each electric vehicle is non-negative during the specified time intervals.
ev29 = []; for n = 1:1:N_van for t = t_arr_van(n):1:t_dep_van(n)-1 ev29 = [ev29, SoC_van(n,t+1) == SoC_van(n,t) + ((delta./C_van)*(P_ch_van(n,t)*eta_ch_van))*100]; end end
Here, the constraint maintains the relationship between the state of charge of the vehicle at consecutive time steps based on the charging power and efficiency.
ev32a = []; for n = 1:1:N_van for t = t_dep_van(n):1:T ev32a = [ev32a, P_ch_van(n,t) == 0]; end end
This constraint ensures that no charging power is drawn from the grid after the departure time of each vehicle until the end of the simulation.
Feel free to make any necessary changes to suit your requirements. Hope this will help now to resolve your concerns.
  2 Comments
Umar
Umar on 1 Jul 2024
Sorry for unformatted code.
Bahareh
Bahareh on 3 Jul 2024
Hi Umar, Thanks for the effort .I tried with this code but it didn't work so I defined constraints for each time arrival and departure which doesn't show me any errors.However i believe there would be better solution for this.

Sign in to comment.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!