Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate EV schedules #1757

Merged
merged 87 commits into from
Feb 13, 2025
Merged

Generate EV schedules #1757

merged 87 commits into from
Feb 13, 2025

Conversation

rajeee
Copy link
Collaborator

@rajeee rajeee commented Jun 20, 2024

Pull Request Description

We leverage the existing American Time Use Survey (ATUS) guided stochastic occupancy generator to generate the EV battery charging and discharging schedule. The schedule generator takes total hours driven per week as an input to the EV schedule generator and produces the charging and discharging schedule. The battery model takes care of the actual power draw during the charging and discharging period. An example of what these schedules look like is presented in Figure 1. This schedule shows that during an “away period” for the occupant, the vehicle is discharged after the occupant leaves the home. Then later in the day the vehicle is discharged again while the occupant travels home.

image
Figure 1 Illustration of EV battery discharge schedule generation.

Discharging Schedule Generation

The guiding theme for the discharge schedule is the assumption that the EV is owned/associated with just one of occupant in the house. We look at the away duration for each occupant and eliminate any occupant whose away hours would not be sufficient to fit the given number of driving hours per year. Then we randomly pick one of the occupant out of the eligible occupant. If no occupant happens to have sufficient away hours then we pick the occupant with the highest away hours and truncate the driving hours to whatever hours the occupant away schedule supports.

Once the occupant is chosen, we assume that the EV battery discharge will start immediately after they leave the home, and immediately before they arrive – simulating the scenario that they left the home driving the EV, stayed somewhere for a while and then returned home. Following that assumption, we sum the total away duration for the occupant, and proportionally assign the driving hours to each away period. The driving hours assigned to each away period is distributed symmetrically at the start and end – always making sure to leave the center 20% as idle to allow for some idle duration at the destination away from home. This algorithm is illustrated in the Figure 1.

Charging Schedule Generation

Currently, we assume that the occupant plugs in their vehicle as soon as they are home and keeps it plugged in until they leave. So, the charging schedule is identical to the occupancy schedule of the EV owning occupant. This makes the battery eligible to be charged anytime the EV is at home if the state of charge is below 100%. Whether or not the charging happens and at what power level is managed by the battery model. The TEMPO model makes similar assumptions in its “immediate” or “ASAP” charging strategy, as described in Yip et al. (2023).

Handling of fractional charging at home

Not all EV owners charge exclusively at home. RECS 2020 survey has a question about what fraction of their charging is done at home with options being 100%, 80 to 99%, 60 to 79% etc. This diversity of charging behavior is handled by proportionally reducing the driving hours and calculating effective driving hours. The underlying assumption in using this data is that respondents answered the fraction of their charging in terms of energy, as opposed to time. The "hours driven per week" fed into the schedule generator is assumed to have already applied this adjustment.

Checklist

Not all may apply:

  • Schematron validator (EPvalidator.xml) has been updated
  • Sample files have been added/updated (openstudio tasks.rb update_hpxmls)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests/test*.rb and/or workflow/tests/test*.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

@shorowit shorowit added the enhancement New feature or request label Jul 11, 2024
@aspeake aspeake mentioned this pull request Sep 6, 2024
12 tasks
@rajeee rajeee requested a review from shorowit November 12, 2024 18:40
@rajeee rajeee marked this pull request as ready for review January 29, 2025 01:41
@shorowit shorowit mentioned this pull request Feb 6, 2025
3 tasks
Base automatically changed from ev_batteries to master February 11, 2025 21:05
Copy link
Contributor

@shorowit shorowit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall looks good to me and can merge in when the CI comes back with a ✅ after the last commit. A couple final thoughts:

  1. I wish we also had a stochastic EV charging schedule for when the HPXML has an EV charging PlugLoad. It will probably be confusing that a stochastic schedule is only available when the HPXML has an EV Vehicle.
  2. It looks like a lot of the hot water-related stochastic schedules have changed. I can't immediately tell why. Is it because you tried to address this? Either way, we should probably document it in the changelog.

