Skip to content

Commit

Permalink
Added new temporary variable lithiation_current for current sigmoid
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSOKane committed Feb 23, 2023
1 parent e3ea4c7 commit e00c3c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
8 changes: 2 additions & 6 deletions examples/notebooks/models/composite_particle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "10339d40",
"metadata": {},
Expand Down Expand Up @@ -594,7 +593,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "dbc0edb2",
"metadata": {},
Expand Down Expand Up @@ -639,7 +637,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "40467b70",
"metadata": {},
Expand Down Expand Up @@ -849,7 +846,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "977b4c09",
"metadata": {},
Expand Down Expand Up @@ -935,7 +931,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -949,7 +945,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.8.10"
},
"toc": {
"base_numbering": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ def get_coupled_variables(self, variables):
current = variables["Total current density"]
k = 100

if Domain == "Negative":
m_lith = pybamm.sigmoid(current, 0, k) # for lithation (current < 0)
m_delith = 1 - m_lith # for delithiation (current > 0)
elif Domain == "Positive":
m_delith = pybamm.sigmoid(current, 0, k) # for delithation (current < 0)
m_lith = 1 - m_delith # for lithiation (current > 0)
if Domain == "Positive":
lithiation_current = current
elif Domain == "Negative":
lithiation_current = -current

m_lith = pybamm.sigmoid(0, lithiation_current, k) # lithiation_current > 0
m_delith = 1 - m_lith # lithiation_current < 0

phase_name = self.phase_name

Expand Down

0 comments on commit e00c3c4

Please sign in to comment.