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

Better optimizer for initializing half-cell soc #4873

Merged
merged 6 commits into from
Mar 5, 2025
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, name="ElectrodeSOH model"):
Q_w = pybamm.InputParameter("Q_w")
T_ref = param.T_ref
U_w = param.p.prim.U
Q = Q_w * (x_100 - x_0)
Q = Q_w * (x_0 - x_100)

V_max = param.ocp_soc_100
V_min = param.ocp_soc_0
Expand All @@ -49,13 +49,12 @@ def __init__(self, name="ElectrodeSOH model"):
"Uw(x_100)": U_w(x_100, T_ref),
"Uw(x_0)": U_w(x_0, T_ref),
"Q_w": Q_w,
"Q_w * (x_100 - x_0)": Q_w * (x_100 - x_0),
}

@property
def default_solver(self):
# Use AlgebraicSolver as CasadiAlgebraicSolver gives unnecessary warnings
return pybamm.AlgebraicSolver()
return pybamm.AlgebraicSolver(method="minimize L-BFGS-B", tol=1e-7)


def get_initial_stoichiometry_half_cell(
Expand Down