You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm still working on the code, and I've reached a point where I need to update the initial conditions of the model. Specifically, I'm trying to ensure that each simulation begins from the endpoint of the previous one. To do this, I need to update the X-averaged negative and positive particle concentrations ([mol.m^-3]) for each simulation.
I've already estimated these concentrations based on x_100, x_0, y_0, y_100, and the state of charge, although I'm not entirely sure if my approach for this estimation is correct.
Here's my current challenge: I need guidance on how to convert these estimated X-averaged negative and positive particle concentrations to the required format of [mol.m^-3]. If there's a better or alternative way to achieve this, I'm all ears.
I appreciate any help or suggestions you might have. Below is a snippet of my code where I plan to implement this conversion or update:
inputs = {"V_min": Vmin, "V_max": Vmax, "Q_n": Q_n, "Q_p": Q_p, "Q_Li": n_Li * parameter_values.evaluate(param.F/3600) }
esoh_solver = pybamm.lithium_ion.ElectrodeSOHSolver(parameter_values, param)
esoh_sol = esoh_solver.solve(inputs)
x_100 = esoh_sol["x_100"]
y_100 = esoh_sol["y_100"]
x_0 = esoh_sol["x_0"]
y_0 = esoh_sol["y_0"]
ics = {}
start = 1
for var in model.initial_conditions:
if var.name == "X-averaged negative particle concentration [mol.m-3]":
ics[var.name] = (((x_100-x_0)*SOC_0+x_0))* np.ones((model.variables[var.name].size, 2)) #here estimated X-averaged #negative particle concentration need to convert to [mol.m-3]
elif var.name == "X-averaged positive particle concentration [mol.m-3]":
ics[var.name] = (((y_100-y_0)*SOC_0+y_0)) * np.ones((model.variables[var.name].size, 2))#here estimated X-averaged #positive particle concentration need to convert [mol.m-3]
elif var.name == "Discharge capacity [A.h]":
ics[var.name] = np.zeros(1)
else:
if var.name == "Porosity times concentration":
for child in var.children:
# end = start + model.variables[child.name].size
# ics[child.name] = y[start:end, np.newaxis]
end = start + 1
ics[child.name] = y[start] * np.ones((model.variables[var.name].size, 1))
start = end
else:
# end = start + model.variables[var.name].size
# ics[var.name] = y[start:end, np.newaxis]
end = start + 1
ics[var.name] = y[start] * np.ones((model.variables[var.name].size, 1))
start = end
model.set_initial_conditions_from(ics)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm still working on the code, and I've reached a point where I need to update the initial conditions of the model. Specifically, I'm trying to ensure that each simulation begins from the endpoint of the previous one. To do this, I need to update the X-averaged negative and positive particle concentrations ([mol.m^-3]) for each simulation.
I've already estimated these concentrations based on x_100, x_0, y_0, y_100, and the state of charge, although I'm not entirely sure if my approach for this estimation is correct.
Here's my current challenge: I need guidance on how to convert these estimated X-averaged negative and positive particle concentrations to the required format of [mol.m^-3]. If there's a better or alternative way to achieve this, I'm all ears.
I appreciate any help or suggestions you might have. Below is a snippet of my code where I plan to implement this conversion or update:
Beta Was this translation helpful? Give feedback.
All reactions