Skip to content

Commit 3c71c39

Browse files
authored
Merge pull request #64 from alan-turing-institute/58-separate-out-tested-models
58 separate out tested models
2 parents c555f5d + 3bb428a commit 3c71c39

File tree

3 files changed

+35
-79
lines changed

3 files changed

+35
-79
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ The scope of this package is to provide a framework for building **0D models** a
99
2. **Valves**
1010
3. **Vessels**
1111

12-
## Clone the ModularCirc GitHub repo locally
12+
The current version of the published package contains two models:
13+
1. Naghavi model.
14+
2. Korakianitis Mixed model.
1315

14-
Run:
15-
16-
```
17-
git clone https://github.com/alan-turing-institute/ModularCirc
18-
cd ModularCirc
19-
```
16+
For other models currently under development, see the `dev` branch.
2017

2118
## Setup Conda or python virtual environment
2219

@@ -43,15 +40,26 @@ Activate the python environment: `source venv/bin/activate`
4340

4441
Proceed to installing the ModularCirc package.
4542

46-
## Installation
43+
## Installing ModularCirc
44+
45+
### pip install
4746

4847
To install the pip package:
4948

5049
```bash
51-
python -m pip install ModularCirc_LevanBokeria
50+
python -m pip install ModularCirc
5251
```
5352

54-
From source:
53+
### Installation from source:
54+
55+
Clone the ModularCirc GitHub repo locally.
56+
57+
Run:
58+
59+
```
60+
git clone https://github.com/alan-turing-institute/ModularCirc
61+
cd ModularCirc
62+
```
5563

5664
After downloading the GitHub repository, from the repo directory run:
5765

@@ -122,14 +130,6 @@ p_lv = solver.model.components['lv'].P_i.values
122130
## Example values pv loops for all 4 chambers:
123131
![Example PV loops!](Figures/PV_loops.png)
124132

125-
## Run tests
126-
127-
You can run locally the tests by running the following command:
128-
```bash
129-
python -m unittest discover -s tests
130-
```
131-
there is also a autamtated test pipeline that runs the tests on every push to the repository (see [here](.github/workflows/ci.yml)).
132-
133133
<!-- prettier-ignore-start -->
134134
[actions-badge]: https://github.com/alan-turing-institute/ModularCirc/workflows/CI/badge.svg
135135
[actions-link]: https://github.com/alan-turing-institute/ModularCirc/actions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ModularCirc"
7-
version = "0.1.3"
7+
version = "0.2.0"
88
authors = [
99
{name = "Maximilian Balmus", email = "mbalmus@turing.ac.uk"}
1010
]

src/ModularCirc/Models/README.md

Lines changed: 16 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Models directory
2-
This file contains the description of the model and model parameter classes defined in this module.
2+
This folder contains the description of the model and model parameter classes defined in this module.
33
The models presented here are made of three types of components:
44
- *arteries*: RLC components (complex) and R components (simple)
55
- *chamber*: linear elatic (simple) and mixed (complex, linear active and exponential passive behaviour)
66
- *valves*: non-ideal diodes (simple), simple Bernoulli (medium), Maynard valves (complex, where the motion the valves is modelled).
77

88
## 1. Naghavi et al. model
99
Relevant files and classes:
10-
- `ModularCirc/Models/NaghaviModel.py`, where the `NaghaviModel` class is defined
11-
- `ModularCirc/Models/NaghaviModelParameters.py`, where the `NaghaviModelParameters` class is defined.
10+
- `src/ModularCirc/Models/NaghaviModel.py`, where the `NaghaviModel` class is defined
11+
- `src/ModularCirc/Models/NaghaviModelParameters.py`, where the `NaghaviModelParameters` class is defined.
1212

1313
A CV model described in Rapid Estimation of Left Ventricular Contractility with a Physics-Informed Neural Network Inverse Modeling Approach (https://arxiv.org/html/2401.07331v1).
1414
The model is comprised of the following components:
@@ -24,21 +24,21 @@ The model is comprised of the following components:
2424

2525
[<img src='Figures/NaghavidModel_circut.png'>]()
2626

27-
## 2. Korakianitis and Shi model (V1)
27+
## 2. Korakianitis and Shi model
2828
Relevant files and classes:
29-
- `ModularCirc/Models/KorakianitisModel.py`, where the `KorakianitisModel` class is defined
30-
- `ModularCirc/Models/KorakianitisModel_parameters.py`, where the `KorakianitisModel_parameters` class is defined
29+
- `src/ModularCirc/Models/KorakianitisMixedModel.py`, where the `KorakianitisMixedModel` class is defined
30+
- `src/ModularCirc/Models/KorakianitisMixedModel_parameters.py`, where the `KorakianitisMixedModel_parameters` class is defined
3131

3232
A simplified CV model described in A concentrated parameter model for the human cardiovascular system
3333
including heart valve dynamics and atrioventricular interaction (https://www.sciencedirect.com/science/article/pii/S1350453305002195?via%3Dihub).
34-
**Here, we simplified the model by eliminating (1) the motion of the annulus fibrosus and (2) the motion of the leaflets, replaced with a simple Bernoulli model.**
34+
**In KorakianitisMixedModel, we simplified the model by eliminating (1) the motion of the annulus fibrosus, (2) the motion of the leaflets, replaced with a simple Bernoulli model and (3) the cardiac chamber laws are replaced with mixed law (exponential for the passive filling and linear for contraction).**
3535
This model is comprised of the following components:
36-
- left atrium: linear time-varying elastance model
37-
- **6 parameters**
36+
- left atrium: time-varying elastance model, based on weighted sum of passive (exponential) and active (linear) laws
37+
- **7 parameters**
3838
- mitral valve: simple Bernoulli model
3939
- **2 parameters**
40-
- left ventricle: linear time-varying elastance model
41-
- **5 parameters**
40+
- left ventricle: time-varying elastance model, based on weighted sum of passive (exponential) and active (linear) laws
41+
- **6 parameters**
4242
- aortic valve: simple Bernoulli model
4343
- **2 parameters**
4444
- aortic sinus (RLC 3 component windkessel)
@@ -48,12 +48,12 @@ This model is comprised of the following components:
4848
- **4 parameters**
4949
- systemic venous system (RLC 3 component windkessel)
5050
- **3 parameters** (assume that venous impedance is zero)
51-
- right atrium: linear time-varying elastance model
52-
- **6 parameters**
51+
- right atrium: time-varying elastance model, based on weighted sum of passive (exponential) and active (linear) laws
52+
- **7 parameters**
5353
- tricuspid valve: simple Bernoulli model
5454
- **2 parameters**
55-
- right ventricle: linear time-varying elastance model
56-
- **5 parameters**
55+
- right ventricle: time-varying elastance model, based on weighted sum of passive (exponential) and active (linear) laws
56+
- **6 parameters**
5757
- pulmonary valve: simple Bernoulli model
5858
- **2 parameters**
5959
- pulmonary artery sinus (RLC 3 component windkessel)
@@ -63,50 +63,6 @@ This model is comprised of the following components:
6363
- pulmonary venous system (RLC 3 component windessel)
6464
- **3 parameters** (assume that venous impedance is zero)
6565

66-
**Total set of parameters sums up to 55.**
66+
**Total set of parameters sums up to 57.**
6767

6868
[<img src=Figures/KorakianitisModel_circuit.png>]()
69-
70-
71-
## 3. Korakianitis and Shi model (V2)
72-
Relevant files and classes:
73-
- `ModularCirc/Models/KorakianitisMaynardModel.py`, where the `KorakianitisMaynardModel` class is defined
74-
- `ModularCirc/Models/KorakianitisMaynardModel_parameters.py`, where the `KorakianitisMaynardModel_parameters` class is defined
75-
76-
This model follow the same strucutre as **Korakianitis and Shi model (V1)**, however the valves are replaced with Maynard type valves which are more similar to the ones used in the original paper.
77-
**This introduces 2 additional parameters per valve (one for the valve closing rate and one for the opening rate).**
78-
79-
Components used:
80-
- arteries: RLC with sinuses being represented as a separate RLC component. (3/4 components)
81-
- valves: **Maynard** valves (4 parameters)
82-
- chambers: **linear models** (5/6 parameters of ventricles/arteries)
83-
84-
**Total set of parameters sums up to 60.**
85-
86-
87-
## 4. Korakianitis and Shi model (V3)
88-
Relevant files and classes:
89-
- `ModularCirc/Models/KorakianitisMixedMaynardModel.py`, where the `KorakianitisMixedMaynardModel` class is defined
90-
- `ModularCirc/Models/KorakianitisMixedMaynardModel_parameters.py`, where the `KorakianitisMixedMaynardModel_parameters` class is defined.
91-
92-
This model is again based on the orinal structure of **Korakianitis and Shi model (V1)**.
93-
Here, the following components were used:
94-
- chambers: **mixed models** (6/7 parameters of ventricles/arteries)
95-
- valves: **Maynard** valves (4 parameters)
96-
- arteries: RLC with sinuses being represented as a separate RLC component. (3/4 parameters)
97-
98-
**Total parameter count: 64**
99-
100-
101-
## 5. Simplified Korakianitis and Shi model (V1)
102-
Relevant files and classes:
103-
- `ModularCirc/Models/MixedHeartMaynard4eWindkessel.py`, where the `MixedHeartMaynard4eWindkessel` class is defined
104-
- `ModularCirc/Models/MixedHeartMaynard4eWindkessel_parameters.py`, where the `MixedHeartMaynard4eWindkessel` class is defined.
105-
106-
This model is again based on the orinal structure of **Korakianitis and Shi model (V1)**.
107-
Here, the following components were used:
108-
- chambers: **mixed models** (6/7 parameters of ventricles/arteries)
109-
- valves: **Maynard** valves (4 parameters)
110-
- arteries: RLC with sinuses represented as a separate R component and capilaries similarly by R. This equivalent to the systemic and pulmonary arterial system being simulated as 2 4-component Windkessels in series with one another. (7/8 parameters systemic + 7/8 parameters pulmonary)
111-
112-
**Total parameter count: 58 or 56 (if you choose to add the capilary resistance to the resistance of the previous component)**

0 commit comments

Comments
 (0)