Discharging
The discharge demo is the Hello World of battery simulation. It is a simple and effective way to get a feel for the insights and workflows possible when battery behaviour moves into the realm of simulation.
In this example, a Breathe Model block is connected to an Electrical Source block, which has been set by default to discharge with a constant 1C rate from a fully charged state at 25°C until the lower voltage limit is reached.

If you are new to battery simulation, this is a great example to modify and explore to get familiar with the graphical (Simulink-based) Breathe Model workflow. Try changing initial conditions, discharge rates, or even try to modify the example from discharge into low-temperature charging.
Accessing the demo
Navigate to the .../Examples/ folder in your Breathe Model download folder, and open the Demo_Discharge.slx file.
This demo is built as a Simulink Model (indicated by the .slx file-type), so interaction is handled via Simulink's graphical programming interface.
Simulating a 1C discharge
To enable the simulation to correctly run, ensure the installation instructions have been followed. Pressing CTRL+D with the Simulink model open can quickly identify if the Breathe Model library has been correctly installed, as there will be no errors while the simulation initialises.
Running the simulation
The simulation can be run via the Simulate model button. In the Simulink toolbar, the button is located at SIMULATION > SIMULATE > RUN.
A progress bar will appear along the bottom of the Simulink window while the simulation is ongoing. Once complete, the status in the bottom left corner will indicate Ready.
Visualising results
The outputs of Breathe Model recorded during the simulation can be viewed using the Simulink Data Inspector. This can be accessed via the Simulink toolbar: SIMULATION > REVIEW RESULTS > Data Inspector tool.
This is built in Simulink functionality, the detailed documentation for which can be found in MathWorks' Simulation Data Inspector documentation.
Key simulation components
There are 6 key elements to this demo that can serve as a way to get to know the fundamental elements of battery simulation:
- Breathe Model
- Electrical load
- Thermal load
- Model outputs
- Terminating conditions
- Solver configuration
Breathe Model
Refer to the
Breathe Modelblock documentation for details on the ports, outputs, and parameters.

In this demo, the Breathe Model electrical ports are connected to the Electrical_Source utility block, the thermal port is connected to the Simscape Convective_Heat_Transfer utility, and the outputs are organised in the signal_scopes block.
The Breathe Model Block Parameters are configured out of the box to be fully charged (SoC of 1.0), at room temperature (25°C), with no ageing.
These values are set within the Block Parameters context window of the Breathe Model block, and can be accessed by simply double clicking the Breathe Model block.
Default initial conditions:
| Parameter | Default Value | Unit |
|---|---|---|
| State of Charge (SoC) | 1.0 | - |
| Cell temperature | 25 | °C |
Default ageing state:
| Label | Description | Default Value | Unit |
|---|---|---|---|
LLI |
Loss of Lithium Inventory | 0.00 | - |
LAMNE |
Loss of Active Material in the Negative Electrode | 0.00 | - |
LAMPE |
Loss of Active Material in the Positive Electrode | 0.00 | - |
Signal_scopes: model outputs
The outputs of Breathe Model are organised in a Subsystem block for cleanliness of model canvas labelled signal_scopes. The outputs available can be viewed by double clicking the signal_scopes subsystem.
The outputs available are detailed in the Breathe Model documentation.
Electrical load
This is where we can adjust the electrical behaviour we induce on the Breathe Model block.
Out of the box, this has been configured to discharge with a constant 1C current.

There are three components to this section, in order of left to right:
Constant_electrical_source
Constant value block, default value set to the equivalent of -1C, in current. For example, for the Molicel P45B Breathe Model instance, this is set to -4.5.
The input value is dimensionless in this block, but interpreted as current or power based on the Mode set in the Electrical_Source Block Parameters.
In both "Current (A)" and "Power (W)" Mode, a value < 0 invokes a discharge, and a value > 0 invokes a charge.
To change this value, open the Block Parameters context window of the Constant_electrical_source block by double clicking on the box and modifying the Constant value parameter.
Rate setting
To map this constant to a desired rate, i.e. C-rate or P-rate, you can always refer to the Breathe Model instance nominal capacity and nominal energy by:
- Opening the
Block Parameterscontext window of theBreathe Modelblock by simply double clicking the block. - Pressing
Help
The nominal values for energy and capacity are listed under the "Cell characteristics" heading. Additionally, the model operating limits are also specified under the "Model operating limits" heading, for both C-rate and P-rate (as well as temperature).
Simulink-PS Converter
This is needed to pass values from a Simulink-type block (Constant_electrical_source) into a Simscape-type block (Electrical_Source).
This is a simple input-output block, but in case further details are required, the MathWorks documentation can be found here.
Electrical_Source
Refer to the
Electrical_Sourceblock documentation for details on the ports, outputs, and parameters.
By default, the Mode is set to "Current (A)", or, Mode = 0. This means a constant current will be applied to the Breathe Model block until the end conditions specified have been reached.
To change the Mode type, for example to "Power (W)", open the Block Parameters context window of the Electrical_Source block by double clicking the block and changing the parameter Mode value (e.g. to 2 for Power (W)).
Thermal load
This section defines the thermal environment with which the Breathe Model block is interacting. The key parameters needed to define this environment are (in order of appearance from top to bottom):
1. Convective_heat_transfer
2. Ambient_temperature source

Both of these are part of the standard Simscape library.
Convective_heat_transfer
This dictates the heat transfer from the Breathe Model to the ambient heat source, modelling heat transfer via fluid motion.
Three parameters are needed to define this behaviour:
| Parameter | Default Value | Unit |
|---|---|---|
| Convection Type | Constant | - |
| Area | Cell dependent | m2 |
| Heat transfer coefficient | 35 | W/(K*m2) |
The Surface area of the cell model being used can be found in the meta information section of the corresponding parameter JSON file. For the MoliP45B cell example used here the cell area value is 0.00537 m2.
This is a standard Simscape block. If further details are needed, refer to the MathWorks' Convective Heat Transfer documentation.
Ambient_temperature
Ambient_Temperature is a Temperature Source block that enables the definition of a constant source of thermal energy. It is an ideal source which remains constant regardless of the heat added/removed from the Breathe Model block.
The only parameter for this block is the constant temperature.
| Parameter | Default Value | Unit |
|---|---|---|
| Temperature | 25 | °C |
This is a standard Simscape block. If further details are needed, refer to the MathWorks' Temperature Source documentation.
Terminating conditions
There are two sources of simulation terminating conditions:
- Stop Time
- Terminating conditions

Stop Time
Located in the Simulink toolbar under SIMULATION > SIMULATE > Stop Time
The simulation will run until the duration of the simulation reaches this value. For this simulation, this has been set to an excessively large value to enable the terminating conditions defined as voltage limits to be the limiting factor.
| Parameter | Default Value | Unit |
|---|---|---|
| Stop time | 50000 | s |
Terminating conditions
This uses the outputs of the Breathe Model block to inform the simulation to be stopped. By default, these are defined as voltage limits (upper and lower values, as defined by the Breathe Model cell instance).
Solver configuration
The recommended solvers to use with Breathe Model are variable-time and implicit solvers, e.g., ode15s, or daesol solver. Variable-time and implicit solvers offer stability and rapid simulations of the underpinning physics-based model equations. For fixed step solving, an implicit scheme is required such as backward Euler (ode1be) or ode14x with a recommended step size of 1 s.