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

Issue 1143 equivalent circuit model #2478

Merged
merged 39 commits into from
Nov 29, 2022

Conversation

Scottmar93
Copy link
Contributor

Description

Implementation of Theverin Equivalent Circuit Model (resistor + RC pair). Main things implemented:

  • works with the experiment class
  • toy parameter set implemented (made up example)
  • demonstrates 3D and 2D interpolation working with a model
  • variable choice of the number of RC pairs

If anyone has better ideas on where Equivalent circuit models and the associated submodel should be place, would be very helpful. There also is some hacky stuff (e.g. adding additional variables to the model, some additional options) that would also be nice to avoid

Additional modifications:
I some modifications to the 2D interpolation so that it now also used RegularGridInterpolator (as implemented for 3D) instead of interp2d. 2D and 3D data can now be read from csv files following the "C" array convention (slowest changing a variable in the first column). The previous .json method still passes it's test so is still compatible.

Fixes #1143

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

.all-contributorsrc 2 Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 99.72% // Head: 99.72% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (f7a397e) compared to base (90b2753).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head f7a397e differs from pull request most recent head 9241251. Consider uploading reports for the commit 9241251 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #2478    +/-   ##
=========================================
  Coverage    99.72%   99.72%            
=========================================
  Files          257      268    +11     
  Lines        18961    19285   +324     
=========================================
+ Hits         18908    19232   +324     
  Misses          53       53            
Impacted Files Coverage Δ
pybamm/simulation.py 100.00% <ø> (ø)
pybamm/expression_tree/broadcasts.py 100.00% <100.00%> (ø)
pybamm/expression_tree/interpolant.py 100.00% <100.00%> (ø)
pybamm/input/parameters/ecm/example_set.py 100.00% <100.00%> (ø)
...full_battery_models/equivalent_circuit/__init__.py 100.00% <100.00%> (ø)
...ery_models/equivalent_circuit/ecm_model_options.py 100.00% <100.00%> (ø)
...full_battery_models/equivalent_circuit/thevenin.py 100.00% <100.00%> (ø)
.../submodels/equivalent_circuit_elements/__init__.py 100.00% <100.00%> (ø)
...bmodels/equivalent_circuit_elements/ocv_element.py 100.00% <100.00%> (ø)
...ubmodels/equivalent_circuit_elements/rc_element.py 100.00% <100.00%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks great Scott, thanks! Just a couple of minor points regarding the naming of the submodels. Happy to merge once the coverage tests pass.

@Scottmar93 Scottmar93 merged commit 53cf744 into develop Nov 29, 2022
@valentinsulzer valentinsulzer deleted the issue-1143-equivalent-circuit-model branch April 27, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add simple equivalent circuit model
3 participants