oemof-solph
oemof-solph copied to clipboard
Introduce parameter "expected" for Flows
This value can be used as a hint to the optimiser to speed up minimisation. The fature is actually a reintroduction: Up to oemof v0.3, it was possible to have a time series "actual_value" plus a boolean parameter "fixed". When fixed was false, it was just taken as the initial value for optimisation of the energy system. When compared to this previous implemenataion, having either fix=(series) or expected=(series) might be easier to understand.
- [ ] Test speed-up for complex model
- [ ] (More) documentation
- [ ] Unit tests
Implements #759
For testing the speedup, I consider the following:
- Source with high nominal value and random costs. (Binary/ NonConvex so that performance is needed.)
- GenericStorage with very high capacity and random series for loss_rate.
- Sink with random (fix) demand
With a sufficiently high number of time steps, this should be rather hard to optimised. So:
- Optimise without giving starting values.
- Redo 1. to make sure there is no effect due to caching, branch prediction and stuff like that.
- Optimise using solution of 1. as starting values.
- Redo 1 once again, same reasoning as in 2, should again be slower.
Hello @p-snft! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
- In the file
examples/expected_flow_value/expected_flow_value.py
:
Line 23:16: E226 missing whitespace around arithmetic operator
- In the file
src/oemof/solph/_models.py
:
Line 391:80: E501 line too long (80 > 79 characters)
Comment last updated at 2022-04-06 07:19:27 UTC
It looks like my implementation does not improve performance in my benchmark/ example case:
Time to solve run (no hints): 292.25 s Time to solve run (no hints): 281.17 s Time to solve run (with hints): 286.85 s Time to solve run (no hints): 375.14 s
Problem is maybe caused by #818.
Update: It's not.
I learned that a parameter warmstart=True
has to be used when solving the Promo model so that the starting values are used.