-
-
Notifications
You must be signed in to change notification settings - Fork 553
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 1011 model new copy #1090
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e7eaa59
#1011 first attempt. quite hacky
valentinsulzer 2e152eb
#1011 fix flake8
valentinsulzer 97bcc53
#1011 remove model_options from simulation.specs
valentinsulzer f77c46d
Merge branch 'develop' into issue-1011-model-new-copy
valentinsulzer 08c8941
#1011 remove sim.specs and sim.reset
valentinsulzer c865c05
#1011 fix examples
valentinsulzer f6fa982
#1011 debugging
valentinsulzer d10bfa5
#1011 fix example again
valentinsulzer 579e136
#1011 merge develop
valentinsulzer 0f0bbaa
#1011 add tests for deprecations and colab
valentinsulzer fcbbd78
#1011 changelog
valentinsulzer 3d4d533
Merge branch 'develop' into issue-1011-model-new-copy
valentinsulzer 874b3f7
#1011 coverage
valentinsulzer e0c0811
Merge branch 'develop' into issue-1011-model-new-copy
valentinsulzer 61da8c7
#1011 merge develop
valentinsulzer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
docs/source/models/submodels/external_circuit/experiment_events.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Experiment events | ||
================================= | ||
|
||
.. autoclass:: pybamm.external_circuit.ExperimentEvents | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ variable to be constant. | |
|
||
current_control_external_circuit | ||
function_control_external_circuit | ||
experiment_events |
420 changes: 0 additions & 420 deletions
420
examples/notebooks/Getting Started/Tutorial 2 - Setting Parameter Values.ipynb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
pybamm/models/submodels/external_circuit/experiment_events.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# | ||
# Model to impose the events for experiments | ||
# | ||
import pybamm | ||
|
||
|
||
class ExperimentEvents(pybamm.BaseSubModel): | ||
"""Model to impose the events for experiments.""" | ||
|
||
def __init__(self, param): | ||
super().__init__(param) | ||
|
||
def set_events(self, variables): | ||
# add current and voltage events to the model | ||
# current events both negative and positive to catch specification | ||
n_cells = pybamm.electrical_parameters.n_cells | ||
self.events.extend( | ||
[ | ||
pybamm.Event( | ||
"Current cut-off (positive) [A] [experiment]", | ||
variables["Current [A]"] | ||
- abs(pybamm.InputParameter("Current cut-off [A]")), | ||
), | ||
pybamm.Event( | ||
"Current cut-off (negative) [A] [experiment]", | ||
variables["Current [A]"] | ||
+ abs(pybamm.InputParameter("Current cut-off [A]")), | ||
), | ||
pybamm.Event( | ||
"Voltage cut-off [V] [experiment]", | ||
variables["Terminal voltage [V]"] | ||
- pybamm.InputParameter("Voltage cut-off [V]") / n_cells, | ||
), | ||
] | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does the current cut-off need to be added to the parameter values or does it get a default value if unspecified?
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.
It's an input parameter so needs to be provided by the user when solving. But the experiment class does this automatically.