Skip to content

Commit

Permalink
calculate new drive consumption with air conditioning loses #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Tk1999s committed Feb 9, 2022
1 parent 0ba0a83 commit 669a165
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions simbev/simbevMiD.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ def availability(
staytime = math.ceil(staytime / stepsize)
# print("staytime done: " + str(staytime))

driveconsumption = distance * con
driveconsumption = total_consumption(temperature_now, drivetime, temp_inside, cooling, heating, con,
distance)
range_remaining = (soc_list[-1] * batcap) / con

# fast charging events
Expand All @@ -358,7 +359,8 @@ def availability(
distance_remaining = distance - distance_stop
drivetime = (distance_stop / speed) * 60
drivetime = math.ceil(drivetime / stepsize)
driveconsumption = distance_stop * con
driveconsumption = total_consumption(temperature_now, drivetime, temp_inside, cooling, heating, con,
distance)
# get timesteps for car status of driving
drive_start = im + 1
drive_end = int(drive_start + drivetime)
Expand Down Expand Up @@ -423,7 +425,8 @@ def availability(
distance_stop = range_bat
drivetime = (distance_stop / speed) * 60
drivetime = math.ceil(drivetime / stepsize)
driveconsumption = distance_stop * con
driveconsumption = total_consumption(temperature_now, drivetime, temp_inside, cooling, heating, con,
distance)
purp_list.append("driving")
# get timesteps for car status of driving
drive_start = im + 1
Expand Down Expand Up @@ -485,16 +488,17 @@ def availability(
continue

# driving
driveconsumption = distance * con
drivetime = (distance / speed) * 60
drivetime = math.ceil(drivetime / stepsize)
driveconsumption = total_consumption(temperature_now, drivetime, temp_inside, cooling, heating, con,
distance)
soc = soc_list[-1] - (driveconsumption / batcap)
if car_type == "PHEV":
# SOC can't be negative
if soc < 0:
soc = 0
driveconsumption = soc_list[-1] * batcap

drivetime = (distance / speed) * 60
drivetime = math.ceil(drivetime / stepsize)
purp_list.append("driving")
# get timesteps for car status of driving
drive_start = im + 1
Expand Down

0 comments on commit 669a165

Please sign in to comment.