@shorowit shorowit merged commit a784be6 into master Feb 13, 2025
@shorowit shorowit deleted the ev_schedules branch February 13, 2025 18:10
@joseph-robertson joseph-robertson mentioned this pull request Feb 13, 2025
24 tasks
@rajeee
Copy link
Collaborator Author

rajeee commented Mar 5, 2025

This PR has changed the schedules inside the HPXMLtoOpenStudio/resources/schedule_files/. The occupancy-stochastic_.csv files have been renamed to occupancy-stochastic-mf-unit_.csv to be more explicit that these are for multifamily units, and also because occupancy-stochastic-mf-unit.csv (for unit 1) and occupancy-stochastic.csv (for other non-mf hpxmls) would no longer be the same due to removal of schedule for non-existent appliances. The changes in the schedule is originating due to perturbations in the random number generator due to introduction of independent generators for each end use so that we only generate schedules for things that exist in the HPXML file.

================================================================================
FILE: occupancy-stochastic-10-mins.csv
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 52560 -> 52560

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 2379.88 -> 1681.31
      Sample changes:
        - row 31: 0.0 -> 0.165
        - row 32: 0.0 -> 0.254

  - cooking_range:
      total: 3204.50 -> 1805.50
      Sample changes:
        - row 26: 0.0 -> 0.4
        - row 27: 0.8 -> 1.0

  - clothes_dryer:
      total: 906.10 -> 683.70
      Sample changes:
        - row 1210: 0.0 -> 1.0
        - row 1211: 0.0 -> 1.0

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 1280.10 -> 968.70
      Sample changes:
        - row 72: 0.5 -> 0.0
        - row 73: 1.0 -> 0.9

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 922.43 -> 830.67
      Sample changes:
        - row 1208: 0.0 -> 0.126
        - row 1209: 0.309 -> 0.0

  - hot_water_dishwasher:
      total: 874.19 -> 935.46
      Sample changes:
        - row 72: 0.473 -> 0.0
        - row 73: 0.435 -> 0.449

  - clothes_washer:
      total: 629.10 -> 385.60
      Sample changes:
        - row 1208: 0.0 -> 0.4
        - row 1210: 1.0 -> 0.0

================================================================================
FILE: occupancy-stochastic-30-mins.csv
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 52560 -> 52560

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 2379.88 -> 1681.31
      Sample changes:
        - row 31: 0.0 -> 0.165
        - row 32: 0.0 -> 0.254

  - cooking_range:
      total: 3204.50 -> 1805.50
      Sample changes:
        - row 26: 0.0 -> 0.4
        - row 27: 0.8 -> 1.0

  - clothes_dryer:
      total: 906.10 -> 683.70
      Sample changes:
        - row 1210: 0.0 -> 1.0
        - row 1211: 0.0 -> 1.0

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 1280.10 -> 968.70
      Sample changes:
        - row 72: 0.5 -> 0.0
        - row 73: 1.0 -> 0.9

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 922.43 -> 830.67
      Sample changes:
        - row 1208: 0.0 -> 0.126
        - row 1209: 0.309 -> 0.0

  - hot_water_dishwasher:
      total: 874.19 -> 935.46
      Sample changes:
        - row 72: 0.473 -> 0.0
        - row 73: 0.435 -> 0.449

  - clothes_washer:
      total: 629.10 -> 385.60
      Sample changes:
        - row 1208: 0.0 -> 0.4
        - row 1210: 1.0 -> 0.0

================================================================================
FILE: occupancy-stochastic.csv
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 887.04 -> 981.16
      Sample changes:
        - row 5: 0.106 -> 0.519
        - row 6: 0.0 -> 0.197

  - cooking_range:
      total: 534.16 -> 300.90
      Sample changes:
        - row 4: 0.467 -> 0.567
        - row 5: 0.3 -> 0.717

  - clothes_dryer:
      total: 151.01 -> 113.96
      Sample changes:
        - row 201: 0.0 -> 0.333
        - row 202: 0.267 -> 0.2

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 213.41 -> 161.48
      Sample changes:
        - row 12: 0.8 -> 0.267
        - row 17: 0.167 -> 0.0667

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 345.54 -> 322.64
      Sample changes:
        - row 201: 0.342 -> 0.274
        - row 202: 0.458 -> 0.56

  - hot_water_dishwasher:
      total: 273.09 -> 287.33
      Sample changes:
        - row 12: 0.516 -> 0.588
        - row 17: 0.234 -> 0.103

  - clothes_washer:
      total: 133.83 -> 67.66
      Sample changes:
        - row 201: 0.617 -> 0.246
        - row 225: 0.319 -> 0.246

