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

Implement GITT example #249

Merged
merged 36 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
c8069ba
#223 refactor problems into problem folder
brosaplanella Mar 17, 2024
f380ea4
add Weppner & Huggins model, with some hacks to make it work
brosaplanella Mar 20, 2024
e83d6b3
add GITT FittingProblem
brosaplanella Mar 20, 2024
575c27e
add GITT example
brosaplanella Mar 20, 2024
ab34b4d
Merge branch 'develop' into issue-223-GITT
brosaplanella Mar 20, 2024
7b53b75
style: pre-commit fixes
pre-commit-ci[bot] Mar 20, 2024
659c98e
#223 fix typo
brosaplanella Mar 25, 2024
d98349a
#223 rename example
brosaplanella Mar 25, 2024
4cbac89
#223 add unit test GITT
brosaplanella Mar 25, 2024
feae75b
Merge remote-tracking branch 'upstream/develop' into issue-223-GITT
brosaplanella Mar 25, 2024
b586aac
style: pre-commit fixes
pre-commit-ci[bot] Mar 25, 2024
d583f1d
#223 import pybop
brosaplanella Mar 25, 2024
cef8cc2
style: pre-commit fixes
pre-commit-ci[bot] Mar 25, 2024
6ab1378
#223 comment out failing test to check coverage
brosaplanella Mar 25, 2024
d17b1f7
Merge branch 'issue-223-GITT' of github.com:brosaplanella/PyBOP into …
brosaplanella Mar 25, 2024
b85dbcb
#223 fix ruff
brosaplanella Mar 25, 2024
d447d66
#223 fix failing example
brosaplanella Mar 30, 2024
da4ff8b
Apply suggestions from code review
brosaplanella Apr 8, 2024
d4bf431
#223 fix typo
brosaplanella Apr 8, 2024
edb5e18
remove duplicated parameters
brosaplanella Apr 8, 2024
c4e88d4
#223 add citation
brosaplanella Apr 8, 2024
1e49571
Merge remote-tracking branch 'upstream/develop' into issue-223-GITT
brosaplanella Apr 8, 2024
8ae2f19
style: pre-commit fixes
pre-commit-ci[bot] Apr 8, 2024
74972bc
ruff
brosaplanella Apr 8, 2024
a9d57c5
#223 fix failing tests
brosaplanella Apr 8, 2024
2f6a0e7
style: pre-commit fixes
pre-commit-ci[bot] Apr 8, 2024
c505c41
Merge branch 'develop' into issue-223-GITT
brosaplanella Apr 14, 2024
c126ee2
Merge remote-tracking branch 'upstream/develop' into issue-223-GITT
brosaplanella May 15, 2024
3e1b601
#223 get surface area to volume ratio from PyBaMM
brosaplanella May 15, 2024
6a5ee3d
#223 reverted change as surface area per unit volume is a variable
brosaplanella May 15, 2024
d38b38f
#223 remove GITT class and move to example
brosaplanella May 15, 2024
0a646f8
#223 update CHANGELOG
brosaplanella May 15, 2024
20d3612
#223 remove references to GITT class
brosaplanella May 15, 2024
fdbc803
#223 add credit to pbparam team
brosaplanella May 15, 2024
1ab30d4
#223 add tests for WeppnerHuggins
brosaplanella May 16, 2024
d91c1e5
style: pre-commit fixes
pre-commit-ci[bot] May 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Brady's suggestions

Co-authored-by: Brady Planden <[email protected]>
  • Loading branch information
brosaplanella and BradyPlanden authored Apr 8, 2024
commit da4ff8be590f510b70de8dd90d2ab0d41e64ba7b
3 changes: 1 addition & 2 deletions examples/scripts/gitt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pybop

# Define model
original_parameters = pybamm.ParameterValues("Xu2019")
original_parameters = pybop.ParameterSet.pybamm("Xu2019")
model = pybop.lithium_ion.SPM(
parameter_set=original_parameters, options={"working electrode": "positive"}
)
Expand Down Expand Up @@ -57,7 +57,6 @@
)

# Define the cost to optimise
signal = ["Voltage [V]"]
problem = pybop.GITT(
model="Weppner & Huggins", parameter_set=parameter_set, dataset=dataset
)
Expand Down
11 changes: 5 additions & 6 deletions pybop/models/lithium_ion/weppner_huggins.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BaseWeppnerHuggins(pybamm.lithium_ion.BaseModel):

def __init__(self, name="Weppner & Huggins model"):
super().__init__({}, name)
# `param` is a class containing all the relevant parameters and functions for
# `self.param` is a class containing all the relevant parameters and functions for
# this model. These are purely symbolic at this stage, and will be set by the
# `ParameterValues` class when the model is processed.
self.options["working electrode"] = "positive"
Expand All @@ -33,7 +33,7 @@ def __init__(self, name="Weppner & Huggins model"):
"Maximum concentration in positive electrode [mol.m-3]"
)

i_app = param.current_density_with_time
i_app = self.param.current_density_with_time

U = pybamm.Parameter("Reference OCP [V]")

Expand All @@ -45,16 +45,15 @@ def __init__(self, name="Weppner & Huggins model"):

a = 3 * (epsilon / r_particle)

F = param.F

l_w = param.p.L
l_w = self.param.p.L

######################
# Governing equations
######################
u_surf = (2 / (np.pi**0.5)) * (i_app / ((d_s**0.5) * a * F * l_w)) * (t**0.5)
u_surf = (2 / (np.pi**0.5)) * (i_app / ((d_s**0.5) * a * self.param.F * l_w)) * (t**0.5)
# Linearised voltage
V = U + (Uprime * u_surf) / c_s_max
V = U + (U_prime * u_surf) / c_s_max
######################
# (Some) variables
######################
Expand Down