-
Notifications
You must be signed in to change notification settings - Fork 135
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
Add ev tutorial #1150
base: docs/make-style-modern
Are you sure you want to change the base?
Add ev tutorial #1150
Conversation
Reason: other nonoptimal statuses besides infeasable are possible, e.g. unbounded
So that results are saved, even if error is raised
examples/ev_charging/ev_charging.py
Outdated
import matplotlib to plot the data right away and import solph | ||
""" | ||
|
||
from copy import deepcopy |
Check notice
Code scanning / CodeQL
Unused import
Fix bugs in parameter as dict
add dynamic prices
Replace assert by pytest use
…o esske-infeasable_message
add axis labels within the 'solve_and_plot' function |
I don't get this. We do have labels (for both the vertical axis). The horizontal one is a time anyway, so it might not really make sense to have a label, does it? |
The example used to be belinear and required gurobi. This, however, is no longer the case (since solph v0.5.0). Thus, cbc can be used as the default solver. (Thanks to Rainer Gaier for finding this issue.)
Oh sorry, I meant legends. Although they are obvious because of the values, it could be helpful for the first users. |
In the smoke test, "os.path.abspath(__file__)" will give the path of the smoke test. Thus, loading files has to consider this.
ev_demand.loc[driving_start_morning:driving_end_morning] = 10 # kW | ||
|
||
# Evening Driving: 17:00 to 18:00. | ||
# Note that time points work even if they are not in the index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
driving time in the explanation and the code do not match
""" | ||
|
||
|
||
def add_domestic_socket_charging(energy_system, b_car): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"To be able to load the battery a electric source e.g. electric grid is necessary. To connect the car while it is at home, we create avalibility data series. 1 means that the car is at home, chargable. When it is set to 0, car is not present (between morning departure and the arrival back home in the evening). The avalibility data will be used in the maximum of the battery. "
""" | ||
|
||
|
||
def add_11kW_charging(energy_system, b_car): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Same with avalibility data at home charging, we will create a data set for avalibility at work. When it is set to 0, car is not present at the work. When it is set to 1, car is able to connect to work charge station (between morning arrival and the evening departure from work) "
def add_balanced_battery(energy_system, b_car): | ||
car_battery = solph.components.GenericStorage( | ||
label="Car Battery", | ||
nominal_capacity=50, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable cost is too high there ?
model.solve(solve_kwargs={"tee": False}) | ||
results = solph.processing.results(model) | ||
|
||
battery_series = solph.views.node(results, "Car Battery")["sequences"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think it could be helpful to mention briefly the results structure from views? People might have strugle at the start reaching the results to analyse.
Charging and discharging at the same time is almost always a sign that | ||
something is not moddeled accurately in the energy system. | ||
To avoid the energy from looping in the battery, we introduce marginal costs | ||
to battery charging. This is a way to model cyclic aging of the battery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we explain a little more on, how we are ingluencing the aging effect?
Would it be valueable to add another block of code to have multiple cars? |
Add a tutorial according to point 2 in #1141, but with slight changes:
Plugged EV as load with pre-calculated charging time seriesCharged EV with predefined trips for load (learning: trivial dispatch, but from battery)
with PV systemat work (learning: dispatch with shifting under simple constraint)Power-related costs (as a proxy for battery ageing)(needs good adjustment of parameters, nothing for a beginners tutorial)