Dynamic analysis II¶
In this example we simulate different SOC breakpoints for the baseline and virtual cell with 5% less NPratio, and compare the capacity and DCIR.
In [1]:
Copied!
from breathe_simulate import api_interface as api
from breathe_simulate import Cycler
from breathe_simulate import enable_notebook_plotly
import plotly.express as px
enable_notebook_plotly()
from breathe_simulate import api_interface as api
from breathe_simulate import Cycler
from breathe_simulate import enable_notebook_plotly
import plotly.express as px
enable_notebook_plotly()
As before, we first import the necessary modules and define the base battery, cycler, and designs.
In [2]:
Copied!
base_params = api.get_design_parameters("Molicel P45B")
eqm_results = api.get_eqm_kpis("Molicel P45B")
designs = [{"designName": "Lower NP", "NPratio": base_params["NPratio"] * 0.95}]
baseline_capacity = eqm_results.capacity
cycler = Cycler(selected_unit="C", cell_capacity=baseline_capacity)
base_params = api.get_design_parameters("Molicel P45B")
eqm_results = api.get_eqm_kpis("Molicel P45B")
designs = [{"designName": "Lower NP", "NPratio": base_params["NPratio"] * 0.95}]
baseline_capacity = eqm_results.capacity
cycler = Cycler(selected_unit="C", cell_capacity=baseline_capacity)
We can pass a list of SOC breakpoints to the initialSoC parameter of the run_sim function to simulate different SOCs.
In [3]:
Copied!
# define some SOC breakpoints we want to simulate
soc_bps = [0.25, 0.5, 0.75]
# run a batch of simulations for different SOC breakpoints
output = api.run_sim(
base_battery="Molicel P45B",
cycler=cycler.cc_chg(1.0, 4.2),
designs=designs,
initialSoC=soc_bps,
initialTemperature_degC=21.0,
)
# define some SOC breakpoints we want to simulate
soc_bps = [0.25, 0.5, 0.75]
# run a batch of simulations for different SOC breakpoints
output = api.run_sim(
base_battery="Molicel P45B",
cycler=cycler.cc_chg(1.0, 4.2),
designs=designs,
initialSoC=soc_bps,
initialTemperature_degC=21.0,
)
Running...: 100%|██████████| 1/1 [00:04<00:00, 4.05s/ designs] Running...: 100%|██████████| 1/1 [00:09<00:00, 9.66s/ designs] Running...: 100%|██████████| 1/1 [00:13<00:00, 13.77s/ designs]
The dynamic output data is now returned as a list of dictionaries, where each dictionary contains the simulation results for a given SOC breakpoint.
In [4]:
Copied!
output.plot_voltage_response()
output.plot_voltage_response()