change some parameters simultaneously #4042
Unanswered
alirahdarian
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Can you post the error? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi @rtimms, I came across this error and believe the cause is the assumption that neither maximum concentration is an input in I think this can be rectified by taking the value from See also |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use the following code to change 5 parameters (5 inputs) in the model but it returns an error while it works when I change only two parameters. I want to know how can I change these 5 parameters simultaneously.
import liionpack as lp
import pybamm
import numpy as np
I_mag = 5.0
OCV_init = 4.0 # used for intial guess
Ri_init = 5e-2 # used for intial guess
R_busbar = 1.5e-3
R_connection = 1e-2
Np = 2
Ns = 1
Nbatt = Np * Ns
netlist = lp.setup_circuit(
Np=Np, Ns=Ns, Rb=R_busbar, Rc=R_connection, Ri=Ri_init, V=OCV_init, I=I_mag
)
#print(netlist)
experiment = pybamm.Experiment(
[
"Charge at 2 A for 30 minutes",
"Rest for 15 minutes",
"Discharge at 2 A for 30 minutes",
"Rest for 15 minutes",
],
period="10 seconds",
)
parameter_values = pybamm.ParameterValues("Chen2020")
parameter_values.update({"Negative electrode diffusivity [m2.s-1]": "[input]"})
parameter_values.update({"Positive electrode diffusivity [m2.s-1]": "[input]"})
parameter_values.update({"Maximum concentration in negative electrode [mol.m-3]": "[input]"})
parameter_values.update({"Maximum concentration in positive electrode [mol.m-3]": "[input]"})
parameter_values.update({"SEI resistivity [Ohm.m]": "[input]"})
inputs = {"Negative electrode diffusivity [m2.s-1]": [3.3e-14,3.3e-14],
"Positive electrode diffusivity [m2.s-1]": [4e-15,4e-15],
"Maximum concentration in negative electrode [mol.m-3]": [33133.0,33133.0],
"Maximum concentration in positive electrode [mol.m-3]": [63104.0,63104.0],
"SEI resistivity [Ohm.m]": [200000.0,200000]
}
SPMe = pybamm.models.full_battery_models.lithium_ion.SPMe()
output = lp.solve(
netlist=netlist,
parameter_values=parameter_values,
experiment=experiment,
inputs=inputs,
initial_soc=0.5
)
print(parameter_values)
#lp.plot_output(output)
#lp.show_plots()
Beta Was this translation helpful? Give feedback.
All reactions