================================================================================
FILE: occupancy-stochastic-mf-unit.csv (compared to occupancy-stochastic.csv before)
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_clothes_washer:
      total: 345.54 -> 322.64
      Sample changes:
        - row 201: 0.342 -> 0.274
        - row 202: 0.458 -> 0.56

  - hot_water_dishwasher:
      total: 273.09 -> 287.33
      Sample changes:
        - row 12: 0.516 -> 0.588
        - row 17: 0.234 -> 0.103

  - clothes_washer:
      total: 133.83 -> 67.66
      Sample changes:
        - row 201: 0.617 -> 0.246
        - row 225: 0.319 -> 0.246

  - cooking_range:
      total: 534.16 -> 300.90
      Sample changes:
        - row 4: 0.467 -> 0.567
        - row 5: 0.3 -> 0.717

  - dishwasher:
      total: 213.41 -> 161.48
      Sample changes:
        - row 12: 0.8 -> 0.267
        - row 17: 0.167 -> 0.0667

  - hot_water_fixtures:
      total: 887.04 -> 981.16
      Sample changes:
        - row 5: 0.106 -> 0.519
        - row 6: 0.0 -> 0.197

  - lighting_garage:
      Column removed

  - clothes_dryer:
      Column removed

  - ceiling_fan:
      Column removed

================================================================================
FILE: occupancy-stochastic-mf-unit_2.csv (compared to occupancy-stochastic_2.csv before)
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 894.02 -> 956.40
      Sample changes:
        - row 6: 0.14 -> 0.631
        - row 7: 0.159 -> 0.28

  - cooking_range:
      total: 355.92 -> 336.36
      Sample changes:
        - row 7: 0.517 -> 0.25
        - row 8: 0.25 -> 0.517

  - clothes_dryer:
      Column removed

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 164.86 -> 297.45
      Sample changes:
        - row 40: 0.4 -> 0.533
        - row 41: 0.667 -> 1.0

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 266.13 -> 246.47
      Sample changes:
        - row 36: 0.295 -> 0.083
        - row 37: 0.44 -> 0.57

  - hot_water_dishwasher:
      total: 220.91 -> 229.82
      Sample changes:
        - row 40: 0.707 -> 0.527
        - row 41: 0.0 -> 0.373

  - clothes_washer:
      total: 100.77 -> 116.26
      Sample changes:
        - row 36: 0.233 -> 0.0333
        - row 37: 0.25 -> 0.45

================================================================================
FILE: occupancy-stochastic-mf-unit_3.csv (compared to occupancy-stochastic_3.csv before)
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 1048.99 -> 874.35
      Sample changes:
        - row 4: 0.258 -> 0.33
        - row 5: 0.19 -> 0.42

  - cooking_range:
      total: 299.33 -> 332.53
      Sample changes:
        - row 5: 0.25 -> 0.133
        - row 6: 0.0 -> 0.633

  - clothes_dryer:
      Column removed

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 146.66 -> 139.89
      Sample changes:
        - row 42: 0.0 -> 0.133
        - row 43: 0.667 -> 0.133

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 306.53 -> 318.20
      Sample changes:
        - row 45: 0.397 -> 0.125
        - row 46: 0.0467 -> 0.0

  - hot_water_dishwasher:
      total: 292.77 -> 288.40
      Sample changes:
        - row 42: 0.42 -> 0.124
        - row 43: 0.37 -> 0.627

  - clothes_washer:
      total: 140.72 -> 142.01
      Sample changes:
        - row 44: 0.0638 -> 0.0
        - row 45: 0.234 -> 0.633

