-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Issue while doing cycling experiments #2515
Comments
Can you try this? import pybamm
parameter_values = pybamm.ParameterValues("Chen2020")
experiment = pybamm.Experiment(
[
(
"Discharge at 5A until 2.5 V",
"Rest for 1 hour",
"Charge at 15W until 4.2 V",
"Hold at 4.2 V until 0.01A",
)
]
* 3
)
model = pybamm.lithium_ion.DFN()
sim = pybamm.Simulation(
model,
experiment=experiment,
parameter_values=parameter_values,
)
sim.solve()
sim.solution.cycles
sim.plot() |
When I tried the above mentioned code, I am getting this following error: TypeError Traceback (most recent call last) D:\Programs64\WPy64-31080\python-3.10.8.amd64\lib\site-packages\pybamm\experiments\experiment.py in init(self, operating_conditions, parameters, period) D:\Programs64\WPy64-31080\python-3.10.8.amd64\lib\site-packages\pybamm\experiments\experiment.py in read_operating_conditions(self, operating_conditions) TypeError: Operating conditions should be strings, not <class 'tuple'>. For example:
|
Can you do |
I am using 0.2.4 version. Pybamm won't work with python 3.10 version? |
The tuple and cycles functionality is not available in version 0.2.4. Please upgrade to a more recent version if you want that functionality. See #2435 for progress on python 3.10 (we are currently blocked by casadi) |
In order to update pybamm version, do I need to uninstall pybamm and install it again or do we have separate command for that? Is it okay if I still use Python 3.10, once I upgrade pybamm version? |
In general
No, you have to use python 3.8 or 3.9. With conda you can create a virtual environment with the appropriate python version conda create -n pybamm-env python=3.9
conda activate pybamm-env
conda install pybamm |
PyBaMM Version
v22.10
Python Version
3.10
Describe the bug
I am trying to run the basic experiment shown in Tutorial 5 with multiple cycles. When I put the paranthesis () indicating cycles, simulation is not running and I am getting operating conditions should be strings, not class tuple. Then I removed the paranthesis () inside square bracket and the simulation is running properly. But now I am not able to simulate specific cycles. For example, when I run the simulation, sim.solution.cycles, I am getting solution has no attribute cycles. Do I need to install something or missing something here? Thanks in advance
Steps to Reproduce
experiment = pybamm.Experiment(
[
"Discharge at 5A until 2.5 V",
"Rest for 1 hour",
"Charge at 15W until 4.2 V",
"Hold at 4.2 V until 0.01A"
] *3
)
sim = pybamm.Simulation(model, experiment = experiment, parameter_values = params)
sim.solve()
sim.plot(["Terminal voltage [V]", "Current [A]", "Terminal power [W]"])
sim.solution.cycles
Relevant log output
The text was updated successfully, but these errors were encountered: