Skip to content

Commit

Permalink
Fix annotations for lower Python versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-randall committed Jul 2, 2024
1 parent fdf1a5f commit e13acd8
Show file tree
Hide file tree
Showing 113 changed files with 16,166 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.11']

defaults:
run:
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

[![CI][ci-b]][ci-l] ![tests][test-b] ![coverage][cov-b] [![pep8][pep-b]][pep-l]

[ci-b]: https://github.com/c-randall/thevenin/actions/workflows/ci.yaml/badge.svg
[ci-l]: https://github.com/c-randall/thevenin/actions/workflows/ci.yaml
[ci-b]: https://github.com/ROVI-org/thevenin/actions/workflows/ci.yaml/badge.svg
[ci-l]: https://github.com/ROVI-org/thevenin/actions/workflows/ci.yaml

[test-b]: ./images/tests.svg
[cov-b]: ./images/coverage.svg
Expand All @@ -21,39 +21,47 @@
## Summary
This package is a wrapper for the well-known Thevenin equivalent circuit model. The model is comprised of a single series reistor followed by any number of parallel RC pairs. Figure 1 below illustrates a circuit with 2 RC paris; however, the model can be run with as few as zero, and as many as $N$.

<figure style="text-align: center">
<img alt="2RC Thevenin circuit." src="./images/thevenin_circuit.png" style="width: 75%; min-width: 250px; max-width: 500px;"/>
<figcaption>Figure 1: 2RC Thevenin circuit.</figcaption>
</figure>
<p style="text-align: center">
<img alt="2RC Thevenin circuit." src="./images/thevenin_circuit.png" style="width: 75%; min-width: 250px; max-width: 500px;"/></br>
Figure 1: 2RC Thevenin circuit.
</p>

This system is governed by the evolution of the state of charge (soc, $-$), RC overpotentials ($V_j$, V), cell voltage ($V_{\rm cell}$, V), and temperature ($T_{\rm cell}$, K). soc and $V_j$ evolve in time as
$$

$
\begin{align}
&\frac{d\rm soc}{dt} = \frac{-I}{3600Q}, \\
&\frac{dV_j}{dt} = -\frac{V_j}{R_jC_j} + \frac{I}{C_j},
\end{align}
$$
$

where $I$ is the load current (A), $Q$ is the cell capacity (Ah), and $R_j$ and $C_j$ are the resistance (Ohm) and capacitance (F) of each RC pair $j$. Note that the sign convention for $I$ is chosen such that positive $I$ discharges the battery (reduces soc) and negative $I$ charges the battery (increases soc). This convention is consistent with common higher-fidelty models, e.g., the single particle model or pseudo-2D model. While it's not explicitly included in the equations above, $R_j$ and $C_j$ are functions of soc and $T_{\rm cell}$. The temperature increases while the cell is active according to

$$
\begin{equation}
mC_p\frac{dT_{\rm cell}}{dt} = \dot{Q}_{\rm gen} + \dot{Q}_{\rm conv},
\end{equation}
$$

where $m$ is mass (kg), $C_p$ is specific heat capacity (J/kg/K), $\dot{Q}_{\rm gen}$ is the heat generation (W), and $\dot{Q}_{\rm conv}$ is the convective heat loss (W). Heat generation and convection are defined by

$$
\begin{align}
&\dot{Q}_{\rm gen} = I \times (V_{\rm ocv}({\rm soc}) - V_{\rm cell}), \\
&\dot{Q}_{\rm conv} = hA(T_{\infty} - T_{\rm cell}),
\end{align}
$$

where $h$ is the convecitive heat transfer coefficient (W/m$^2$/K), $A$ is heat loss area (m$^2$), and $T_{\infty}$ is the air/room temperature (K). $V_{\rm ocv}$ is the open circuit voltage (V) and is a function of soc.

Finally, the overall cell voltage is

$$
\begin{equation}
V_{\rm cell} = V_{\rm ocv}({\rm soc}) - \sum_j V_j - IR_0,
\end{equation}
$$

where $R_0$ the lone series resistance (Ohm), as shown in Figure 1. Just like the other resistive elements, $R_0$ is a function of soc and $T_{\rm cell}$.

## Installation
Expand Down
4 changes: 4 additions & 0 deletions docs/_build/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4566d29b1ee0401b1bdd5694fa563ac7
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added docs/_build/.doctrees/api/index.doctree
Binary file not shown.
Binary file added docs/_build/.doctrees/api/thevenin/index.doctree
Binary file not shown.
Binary file added docs/_build/.doctrees/environment.pickle
Binary file not shown.
Binary file added docs/_build/.doctrees/examples/example1.doctree
Binary file not shown.
Binary file added docs/_build/.doctrees/examples/example2.doctree
Binary file not shown.
Binary file added docs/_build/.doctrees/examples/index.doctree
Binary file not shown.
Binary file added docs/_build/.doctrees/index.doctree
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading

0 comments on commit e13acd8

Please sign in to comment.