================================================================================
FILE: occupancy-stochastic-mf-unit_4.csv (compared to occupancy-stochastic_4.csv before)
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 931.27 -> 742.76
      Sample changes:
        - row 0: 0.0907 -> 0.0
        - row 1: 0.0907 -> 0.0

  - cooking_range:
      total: 469.21 -> 455.15
      Sample changes:
        - row 20: 0.0167 -> 0.0
        - row 21: 1.0 -> 0.883

  - clothes_dryer:
      Column removed

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 171.80 -> 166.87
      Sample changes:
        - row 11: 0.25 -> 0.0
        - row 12: 0.55 -> 0.8

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 369.42 -> 406.60
      Sample changes:
        - row 127: 0.181 -> 0.425
        - row 128: 0.315 -> 0.446

  - hot_water_dishwasher:
      total: 282.36 -> 267.89
      Sample changes:
        - row 11: 0.15 -> 0.0
        - row 12: 0.591 -> 0.719

  - clothes_washer:
      total: 118.68 -> 123.82
      Sample changes:
        - row 160: 0.483 -> 0.3
        - row 161: 0.0 -> 0.183

================================================================================
FILE: occupancy-stochastic-mf-unit_5.csv (compared to occupancy-stochastic_5.csv before)
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 873.82 -> 944.39
      Sample changes:
        - row 5: 0.06 -> 0.0
        - row 6: 0.0762 -> 0.42

  - cooking_range:
      total: 1441.61 -> 371.44
      Sample changes:
        - row 10: 0.267 -> 0.0
        - row 11: 1.0 -> 0.517

  - clothes_dryer:
      Column removed

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 368.17 -> 102.93
      Sample changes:
        - row 43: 0.3 -> 0.267
        - row 44: 1.0 -> 0.0

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 354.53 -> 351.66
      Sample changes:
        - row 11: 0.506 -> 0.0
        - row 12: 0.47 -> 0.474

  - hot_water_dishwasher:
      total: 322.09 -> 314.54
      Sample changes:
        - row 43: 0.602 -> 0.269
        - row 44: 0.768 -> 0.675

  - clothes_washer:
      total: 215.77 -> 157.03
      Sample changes:
        - row 12: 0.933 -> 0.483
        - row 68: 0.933 -> 0.267

================================================================================
FILE: occupancy-stochastic-mf-unit_6.csv (compared to occupancy-stochastic_6.csv before)
================================================================================
SUMMARY:
  - 9 columns changed, 4 columns unchanged
  - Rows: 8760 -> 8760

UNCHANGED COLUMNS:
  lighting_interior, occupants, plug_loads_other, plug_loads_tv

CHANGED COLUMNS:
  - hot_water_fixtures:
      total: 969.88 -> 857.14
      Sample changes:
        - row 0: 0.0 -> 0.161
        - row 2: 0.13 -> 0.0

  - cooking_range:
      total: 421.27 -> 358.50
      Sample changes:
        - row 7: 0.5 -> 0.0
        - row 8: 0.0167 -> 0.767

  - clothes_dryer:
      Column removed

  - lighting_garage:
      Column removed

  - dishwasher:
      total: 238.85 -> 207.20
      Sample changes:
        - row 5: 0.583 -> 0.317
        - row 6: 0.767 -> 0.75

  - ceiling_fan:
      Column removed

  - hot_water_clothes_washer:
      total: 209.20 -> 206.77
      Sample changes:
        - row 34: 0.0039 -> 0.0
        - row 35: 0.475 -> 0.601

  - hot_water_dishwasher:
      total: 224.07 -> 232.09
      Sample changes:
        - row 5: 0.727 -> 0.31
        - row 6: 0.0 -> 0.361

  - clothes_washer:
      total: 81.26 -> 126.39
      Sample changes:
        - row 34: 1.0 -> 0.0
        - row 35: 0.0 -> 0.483

@rajeee rajeee mentioned this pull request Mar 5, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants