Skip to main content

TWAICE Simulation Model - Matlab Simulink: How to Get Started

User guide on how to get started with TWAICE Simulation Models with Matlab Simulink

Ece Aras avatar
Written by Ece Aras
Updated over 4 months ago

This article aims to enable users to get started with TWAICE Simulation Models and guide users through model download, license activation, how to run simulations and use case examples.

Model Download

Download the TWAICE battery simulation model trial package using the link provided in the e-mail. The download will start automatically by clicking the link.

License Activation

  1. Open your file explorer and find the zipped folder called “TWAICE-demo-model.zip”.

  2. To unzip the entire folder, right-click to select Extract All, and select a destination to extract the files.

  3. Open the file “RunMe_TWAICE_Cell_Model_Demo_v10_4_1.m” in Matlab by double clicking.

4. Copy the Product Key from your e-mail and paste it into the “RunMe_TWAICE_Cell_Model_Demo_v10_4_1.m” in line 21 (replacing ‘XXXXXX- XXXXXX- XXXXXX- XXXXXX- XXXXXX- XXXXXX’)

Congratulations - you are now ready to simulate!

Run your first simulation

Firstly, you must load all parameters and prepare the model to simulate by running the Matlab script “RunMe_TWAICE_Cell_Model_Demo_v10_4_1.m”.

Now the Simulink model “TWAICE_Cell_Model_Demo_v10_4_1.slx” will load and open.

The easiest way to simulate is by simply using the default parameters and just click “Run” in the Simulink model.

Once the simulation is finished, view the results in Simulink by clicking on the respective scopes in the simulation results section.

Scale the axes of the scope to view the results in an optimal view.

Model Information

Model Specifications

  • Voltage Range: 2.5 – 4.2 V

  • State of Charge Range: 0 – 100 %

  • Nominal Capacity: 2.6 Ah

  • C-rates (dch / ch): -1.0 – 1.0

  • Ambient Temperature Range: 10 - 40°C

Model Outputs

In the table below, find all model outputs and descriptions.

Name

Unit

Description

1

I

A

Cell current

2

V

V

Cell voltage

3

T

°C

Cell temperature

4

SOC

%

State of charge

5

SOHc

%

State of health (capacity)

6

SOHr

%

State of health (resistance)

7

P

W

Cell power

8

Q

Ah

Charge throughput

9

Ploss

W

Cell losses

10*

SOHc_UB

%

State of health (capacity) upper bound

11*

SOHc_LB

%

State of health (capacity) lower bound

12**

SOH_LI

%

State of health (lithium inventory)

13**

SOH_PE

%

State of health (positive electrode)

14**

SOH_NE

%

State of health (negative electrode)

15***

SOH_swelling

%

State of health (swelling force)

16****

V_NE

V

Anode potential

17****

V_PE

V

Cathode potential

18****

Ah_plating

Ah

Charge throughput while Li-plating

*Requires TWAICE Model “Pro” & Add-On “Confidence Interval”

**Requires TWAICE Model “Pro” & Add-On “Degradation Modes”

***Requires TWAICE Model “Pro” & Add-On “Swelling Force”

****Requires TWAICE Model “Pro” & Add-On “Half Cell Potentials”

Use Cases

Presented below are illustrative examples showcasing how other companies have employed the TWAICE Battery Simulation Model to get a better understanding of the influence of operational stress factors on battery aging.

Assessment of the influence of operational stress factors on the lifespan of the battery

In modern transportation, electric vehicle (EV) fleets have emerged as pioneering symbols of sustainability and innovation. However, amidst the buzz of zero-emission travel and cutting-edge technology, a critical challenge looms large. It revolves around a seemingly simple yet complex aspect of EV operation: the influence of operational stress factors on the lifespan of the battery. One prominent example constitutes recharging. While the act of recharging seems simple, the hidden complexities of how a battery degrades during recharging have profound consequences for EV fleet operators in both technical and financial terms, e.g., vehicle availability or operational costs.

Decision-making based on simulations has significantly helped fleet operators overcome the challenges associated with understanding and managing aging. Simulations provide a controlled and scalable environment to model various scenarios and assess the impact of different operational stress factors on battery performance and aging. For instance, simulations replicate various recharging scenarios, considering factors like charging frequency, charging current, and battery state of charge. This helped fleet operators determine optimal charging strategies that balance battery health, vehicle availability, and operational costs.

In this example, the influence of operational stress factors on battery aging is illustrated by considering four different recharging scenarios:

  • AC charging before start of next operation

  • AC charging immediately after operation

  • DC fast charging before start of next operation

  • DC fast charging immediately after operation

The respective load profiles for one week are provided in the graph below.

In the following, a brief step-by-step guide illustrating the simulation of a recharging scenario is provided, exemplifying the process of using the TWAICE Battery Simulation Model for the described use case.

  1. Load all parameters and prepare the model to simulate by running the Matlab script “RunMe_TWAICE_Cell_Model_Demo_v9_5_1.m”.

  2. Go to the “Exemplary_Use_Cases” folder and then to the “Data” folder. Afterwards, double-click on “Data_AC_beforeop.mat” to load the timeseries data

  3. Double-click on the subsystem “TWAICE Cell Model” in Simulink, set the parameters as follows and confirm by clicking on the OK button:

4. Double-click on the subsystem “Virtual Battery Tester”, set the parameters as follows and confirm by clicking on the OK button:

  • Main Selection: Check the box “Timeseries Data”

  • Select the “Timeseries Data” tab and set the parameters as follows.

5. Click “Run” in the Simulink model to start the simulation

Once the simulation is finished, view the results in Simulink by clicking on the respective scopes in the simulation results section (this step can be skipped).

To conduct the sensitivity analysis, the same simulation needs to be conducted with other input profiles. To streamline this, the outcomes have been pre-generated in advance. You can access all these results by executing the Matlab script “RunMe_Use_Case_Visualization.m” in the “Examplary_Use_Cases” folder.

The provided graphs show a comparison between the various recharging scenarios. After simulating for 8 years and ~6300Ah, the results show that the battery SOHc is 85.3% for “AC before next operation”, 81.2% for “AC immediately after operation”, 82.3% for “DC before next operation”, and less than 80% for “DC immediately after operation”. The simulations suggest that initiating the recharging process right away results in more significant degradation compared to postponing it until there is still adequate time for recharging. Therefore, it can be concluded that the state in which the battery is being rested significantly affects battery degradation. Furthermore, a higher charging current as applied during DC charging reveals a higher degradation rate.

These findings suggest that it is essential to consider both the resting SOC level and the C-rate as significant stress factors when devising a charging strategy for an EV fleet. This information allows for optimizing the balance between battery health, vehicle availability, and operational costs.

Assessment of the change of the open-circuit-voltage (OCV) curve with aging

The OCV is a key element in electric models of lithium-ion batteries and describes the thermodynamic voltage at equilibrium. Its specific shape is defined by the materials in the anode and cathode as well as the electrode’s balancing. Since battery materials age dependent on external stress factors, the OCV changes over lifetime. Unfortunately, the change of this OCV curve over aging is often neglected, resulting in major challenges regarding accuracy of battery models over lifetime.

In this example, the change of the OCV curve with aging is illustrated by considering the above-mentioned recharging scenario “DC fast charging immediately after operation”.

Once the simulation is finished (instructions see above), the OCV curve can be analyzed at different SOH levels. To streamline this, the outcomes have been pre-generated in advance. You can access all these results by executing the Matlab script “RunMe_OCV_Evaluation.m” in the “Examplary_Use_Cases” folder.

The provided graphs show the change of the OCV curve with aging and the resulting error between a new and an aged cell. As can be seen, the difference in OCV between the new and the aged cell exceeds 3%, particularly at mid and low SOCs. The simulation indicates that an OCV error of this nature may lead to a deviation of up to 6% in estimating the SOC, either underestimating or overestimating in the worst-case scenario. Consequently, it can be inferred that incorporating aging-related updates to the OCV is highly advantageous for achieving precise cell state estimations. This approach not only enhances the accuracy of the electric model, particularly for cells experiencing degradation, but also enables the utilization of the updated OCV for tasks such as parameterizing state estimation filters like Kalman filters for estimating State of Charge and State of Health.

Support and Extra Materials

If you have any questions, please reach out to your TWAICE contact.

Check out our Demo Video Series: TWAICE Simulation Model article for how to start using TWAICE Simulation Model on MATLAB Simulink.

How to change simulation parameters using the Virtual Battery Tester Block:

How to make a simulation study using the TWAICE_simulation_automation_toolkit.xlsm:

Did this answer your question?