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 757 rate capability #845

Merged

Conversation

brosaplanella
Copy link
Member

Description

I have added an example script that generates rate capability plots. The implementation is not the best, so feedback on how to make it more efficient is welcome. In any case, I think it is a good first step to include in v0.2.

Because it is an example, rather than a new feature, I haven't added to CHANGELOG.md.

Fixes #757

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

Copy link
Member

@valentinsulzer valentinsulzer left a comment

Choose a reason for hiding this comment

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

thanks @ferranbrosa , looks good. However, I don't think we need a separate script for high C-rate DFN, adding some comments to the existing DFN script to explain how you would change it to high C-rate should be enough

disc.process_model(model)

# solve model
t_eval = np.linspace(0, 0.2, 1E4)
Copy link
Member

Choose a reason for hiding this comment

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

needs to be updated with t_eval in seconds

Copy link
Member Author

Choose a reason for hiding this comment

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

I did this such a long time ago that I thought someone else had done it haha. I have removed it now.

plt.scatter(currents * voltage_av, capacities * voltage_av)
plt.xlabel('Power [W]')
plt.ylabel('Energy [Wh]')

Copy link
Member

Choose a reason for hiding this comment

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

nice!

.gitignore Outdated
@@ -91,3 +91,6 @@ cmake_install.cmake


third-party/pybind11

# LGM50 results
results/LGM50/
Copy link
Member

Choose a reason for hiding this comment

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

this can be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@codecov
Copy link

codecov bot commented Feb 20, 2020

Codecov Report

Merging #845 into master will increase coverage by 0.05%.
The diff coverage is 98.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #845      +/-   ##
==========================================
+ Coverage   98.19%   98.24%   +0.05%     
==========================================
  Files         181      180       -1     
  Lines       10227    10277      +50     
==========================================
+ Hits        10042    10097      +55     
+ Misses        185      180       -5
Impacted Files Coverage Δ
...bamm/models/submodels/particle/fickian/__init__.py 100% <ø> (ø) ⬆️
...m/models/full_battery_models/base_battery_model.py 100% <100%> (ø) ⬆️
pybamm/expression_tree/exceptions.py 100% <100%> (ø) ⬆️
pybamm/solvers/solution.py 99.21% <100%> (+0.11%) ⬆️
...l_battery_models/lead_acid/base_lead_acid_model.py 100% <100%> (ø) ⬆️
...odels/full_battery_models/lithium_ion/basic_dfn.py 100% <100%> (ø) ⬆️
...bamm/parameters/standard_parameters_lithium_ion.py 100% <100%> (ø) ⬆️
pybamm/expression_tree/operations/simplify.py 95.09% <100%> (ø) ⬆️
...ttery_models/lithium_ion/base_lithium_ion_model.py 100% <100%> (ø) ⬆️
...bmodels/particle/fickian/fickian_many_particles.py 100% <100%> (ø) ⬆️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab0911f...ff14f0e. Read the comment docs.

@valentinsulzer valentinsulzer merged commit ff885db into pybamm-team:master Feb 24, 2020
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.

Rate capability plots
2 participants